Skip to content

Instantly share code, notes, and snippets.

@alchem0x2A
Created September 23, 2019 13:40
Show Gist options
  • Save alchem0x2A/aeb214dd15e7e388e18c6b740d7156d6 to your computer and use it in GitHub Desktop.
Save alchem0x2A/aeb214dd15e7e388e18c6b740d7156d6 to your computer and use it in GitHub Desktop.
Installation of python API for LSF system

Install python API for IBM LSF batch system

The short introduction describes how to install the python API for the IBM LSF batch system (like Euler cluster of ETH Zürich).

Find the system-wide LSF configure files

The python API relies on the system environment that is defined inside the file profile.lsf. On Euler cluster it is at: $LSF_ENVDIR/profile.lsf

Load the environmental variables by

# You may need to change the location dependent on the system
source $LSF_ENVDIR/profile.lsf

Install the python API

Prerequisites: python and swig should be loaded:

# Need to load this line if you don't have the newer modules
module load new
module load python/X.Y.Z swig

Installation of the python API is recommended at the user-level, or inside a virtualenv. In both cases, clone the git repo by:

git clone https://github.com/IBMSpectrumComputing/lsf-python-api.git
cd lsf-python-api
# Don't skip the following line
python setup build
python -m pip install --user .

To test if the installation is correct, run any script inside the lsf-python-api/examples and see if you can read the cluster information.

Working with virtualenv

Most likely you wish to have a user-wide API installation, and use it inside every virtualenv created. Simply allow the virtualenv to use “system-site-pacakges” when you install it.

python -m venv --system-site-packages /path/to/venv

Note: this should be done at the time the virtualenv is initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment