Turing : Python

Description

Python is an interpreted object-oriented programming language.

Versions installed on the front-end

Python 2.7.3 2.7.5
Available packages ipython-0.13.2
numpy-1.7.0
scipy-0.12.0
matplotlib-1.2.0
basemap-1.0.6
readline-6.2.4.1
ipython-0.13.2
numpy-1.7.0
scipy-0.12.0
matplotlib-1.2.0
basemap-1.0.6
readline-6.2.4.1

Versions installed on the compute nodes

Python 2.7.3
Available packages numpy-1.6.2
scipy-0.11.0
tables-3.0.0
mpi4py-1.3
h5py-2.3.1 compiled with hdf5-1.8.9
PyYAML-3.11

Characteristics

Compilation was carried out with the GNU compilers (gcc, g++ et gfortran)

Utilisation

Python is accessible by using the module command:

  module load python

or

   module load python/2.7.5

Comments

On the compute nodes, you should use Python-2.7.3 with the environment variables BG_PATH, BG_PYTHONHOME, BG_PYTHONPATH and BG_LD_LIBRARY_PATH.

module load python
export PYTHONPATH=$BG_PYTHONPATH
export PYTHONHOME=$BG_PYTHONHOME
export PATH=$BG_PATH
export LD_LIBRARY_PATH=$BG_LD_LIBRARY_PATH
runjob --ranks-per-node 4 --np 256 \
       --exp-env HOME PATH LD_LIBRARY_PATH PYTHONHOME PYTHONPATH PYTHON_EXEDIR : \
       $PYTHON_EXEDIR/python script.py

For the compute nodes, if you want to run a C code which calls Python, you must compile the C code in the following way:

   module load python
   mpixlc_r mon_code.c -I${BG_PYTHONPATH}/include/python2.7 -c
   mpixlc_r mon_code.o -o mon_exec -L${BG_PYTHONHOME}/lib64 -lpython2.7 -qnostaticlink

Documentation

Documentation is available on the official Python Web site: http://www.python.org.