The CSF2 has been replaced by the CSF3 - please use that system! This documentation may be out of date. Please read the CSF3 documentation instead. To display this old CSF2 page click here. |
PyGMO
Overview
PyGMO is a scientific library for massively parallel optimization. It is built around the idea of providing a unified interface to optimization algorithms and to optimization problems and to make their deployment in massively parallel environments easy.
Version 2.6 is installed on the CSF. This can use Anaconda Python v5.1.0 (python 3.6.4) or v4.2.0 (python 3.5.2).
Restrictions on use
There are no restrictions on accessing PyGMO on the CSF. The source is released under the GNU GPL v3 license.
Set up procedure
To access the software you must first load one of the following modulefile:
module load apps/gcc/python-packages/anaconda3-5.1.0/pygmo/2.6 module load apps/gcc/python-packages/anaconda3-4.2.0/pygmo/2.6
The modulefile will automatically load the required version of Anaconda modulefile for you.
Running the application
Please do not run PyGMO on the login node. Jobs should be submitted to the compute nodes via batch.
Ensure that your python script reads the number of cores your job has reserved in the batch system by getting the $NSLOTS
environment variable. You should then pass this value to the PyGMO python functions to ensure your code only uses that number of cores. For example:
import pygmo as pg import os # Get number of cores reserved by the batch system (NSLOTS is automatically set, or use 1 if not) NUMCORES=int(os.getenv("NSLOTS",1)) print("Using", NUMCORES, "core(s)" ) # Use NUMCORES in your python code as required...
Serial batch job submission
Make sure you have the modulefile loaded then create a batch submission script, for example:
#!/bin/bash #$ -S /bin/bash #$ -cwd # Job will run from the current directory #$ -V # Job will inherit current environment settings python myscript.py
Submit the jobscript using:
qsub scriptname
where scriptname is the name of your jobscript.
Parallel batch job submission
Make sure you have the modulefile loaded then create a batch submission script, for example:
#!/bin/bash #$ -S /bin/bash #$ -cwd # Job will run from the current directory #$ -V # Job will inherit current environment settings #$ -pe smp.pe 8 # Number of cores to use (2-24) # You must ensure your python script reads the $NSLOTS environment variable # to obtain the correct number of cores to use. Please read the PyGMO docs # to determine how to pass this number to PyGMO. python myscript.py
Submit the jobscript using:
qsub scriptname
where scriptname is the name of your jobscript.
Further info
- PyGMO python docs
- PyGMO python tutorials
- PyGMO website
Updates
None.