Difference between revisions of "Cantera/Batch"

From ScientificComputing
Jump to: navigation, search
(Created page with "As an example for using Cantera, we are creating an object that represents a phase of matter and print out its properties. For this, we are using the Python interface of Cante...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
As an example for using Cantera, we are creating an object that represents a phase of matter and print out its properties. For this, we are using the Python interface of Cantera and run the script <tt>test.py</tt>.
+
You can submit a Cantera Python script (test.py) in batch mode with the following command:
  
  [leonhard@euler02 ~]$ '''cat test.py'''
+
  bsub [LSF options] "python test.py"
#!/usr/bin/env python
 
 
import cantera as ct
 
 
gas1 = ct.Solution('gri30.xml')
 
gas1()
 
[leonhard@euler02 ~]$ '''module load legacy gcc/4.8.2 open_mpi/1.6.5 python/2.7.6 boost/1.55.0 matlab/8.2 cantera/2.1.2'''
 
Autoloading openblas/0.2.13_seq
 
[leonhard@euler02 ~]$ '''bsub -n 1 -W 0:10 -R "rusage[mem=100]" "python test.py"'''
 
Generic job.
 
Job <35413388> is submitted to queue <normal.4h>.
 
[leonhard@euler02 ~]$ '''bjobs'''
 
JOBID      USER    STAT  QUEUE      FROM_HOST  EXEC_HOST  JOB_NAME  SUBMIT_TIME
 
35413388  sfux    PEND  normal.4h  euler02                *n test.py Jan 10 14:16
 
[leonhard@euler02 ~]$ '''bjobs'''
 
JOBID      USER    STAT  QUEUE      FROM_HOST  EXEC_HOST  JOB_NAME  SUBMIT_TIME
 
35413388  sfux    RUN  normal.4h  euler02    e1348      *n test.py Jan 10 14:16
 
[leonhard@euler02 ~]$ '''bjobs'''
 
No unfinished job found
 
[leonhard@euler02 ~]$ '''grep -A 14 gri30 lsf.o35413388'''
 
  gri30:
 
 
 
        temperature            300  K
 
          pressure          101325  Pa
 
            density      0.0818891  kg/m^3
 
  mean mol. weight        2.01588  amu
 
 
 
                          1 kg            1 kmol
 
                        -----------      ------------
 
          enthalpy        26470.1        5.336e+04    J
 
    internal energy    -1.21087e+06      -2.441e+06    J
 
            entropy        64913.9        1.309e+05    J/K
 
    Gibbs function    -1.94477e+07        -3.92e+07    J
 
  heat capacity c_p        14311.8        2.885e+04    J/K
 
  heat capacity c_v        10187.3        2.054e+04    J/K
 
  
The resource usage summary of the job can be found in the LSF log file.
+
Here you need to replace ''[LSF options]'' with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of <tt>bsub</tt>  on the wiki page about the [[Using_the_batch_system|batch system]].

Latest revision as of 13:23, 10 January 2017

You can submit a Cantera Python script (test.py) in batch mode with the following command:

bsub [LSF options] "python test.py"

Here you need to replace [LSF options] with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of bsub on the wiki page about the batch system.