Code_saturne v2.1.1 on a PBS Cluster

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Erwan Liberge

Code_saturne v2.1.1 on a PBS Cluster

Post by Erwan Liberge »

Hello,

I am using the 2.1.1 version on a PBS cluster. If code_saturne is launched on the frontend node (./runcase) it works well.

If i use the PBS batch (qsub runcase), i have to impose the case directory in the runcase file (code_saturne --case case_directory) otherwise the SRC,DATA, ... directories are unknown. It works without user fortran files, but if i add files in the SRC directory I have the following error message :

  File "/Calcul/Apps2/saturne4.2.4/v211/code_saturne-2.1.1/lib64/python2.6/site-packages/code_saturne/cs_case.py", line 1350, in prepare_data     d.compile_and_link()
  File "/Calcul/Apps2/saturne4.2.4/v211/code_saturne-2.1.1/lib64/python2.6/site-packages/code_saturne/cs_case_domain.py", line 627, in compile_and_link
   raise RunCaseError('Compile or link error.') cs_case_domain.RunCaseError: Compile or link error.

The last call of the "run_command function" in cs_compil.py returns 1 with "qsub runcase" ( it is 0 with "./runcase").  More precisely, it 's the "subprocess.Popen(cmd, shell=True, **kwargs)" which fails.

Have you any idea of the reason why I have this error ?

Best regards,

Erwan
Yvan Fournier

Re: Code_saturne v2.1.1 on a PBS Cluster

Post by Yvan Fournier »

Hello,
When running on a PBS cluster, you need to do a post-install step (see the installation manual if you need more details) and edit <install_prefix>/etc/code_saturne.cfg, or copy the file to $HOME/.code_saturne.cfg, an ensure the line indicating the batch type is uncommented and is set to PBS.
Once that is done, you will not have the error anymore when running "qsub runcase", but you will have it when running directly (which is assumed nonstandardd when a batch system is used).
We will try to make things more robust (or at least the error messages clearer) for future versions.
Best regards,
  Yvan
Erwan Liberge

Re: Code_saturne v2.1.1 on a PBS Cluster

Post by Erwan Liberge »

Hello,
 
thanks for the answer.
 
I have edited the code_saturne.cfg (Batch=PBS) , but the soumission script is here quite different, so I added directly in the runcase file the PBS options :
 
(for example)
 
#
#PBS -N essaiv211
#PBS -m abe -M eliberge@univ-lr.fr
#PBS -e sortie.err
#PBS -o sortie.log
#PBS -V
#PBS -l select=1:ncpus=12:mpiprocs=12:mem=500mb:cputype=westmere
#PBS -l walltime=26:00:00
#PBS -S /bin/bash
 
It works without the compilation step, and it works also without "qsub".
 
Do you think that it failed because a few options are misunderstanding by the system ? Or a wrong use of the batch options is done ?
 
Regards,
 
Erwa
Yvan Fournier

Re: Code_saturne v2.1.1 on a PBS Cluster

Post by Yvan Fournier »

Hello,

Normally, Code_Saturne 2.1 and above determines its case directory based on the directory from which it is launched.

When running under a batch system, it is started from a spool directory, so you need to add:

cd $PBS_O_WORKDIR

to switch to the directory from which it is submitted.

This is the current behavior when you configure the code to use PBS and buidl a new case.

When run without qsub, this becomes cd, as the PBS_0_WORKDIR environment variable does not exist, so things do not work when run interactively.

A solution to work both ways would be:

if test -n "$PBS_O_WORKDIR"; then cd $PBS_O_WORKDIR; fi

Best regards,

  Yvan
Post Reply