sw-python Description

Python is a clear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java. For more information see the Python Home Page



An older OS provided version of python is available by default when you login on each system. However, if you wish to use a more recent python version, then you need to load a python module:
  module avail python
  module load python

Basic Example

numpy-example.py Execute a simple numpy python script on Rhea's login nodes:
rhea-login2g 114> module swap PE-intel PE-gnu
rhea-login2g 115> module load python/3.4.3 python_numpy
rhea-login2g 116> python numpy-example.py
[[ 0.52745845 -1.35692769]] * [[ 0.32870392 -0.71769511]] = [[ 0.17337766  0.97386037]]

Cray Compute Node Example

hello-mpi.py python-tst.pbs Run hello-mpi.py on 2 cores (1 core on 2 nodes):
titan-ext7 233> qsub python-tst.pbs

titan-ext7 234> cat python-tst.pbs.o2886563
Rank 1 of 2
Rank 0 of 2 

Rhea Compute Node Example

Similar to the Cray example the following example will run hello-mpi.py on 4 cores (4 cores, 1 core per socket, 2 nodes):
rhea-login2g 69> qsub -I -lnodes=2 -Aabc123 -lwalltime=01:00:00
qsub: waiting for job 117261.rhea-mgmt2g.ccs.ornl.gov to start
qsub: job 117261.rhea-mgmt2g.ccs.ornl.gov ready

rhea19 10> source $MODULESHOME/init/csh
rhea19 11> module load python python_mpi4py

rhea19 12> cd $MEMBERWORK/abc123

rhea19 13> mpirun -np 4 --map-by ppr:1:socket ./hello-mpi.py
Rank 0 of 4
Rank 1 of 4
Rank 3 of 4
Rank 2 of 4

rhea19 14>

The example allocates compute nodes through an interactive batch job, but could easily be executed through a batch script following the Cray example above.


  • python@2.7.12%gcc@4.8.5
  • python@2.7.12%gcc@4.8.5
  • python@3.5.2%gcc@4.8.5


  • python@2.7.12%gcc@5.3.0
  • python@3.5.1%gcc@5.3.0
  • python@2.7.12%gcc@5.3.0
  • python@3.5.1%gcc@5.3.0


  • python@2.7.12%gcc@4.4.7
  • python@2.7.12%gcc@5.3.0
  • python@2.7.12%gcc@4.4.7
  • python@2.7.12%gcc@5.3.0


  • python@2.7.12%gcc@5.3.0
  • python@2.7.12%gcc@5.3.0