Python/Example

From ScientificComputing
Jump to: navigation, search

As an example for running a Python script on the cluster, we use the built-in tests of the scientific Python packages numpy and scipy.

[leonhard@euler02 ~]$ module load python/3.3.3
Autoloading openblas/0.2.13_seq
[leonhard@euler02 ~]$ cat test_python.py 
import numpy
import scipy
numpy.test()
scipy.test()
[leonhard@euler02 ~]$ bsub -n 1 -W 4:00 -R "rusage[mem=1024]" python ./test_python.py
Generic job.
Job <25518323> is submitted to queue <normal.4h>.
[leonhard@euler02 ~]$ bjobs
JOBID      USER        STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
25518323   leonhard    PEND  normal.4h  euler02                 *python.py Aug 23 15:05
[leonhard@euler02 ~]$ bjobs
JOBID      USER        STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
25518323   leonhard    RUN   normal.4h  euler02     e1408       *python.py Aug 23 15:05
[leonhard@euler02 ~]$ bjobs
No unfinished job found
[leonhard@euler02 ~]$ grep Ran lsf.o25518323 
Ran 6139 tests in 114.985s
Ran 20195 tests in 366.931s