Biowulf High Performance Computing at the NIH
Python on Biowulf

There are three distinct ways to run python code or applications on biowulf:

  1. Using the system python 2.7 which is located in /usr/bin/python. This is the python installed with the operating system and contains few packages. Most users will want to use one of the general purpose python modules.
  2. Using one of the general purpose python modules (see the table below for which modules are available and what packages are installed. The large number of packages available in these environments are updated regularly. These modules are convenient and are most useful for development or when the exact version of installed packages is not important. Note that there is also a link from /usr/local/bin/python to the general purpose python 2.7 environment and from /usr/local/bin/python3 to a python 3 environment
  3. Using a private installation of miniconda. Users who need stable, reproducible environments are encouraged to install miniconda in their data directory and create their own private environments. This is less convenient than the general use environments but allows users to quickly install packages themselves, create invariant environmets for stability, and install packages that may not be suited for inclusion in the general purpose environments.

Support for Python 2.7 will officially end January 1, 2020 though one more release is planned for mid April 2020. See PEP-373

Therefore, on April 15, 2020 Python 3 will become the default Python module on biowulf. The python/2.7 module will continue to be available after this date but not as the default. Please update your code and workflows.

Changelog

June 2018: Cluster update from RHEL6 to RHEL7

Coincident with the update of the Biowulf operating system there were several major changes to the python setup:

July 2019: Installation of python/3.7

Installation of python/3.7

Common pitfalls

This is a list of common pitfalls for python users on the cluster. Some of these are discussed in other sections of this documentation in more detail.

Some commonly use command line tools are also included in the python environments
Some of the python packages in our environments depend on commonly used command line tools. Since our environments are created with conda, this means conda insists on installing these tools along with the python package. A common example is samtools/bcftools. This means loading a python module after loading a samtools module will result in samtools from the python environment appearing first in your PATH.
Implicit multithreading while using multiprocessing
Certain python libraries can use implicit multithreading to speed up some numerical algorithms. The number of threads used for this is determined by the environment variable OMP_NUM_THREADS. If this is done while also using multiprocessing batch jobs can be overloaded. For example, if creating a multiprocessing jobs with 10 worker processes and setting OMP_NUM_THREADS also to 10, a total of 10 * 10 = 100 threads is created. To avoid this happening accidentally the python modules set OMP_NUM_THREADS to 1. It needs to be set to more than one explicitly to take advantage of parallelized math libraries.
Implicit multithreading without setting OMP_NUM_THREADS
If OMP_NUM_THREADS is not set, the numerical libraries will attempt use all CPUs on a compute node. Unless all CPUs have been allocated this will result in overloading the job. The general use python modules set OMP_NUM_THREADS to 1 requiring users to explicitly set the variable higher to take advantage of implicit multithreading. If you are using your own python environments, please be sure to set OMP_NUM_THREADS explicitly for all code that can potentially multithread.
multiprocessing.cpu_count()
The cpu_count() function of the multiprocessing package always reports the total CPU count for a node. This is often the cause for overloaded python batch jobs. Instead query the environment for SLURM_CPUS_PER_TASK and default to 2, the minimum allocation.
[user@biowulf ~]$ sinteractive --cpus-per-task=2
...
[user@cn3444 ~]$ module load python/2.7
[user@cn3444 ~]$ python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Mar 27 2018, 17:29:31)
>>> import multiprocessing
>>> multiprocessing.cpu_count()
56  # <-- wrong
>>> import os
>>> int(os.environ.get('SLURM_CPUS_PER_TASK', '2'))
2   # <-- right
Hung multiprocessing pools
If a worker in a multiprocessing pool gets killed as can happen if a job exceeds allocated memory, the whole pool will wait indefinately (i.e. until the job times out) for the killed worker to return results. Make sure to allocate sufficient memory and test code.
Python startup problem
Python looks through a lot of paths for certain files during startup. Therefore, starting up many concurrent python processes can strain the shared file system. This is especially true if running large swarms where each subjob runs multiple short python proceses. If you have very short running python processes, please modify the code such that each script does more work.
Packages installed in the home directory
Python includes ~/.local/lib/pythonX.X/site-packages in the package search path. If you have packages installed there they can override the centrally installed packages. This can lead to hard to diagnose problems. If you have problems that are resolved by adding the -s option a broken package installed in your home directory may be the cause.
Swarm and Python environments
If activating one of your own environment within a swarm some versions of conda may encounter a race condition that will lead to some swarm subjobs failing to activate the environment correctly. This can be avoided by either activating the conda environment before submitting the swarm (the environment gets exported to the job) or by calling python with the full path to your environment without activating the environment.
matplotlib in non-interactive environments
By default matplotlib uses an interactive backend. This works if the backend can connect to a graphical user interface (e.g. if using X11 forwarding through an ssh tunnel or NX). However, if there is no GUI to connect to, this will fail with an error message that includes.
Could not connect to any X display

This can be solved by using a non-interactive backend for plotting. Which backend matplotlib uses can be changed in a couple of different ways:

matplotlib settings can be modified using a matplotlibrc file. This file can be placed either in the current working directory or in ~/.config/matplotlib. If placed in the former it will only affect jobs run from this directory. If placed in the latter, it will affect all your calls to matplotlib. For example, if you'd like to change the default backend, create the file ~/.config/matplotlib/matplotlibrc with the following content:

backend: agg

Alternatively, you can set the MPLBACKEND environment variable either ad hoc or in your .bashrc:

export MPLBACKEND=agg

And finally, it can also be set programatically:

>>> import matplotlib
>>> matplotlib.use("agg")

Available backends and the currently active backends can be queried interactively in python:

>>> import matplotlib
>>> matplotlib.rcsetup.interactive_bk
['GTK', 'GTKAgg', 'GTKCairo', 'GTK3Agg', 'GTK3Cairo', 'nbAgg', 'Qt4Agg', 'Qt4Cairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo']
>>> matplotlib.rcsetup.non_interactive_bk
['agg', 'cairo', 'gdk', 'pdf', 'pgf', 'ps', 'svg', 'template']
>>> import matplotlib.pyplot as plt
>>> plt.get_backend()
'agg'
python environments and NoMachine problems
If you add the executables of the conda dbus package to your PATH in one of your startup files (e.g. ~/.bashrc), NoMachine may fail with a black screen. This can happen when you load a python module or activate your own conda installation. The solution is to remove any unnecessary initialization from your .bashrc or, if this is an environment under your control, remove the dbus package from the environment.
General purpose Python environments

The general purpose Python environments are made available through the module system:

[user@cn3444 ~]$ module avail python
--------------- /usr/local/lmod/modulefiles ---------------
   python/2.7 (D)    python/3.5    python/3.6    python/3.7 

  Where:
   D:  Default Module

[user@cn3444 ~]$ module load python/3.7
[+] Loading python 3.7  ...

[user@cn3444 ~]$ python
Python 3.7.5 (default, Oct 25 2019, 15:51:11)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> 

These are fully featured environments with many installed packages including the usual modules that make up the scientific Python stack (see below). These environments best suited for development and for running code that is not dependent on specific versions of the installed packages. Packages in these environments are updated regularly. If you need more stability to ensure reproducibility or because your code depends on the presence of certain fixed versions of packages you can also build your own environments.

Python scientific stack

The usual scientific python stack (numpy, scipy, scikit-learn, numba, pandas, ...) is included in all the general purpose environments. Numpy and scipy are compiled against the accelerated Intel MKL library.

[user@cn3444 ~]$ python
Python 3.7.5 (default, Oct 25 2019, 15:51:11)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__config__.show()
blas_mkl_info:
    libraries = ['blas', 'cblas', 'lapack', 'pthread', 'blas', 'cblas', 'lapack']
    library_dirs = ['/usr/local/Anaconda/envs/py3.7/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/usr/local/Anaconda/envs/py3.7/include']
[...snip...]

Because they are compiled against MKL, some mathematical operations (e.g. SVD) can make use of multithreading to accelerate computation. The number of threads such operations will create is determined by the environment variable OMP_NUM_THREADS. To avoid accidentally overloading jobs, especially when also doing multiprocessing, this variable is set to 1 by the python modules. If your code can take advantage of implicit parallelism you can set this variable to match the number of allocated CPUs for cluster jobs or adjust it such that the product of OMP_NUM_THREADS * number of processes equals the number of allocated CPUS. For example, if allocating 16 CPUs and planning on using multiprocessing with 4 workers, OMP_NUM_THREADS can be set as high as 4 without overloading the allocation.

Installed packages

The following packages are available in the general purpose python environments

Packagepython/2.7python/3.5python/3.6python/3.7
absl-py0.7.10.2.10.7.10.7.1
acora2.12.12.1n/a
aioeasywebdavn/a2.2.02.2.02.4.0
aiohttpn/a3.2.13.2.13.5.4
alabaster0.7.100.7.100.7.100.7.12
altgraph0.16.1n/an/an/a
anaconda-client1.6.141.6.141.6.141.7.2
anaconda-navigator1.8.51.8.51.8.51.9.7
anaconda-project0.8.20.8.20.8.20.8.3
anndatan/an/a0.6.22.post1n/a
appdirs1.4.31.4.31.4.31.4.3
apptoolsn/an/a4.4.04.4.0
argcomplete1.9.41.9.41.9.41.9.4
argh0.26.10.26.1n/a0.26.2
arrow-cppn/a0.9.00.9.00.11.1
arvizn/an/a0.7.00.7.0
asn1crypto0.24.00.24.00.24.00.24.0
astor0.6.20.6.20.6.20.7.1
astroid1.6.31.6.31.6.32.2.5
astropy2.0.63.0.23.0.23.2.1
async-timeoutn/a3.0.03.0.03.0.1
atomicwrites1.2.11.2.11.2.11.3.0
attrs18.1.018.1.018.1.019.1.0
automat0.6.00.6.00.6.00.7.0
babel2.5.32.5.32.5.32.7.0
backcalln/a0.1.00.1.00.1.0
backports1.01.01.01.0
backports_abc0.5n/an/an/a
backports.functools_lru_cache1.5n/an/an/a
backports.osn/an/an/a0.1.1
backports.shutil_get_terminal_size1.0.01.0.01.0.01.0.0
backports.weakref1.0.post1n/an/an/a
basemap1.1.01.1.01.1.01.2.0
bcftools1.91.91.91.10.2
bcolz1.2.11.2.11.2.11.2.1
bcrypt3.1.43.1.43.1.43.1.6
beautiful-soup4.3.2n/an/an/a
beautifulsoup44.6.04.6.04.6.04.7.1
bedtools2.27.12.27.12.27.12.29.2
bidict0.17.20.17.20.17.20.18.0
binutils_impl_linux-642.342.28.12.31.12.33.1
binutils_linux-642.347.2.02.31.12.33.1
biom-format2.1.6n/an/a2.1.7
biopython1.681.681.721.73
bioreadn/a1.0.41.0.41.0.4
bitarray0.8.10.8.10.8.10.9.3
bkcharts0.20.20.20.2
blas1.01.02.102.10
blaze0.11.30.11.30.11.30.11.3
blaze-core0.9.00.9.0n/an/a
bleach2.1.32.1.32.1.33.1.0
blinkern/an/a1.41.4
blosc1.17.11.14.31.14.31.16.3
blzremovedn/an/an/a
bokeh1.4.00.13.01.3.41.2.0
boost1.59.0n/an/an/a
boost-cppn/a1.66.01.66.01.68.0
boto2.48.02.48.02.48.02.49.0
boto31.7.241.7.241.7.241.9.188
botocore1.10.241.10.241.10.241.12.188
bottleneck1.2.11.2.11.2.11.2.1
brotlin/an/an/a1.0.7
bsddb1.0n/an/an/a
bx-python0.8.10.8.10.8.1n/a
bz2file0.980.980.980.98
bzip21.0.61.0.61.0.81.0.8
ca-certificates2020.4.5.12019.9.112020.6.202020.6.20
cachetools2.0.12.0.12.0.12.1.0
cairo1.16.01.14.121.16.01.16.0
cairocffin/a0.7.21.1.0n/a
c-ares1.15.0n/a1.15.01.15.0
cdecimal2.3n/an/an/a
certifi2019.11.282018.8.242020.6.202020.6.20
cffi1.11.51.11.51.13.21.13.2
cftimen/an/a1.1.1.21.1.1.2
chardet3.0.43.0.43.0.43.0.4
cheetah2.4.4n/an/an/a
click7.07.07.07.0
cloudpickle0.5.30.5.30.5.31.2.1
clyent1.2.21.2.21.2.21.2.2
colorama0.3.90.3.90.3.90.4.1
colorcetn/an/a2.0.12.0.1
coloredlogs10.010.010.010.0
colormathn/a3.0.03.0.03.0.0
configargparsen/a0.13.00.13.00.13.0
configobj5.0.65.0.65.0.65.0.6
configparser3.5.0n/an/a3.7.3
constantly15.1.015.1.015.1.015.1.0
contextlib20.5.50.5.50.5.50.5.5
coverage4.5.1n/an/an/a
crc32cn/an/a2.02.0
crcmod1.7n/an/a1.7
cryptography2.52.2.22.52.7
cudatoolkit10.0.1309.210.1.24310.1.243
cudnn7.6.47.2.17.6.57.6.5
cupti10.0.1309.2.14810.1.16810.1.168
cupyn/an/a7.3.07.3.0
curl7.63.07.61.17.65.27.64.1
cvxopt1.2.4n/a1.2.31.2.3
cxxfiltn/an/an/a0.2.1
cycler0.10.00.10.00.10.00.10.0
cyrus-sasl2.1.26n/an/an/a
cython0.290.28.50.29.130.29.13
cytoolz0.9.0.10.9.0.10.9.0.10.10.0
cyvcf20.10.00.10.0n/a0.20.0
dask1.2.20.19.22.6.02.6.0
dask-core1.2.20.19.22.6.02.6.0
dask-jobqueue0.5.0n/a0.7.00.7.0
datashape0.5.40.5.40.5.40.5.4
datrien/a0.7.10.7.10.7.1
db5.3.28n/an/an/a
dbus1.13.61.13.21.13.21.13.2
decorator4.3.04.3.04.3.04.4.0
deepdiff3.3.0n/an/a4.0.6
defusedxmln/an/an/a0.5.0
dendropy4.2.0n/an/a4.4.0
deprecatedn/an/an/a1.2.5
dill0.2.7.10.2.7.10.2.7.10.3.0
dipyn/an/a0.16.01.0.0
dis30.1.2n/an/an/a
distribute0.6.45n/an/an/a
distributed1.28.11.23.22.6.02.6.0
dnspython1.15.0n/an/a1.15.0
docopt0.6.20.6.20.6.20.6.2
docrep0.2.7n/an/an/a
docutils0.140.140.140.14
dropboxn/a8.9.08.9.09.4.0
dsdp5.8n/a5.85.8
dynd-python0.7.20.7.2removedremoved
ecdsa0.130.130.130.13
entrypoints0.2.30.2.30.2.30.3
enum341.1.6n/an/an/a
envisagen/an/a4.7.24.7.2
ete22.3.10n/an/an/a
et_xmlfile1.0.11.0.11.0.11.0.1
expat2.2.62.2.52.2.62.2.5
fabric2.3.1n/a2.3.12.4.0
fastcache1.0.21.0.21.0.21.1.0
fastrlockn/an/a0.40.4
feather-formatn/a0.4.00.4.00.4.0
ffmpeg4.1.3n/a4.1.34.1.3
fftw3.3.83.3.83.3.83.3.8
fftw3f3.3.43.3.43.3.43.3.4
filechunkion/a1.61.61.8
filelock3.0.43.0.43.0.43.0.10
fisher0.1.4n/an/an/a
flask1.0.21.0.21.0.21.1.1
flask-cors3.0.43.0.43.0.43.0.8
fontconfig2.13.12.12.62.13.12.13.1
freeglut2.8.13.0.03.0.03.0.0
freetype2.9.12.8.12.9.12.10.0
fribidi1.0.2n/a1.0.51.0.5
fsspecn/an/a0.5.20.5.2
ftputiln/a3.23.23.4
funcsigs1.0.2n/an/an/a
functools323.2.3.2n/an/an/a
functools_lru_cache1.5n/an/an/a
future0.16.00.16.00.16.00.17.1
futures3.2.03.0.3n/an/a
gast0.2.20.2.00.2.20.2.2
gcc_impl_linux-647.3.07.2.07.3.07.3.0
gcc_linux-647.3.07.2.07.3.07.3.0
gdata2.0.18n/an/an/a
gdk-pixbufn/an/a2.36.122.36.12
geneimpacts0.3.4n/an/a0.3.7
gensim3.5.03.5.03.5.03.7.3
geos3.6.23.6.23.6.23.7.2
get_terminal_size1.0.01.0.01.0.01.0.0
gettext0.19.8.10.19.8.10.19.8.10.19.8.1
gevent1.3.01.3.01.3.01.4.0
gevent-websocket0.10.1n/an/an/a
gffutils0.90.9n/a0.9
gflags2.2.1n/a2.2.12.2.2
ghostscriptn/a9.189.189.18
giflib5.2.15.1.95.1.95.1.7
gitdb2n/a2.0.52.0.52.0.5
gitpythonn/a2.1.112.1.112.1.11
glib2.58.32.56.12.58.32.58.3
glob20.60.60.60.7
glog0.3.5n/a0.3.50.4.0
glpk4.65n/a4.654.65
gmp6.1.26.1.26.1.26.1.2
gmpy22.0.82.0.82.0.82.1.0b1
gnutls3.6.5n/a3.6.53.6.5
gobject-introspectionn/an/a1.58.21.58.2
google-api-core1.5.01.5.01.1.01.13.0
google-api-python-clientn/an/a1.6.71.9.1
googleapis-common-protos1.5.31.5.31.5.31.6.0
google-auth1.5.11.5.11.12.01.6.3
google-auth-httplib20.0.20.0.20.0.20.0.3
google-auth-oauthlibn/an/a0.4.10.4.1
google-cloud-core0.24.10.24.10.24.11.0.2
google-cloud-storage1.1.11.1.11.1.11.16.1
google-pasta0.1.7n/a0.1.70.1.7
google-resumable-media0.0.20.0.20.0.20.3.2
graphite21.3.111.3.111.3.111.3.13
graphvizn/a2.38.02.38.02.38.0
greenlet0.4.130.4.130.4.130.4.15
grin1.2.1n/an/an/a
grpcio1.16.01.12.01.27.21.27.2
gsl2.52.42.42.5
gst-plugins-base1.14.51.14.01.14.01.14.0
gstreamer1.14.51.14.01.14.01.14.0
gxx_impl_linux-647.3.07.2.07.3.07.3.0
gxx_linux-647.3.07.2.07.3.07.3.0
h5py2.10.02.7.12.8.02.9.0
harfbuzz2.4.01.7.62.4.02.4.0
hdf4n/an/a4.2.134.2.13
hdf51.10.51.10.11.10.41.10.4
hdf5storagen/a0.1.150.1.150.1.15
heapdict1.0.01.0.01.0.01.0.0
holoviewsn/an/a1.12.71.12.7
html5lib1.0.11.0.11.0.11.0.1
htseq0.9.1n/an/a0.11.2
htslib1.91.91.10.21.10.2
httplib20.11.30.11.30.11.30.13.0
humanfriendly4.12.14.12.14.12.14.18
hvplotn/an/a0.5.20.5.2
hyperlink18.0.018.0.018.0.017.3.1
hypothesis3.56.0n/an/an/a
icu64.258.258.258.2
idna2.62.62.62.8
idna_ssln/a1.0.11.0.11.1.0
igraphn/an/a0.7.1n/a
igv-reportsn/an/a0.9.80.9.8
imagecodecs-lite2019.12.3n/a2019.12.32019.12.3
imageio2.3.02.3.02.3.02.6.1
imagemagickn/a7.0.8_107.0.8_277.0.8_53
imagesize1.0.01.0.01.0.01.1.0
imgaug0.2.6n/a0.3.00.3.0
importlib_metadatan/an/an/a0.18
importlib-metadatan/an/a1.6.0n/a
incremental17.5.017.5.017.5.017.5.0
intel-openmp2018.0.02018.0.02018.0.02019.4
intervaltree2.1.02.1.02.1.03.0.2
invoke1.2.0n/a1.2.01.2.0
ipaddress1.0.22n/an/an/a
ipdb0.11n/an/an/a
ipydatawidgetsn/an/an/a4.0.1
ipykernel4.8.24.8.25.1.05.1.1
ipyparallel6.1.16.1.16.1.16.2.4
ipyscalesn/an/an/a0.3.0
ipython5.8.06.4.07.10.17.10.1
ipython_genutils0.2.00.2.00.2.00.2.0
ipython-notebook4.0.44.0.4n/an/a
ipyvolume0.4.50.4.50.4.5n/a
ipywebrtc0.3.00.3.00.3.0n/a
ipywidgets7.2.17.2.17.2.17.5.0
isort4.3.44.3.44.3.44.3.21
itsdangerous0.240.240.241.1.0
jasper1.900.1n/a1.900.11.900.1
jbig2.12.12.12.1
jdcal1.41.41.41.4.1
jedi0.12.00.12.00.12.00.14.1
jeepneyn/an/a0.4.10.4
jinja22.102.102.102.10.1
jmespath0.9.30.9.30.9.30.9.4
joblib0.110.110.110.13.2
jpeg9c9c9c9c
json5n/an/an/a0.8.5
jsoncppn/an/a1.8.41.8.4
jsonpickle0.9.6n/an/a1.2
jsonschema2.6.02.6.02.6.03.0.1
jupyter1.0.01.0.01.0.0n/a
jupyter_client5.2.35.2.35.2.35.3.1
jupyter_console5.2.05.2.06.0.0n/a
jupyter_core4.4.04.4.04.4.04.4.0
jupyterlab0.32.10.32.10.32.1n/a
jupyterlab_launcher0.10.50.10.50.10.5n/a
keras2.1.62.1.52.3.12.3.1
keras-applications1.0.8n/a1.0.81.0.8
keras-preprocessing1.0.9n/a1.1.01.1.0
keyringn/an/a19.2.019.0.2
kiwisolver1.0.11.0.11.0.11.1.0
krb51.16.21.16.11.16.11.16.3
lame3.100n/a3.1003.100
lazy-object-proxy1.3.11.3.11.3.11.4.1
lcms1.19n/an/an/a
ld_impl_linux-642.34n/a2.33.12.33.1
libblas3.8.0n/a3.8.03.8.0
libboostn/an/an/a1.67.0
libcblas3.8.0n/a3.8.03.8.0
libclang9.0.1n/an/an/a
libcrocon/an/a0.6.130.6.13
libcurl7.63.07.61.17.65.27.64.1
libdb6.1.26n/an/an/a
libdeflate1.01.01.31.3
libdynd0.7.20.7.20.7.20.7.2
libedit3.1.201812093.1.201703293.1.201812093.1.20181209
libeventn/an/an/a2.1.10
libffi3.2.13.2.13.2.13.2.1
libgcc7.2.07.2.07.2.07.2.0
libgcc-ng9.1.09.1.09.1.09.2.0
libgfortran3.0.03.0.03.0.03.0.0
libgfortran-ng7.2.07.2.07.2.07.3.0
libglu9.0.0n/an/a9.0.0
libgompn/an/an/a9.2.0
libgpuarray0.7.6n/a0.7.60.7.6
libiconv1.151.151.151.15
liblapack3.8.0n/a3.8.03.8.0
liblapacke3.8.0n/a3.8.03.8.0
libllvm8n/an/a8.0.18.0.1
libllvm99.0.1n/an/an/a
libnetcdfn/an/a4.6.24.6.2
libntlm1.4n/an/an/a
liboggn/an/a1.3.2n/a
libopenblasn/an/an/a0.3.6
libopencv4.1.2n/an/an/a
libopus1.2.1n/an/an/a
libpng1.6.371.6.341.6.351.6.37
libprotobuf3.6.13.6.03.9.13.11.4
librsvgn/an/a2.44.132.44.14
libsodium1.0.161.0.161.0.161.0.17
libssh21.8.01.8.01.8.21.8.2
libstdcxx-ng8.2.08.2.08.2.09.1.0
libtheoran/an/a1.1.1n/a
libtiff4.1.04.0.94.0.94.0.10
libtool2.4.62.4.62.4.62.4.6
libuuid2.32.12.32.12.32.12.32.1
libvorbisn/an/a1.3.5n/a
libvpx1.6.1n/an/an/a
libwebp1.0.20.5.21.0.21.0.2
libxcb1.131.131.131.13
libxgboostn/an/a0.820.82
libxkbcommon0.10.0n/an/an/a
libxml22.9.102.9.82.9.82.9.9
libxslt1.1.331.1.321.1.321.1.32
linecache21.0.0n/an/an/a
line_profiler2.1.22.1.22.1.22.1.2
llvm3.3n/an/an/a
llvmlite0.25.00.25.00.31.00.31.0
locket0.2.00.2.00.2.00.2.0
louvainn/an/a0.6.1n/a
lxml4.2.14.2.14.2.14.3.4
lz42.1.9n/an/an/a
lz4-c1.8.3n/a1.8.1.21.8.3
lzo2.102.102.102.10
macholib1.11n/an/an/a
mako1.0.71.0.71.0.71.0.10
markdown2.6.112.6.112.6.113.1.1
markupsafe1.01.01.01.1.1
matplotlib2.2.42.2.23.1.13.1.1
matplotlib-base2.2.4n/a3.1.13.1.1
matplotlib-venn0.11.50.11.50.11.50.11.5
mayavin/an/a4.6.24.6.2
mccabe0.6.10.6.10.6.10.6.1
mercurial4.5.3n/an/an/a
mesa10.5.4n/an/an/a
metaseq0.5.6n/an/an/a
metis5.1.0n/a5.1.05.1.0
mistune0.8.30.8.30.8.30.8.4
mkl2019.42018.0.32019.12019.4
mkl_fft1.0.151.0.91.0.1n/a
mkl_random1.1.01.0.11.0.1n/a
mkl-service2.3.01.1.2n/a2.1.0
mmtf-python1.0.21.0.2n/an/a
mnen/an/a0.18.20.19.0
mock2.0.02.0.02.0.03.0.5
more-itertools4.1.04.1.04.1.07.1.0
mpc1.0.31.0.31.0.31.1.0
mpfr3.1.53.1.53.1.54.0.2
mpi4py3.0.03.0.33.0.33.0.3
mpmath1.0.01.0.01.0.01.1.0
msgpack-python0.5.60.5.60.5.60.6.1
multidictn/a4.3.14.3.14.5.2
multipledispatch0.5.00.5.00.5.00.6.0
mysql5.7.20n/an/an/a
mysql-connector-python2.0.4n/an/an/a
mysql-python1.2.5n/an/an/a
natsortn/an/a6.0.0n/a
navigator-updater0.2.00.2.00.2.00.2.1
nb_anacondacloud1.4.01.4.01.4.0n/a
nb_conda2.2.12.2.12.2.12.2.1
nb_conda_kernels2.1.02.1.02.1.02.2.2
nbconvert5.3.15.3.15.3.15.5.0
nbformat4.4.04.4.04.4.04.4.0
nbpresent3.0.23.0.23.0.23.0.2
nccln/an/a2.6.4.12.6.4.1
ncurses6.16.16.16.1
netcdf4n/an/a1.5.1.21.5.1.2
nettle3.4.1n/a3.4.13.4.1
networkx2.12.12.12.3
nibabel2.3.02.3.02.4.02.4.1
nilearnn/an/a0.5.20.5.2
ninja1.8.21.8.21.8.21.9.0
nltk3.3.03.3.03.3.03.2.5
nose1.3.71.3.71.3.71.3.7
notebook5.5.05.5.05.5.05.7.8
nspr4.25n/an/an/a
nss3.47n/an/an/a
numba0.40.00.40.00.48.00.48.0
numexpr2.6.82.6.62.6.82.6.9
numpy1.16.51.15.21.18.11.18.4
numpy-base1.16.51.15.2n/an/a
numpydoc0.8.00.8.00.8.00.9.1
nvidia-apexn/an/an/a0.1
nvidia-apex-procn/an/an/a0.1
oauth2clientn/an/a1.5.24.1.3
oauthlibn/an/a3.0.13.0.1
ocl-icdn/a2.2.92.2.92.2.12
odo0.5.10.5.10.5.10.5.1
ofed-le-utils1.0.3n/an/an/a
olefile0.45.10.45.10.45.10.46
openblas0.2.14n/an/a0.3.6
opencv4.1.2n/a4.1.04.1.0
openh2641.8.0n/a1.8.01.8.0
openjpegn/a2.3.02.3.12.3.1
openmm7.1.17.3.07.3.0n/a
openpyxl2.5.32.5.32.5.32.6.2
openssl1.0.2p1.0.2t1.1.1g1.1.1g
opt_einsum2.3.2n/a3.1.03.1.0
ordered-setn/an/an/a3.1.1
packaging17.117.117.119.0
palettable3.1.13.1.13.1.13.2.0
pandas0.24.20.23.40.25.10.24.2
pandas-plink1.2.29n/a1.2.292.0.1
pandoc1.19.2.11.19.2.11.19.2.12.7.3
pandocfilters1.4.21.4.21.4.21.4.2
pango1.40.141.40.141.40.141.40.14
paramn/an/a1.9.31.9.3
paramiko2.4.12.4.12.4.12.6.0
pararead0.5.0n/an/an/a
parquet-cppn/a1.4.01.4.01.5.1
parso0.2.00.2.00.2.00.5.0
partd1.0.00.3.81.0.01.0.0
patchelf0.90.90.90.10
pathlib1.0.1n/an/an/a
pathlib22.3.22.3.22.3.22.3.4
path.py11.0.111.0.111.0.112.0.1
patsy0.5.00.5.00.5.10.5.1
pbr4.0.34.0.34.0.35.3.0
pcre8.428.428.428.43
peddy0.3.1n/an/an/a
pep81.7.11.7.11.7.11.7.1
perln/a5.26.25.26.25.26.2
pexpect4.5.04.5.04.5.04.7.0
pickleshare0.7.40.7.40.7.40.7.5
pillow5.3.05.1.05.3.06.0.0
pims0.3.30.3.3n/an/a
pip19.1.118.019.1.119.1.1
pixman0.38.00.34.00.34.00.38.0
pkg-confign/a0.29.20.29.20.29.2
pkginfo1.4.21.4.21.4.21.5.0.1
plotly4.5.1n/a4.5.14.5.1
pluggy0.8.00.8.00.8.00.12.0
plumbum1.6.61.6.61.6.61.6.7
ply3.113.113.113.11
pmw2.0.12.0.12.0.12.0.1
prettytablen/a0.7.20.7.20.7.2
proj4n/an/an/a5.2.0
prometheus_clientn/an/an/a0.7.1
prompt_toolkit1.0.151.0.152.0.102.0.9
protobuf3.6.13.6.03.9.13.11.4
psutil5.4.55.4.55.4.55.6.3
pthread-stubsn/an/an/a0.4
ptyprocess0.5.20.5.20.5.20.6.0
py1.5.31.5.31.5.31.8.0
py2bit0.3.0n/an/a0.3.0
pyarrown/a0.9.00.9.00.11.1
pyasn10.4.20.4.20.4.20.4.6
pyasn1-modules0.2.10.2.10.2.10.2.5
pybedtools0.7.100.7.100.7.100.8.0
pycairo1.15.4n/a1.19.01.18.2
pycodestyle2.4.02.4.02.4.02.5.0
pycosat0.6.30.6.30.6.30.6.3
pycparser2.182.182.182.19
pycrypto2.6.12.6.12.6.12.6.1
pycryptodomex3.6.13.6.13.6.13.8.1
pyctn/an/a0.4.60.4.6
pyct-coren/an/a0.4.60.4.6
pycurl7.43.0.27.43.0.17.43.0.37.43.0.2
pydensecrfn/a1.0rc3n/an/a
pydicom1.0.21.0.21.2.21.3.0
pydotn/a1.2.41.2.41.4.1
pyfacen/an/a6.1.16.1.1
pyfaidx0.5.30.5.30.5.30.5.5.2
pyfasta0.5.20.5.20.5.20.5.2
pyflakes1.6.01.6.01.6.02.1.1
pygments2.2.02.2.02.2.02.4.2
pygpu0.7.6n/a0.7.60.7.6
pygraphvizn/a1.3.11.51.5
pyhamcrest1.9.01.9.01.9.01.9.0
pyinstaller3.4n/an/an/a
pyjwtn/an/a1.7.11.7.1
pylint1.8.41.8.41.8.42.3.1
pymc2.3.7n/an/an/a
pymongo3.4.03.4.03.4.03.8.0
pympler0.5n/an/an/a
pymysql0.8.1n/an/an/a
pynacl1.2.11.2.11.2.11.3.0
pynvimn/an/a0.3.1n/a
pyodbc4.0.234.0.234.0.234.0.24
pyomo5.6.1n/an/an/a
pyomo.extras3.3n/an/an/a
pyopencln/a2018.1.12018.1.12019.1.2
py-opencv4.1.2n/an/an/a
pyopengl3.1.1a13.1.1a13.1.1a13.1.3b2
pyopenssl18.0.018.0.018.0.019.0.0
pyparsing2.2.02.2.02.2.02.4.0
pyproj1.9.5.11.9.5.11.9.5.11.9.6
pyqi0.3.2n/an/an/a
pyqt5.12.35.9.25.9.25.6.0
pyqt5-sip4.19.18n/an/an/a
pyqtgraph0.10.00.10.00.10.00.10.0
pyqtwebengine5.12.1n/an/an/a
pyro44.75n/an/an/a
pyrsistentn/an/an/a0.15.3
pysam0.15.10.15.10.15.30.15.3
pysftpn/a0.2.90.2.90.2.9
pyshp1.2.121.2.121.2.122.1.0
pysmi0.3.00.3.00.3.00.3.4
pysnmp4.4.44.4.44.4.44.4.9
pysocks1.6.81.6.81.6.81.7.0
pystache0.5.4n/an/an/a
pystan2.19.1.12.17.1.02.19.1.12.19.1.1
pysurfern/an/a0.9.00.9.0
pytabix0.0.20.0.20.0.20.0.2
pytables3.5.23.4.33.4.43.5.2
pytest3.9.23.8.13.9.25.4.1
pytest-arraydiffn/a0.20.20.3
pytest-astropyn/a0.3.00.3.00.5.0
pytest-doctestplusn/a0.1.30.1.30.3.0
pytest-openfilesn/a0.3.00.3.00.3.1
pytest-remotedatan/a0.2.10.2.10.3.1
pytest-runnern/an/an/a5.1
python2.7.153.5.63.6.103.7.5
python_abi2.7n/a3.63.7
python-crfsuiten/an/an/a0.9.6
python-dateutil2.7.32.7.32.7.32.8.0
python-docx0.8.10n/a0.8.100.8.10
python-hostlist1.18n/a1.181.18
python-igraphn/an/a0.7.1.post7n/a
python-irodsclientn/a0.7.00.7.00.7.0
python-levenshtein0.12.00.12.00.12.0n/a
python-lmdb0.920.920.920.94
python-lzo1.111.111.111.12
python-snappy0.5.2n/an/an/a
pythreejsn/an/an/a2.1.1
pytoolsn/a2018.42018.42020.1
pytorch1.3.11.1.01.4.01.4.0
pytz2018.42018.42018.42019.1
pyutilib5.6.5n/an/an/a
pyvcf0.6.80.6.80.6.80.6.8
pyviz_commsn/an/a0.7.30.7.3
pywavelets0.5.20.5.21.0.21.0.3
pywget3.23.2n/an/a
py-xgboostn/an/a0.820.82
pyyaml3.123.123.125.1.1
pyzmq17.1.217.1.217.1.218.0.2
qcli0.1.1n/an/an/a
qt5.12.55.9.55.9.75.6.3
qtawesome0.4.40.4.40.6.00.5.7
qtconsole4.3.14.3.14.3.14.5.1
qtpy1.5.21.5.21.9.01.8.0
ratelimitern/a1.2.01.2.01.2.0
re2n/an/an/a2019.07.01
readline7.07.07.07.0
redis4.0.94.0.94.0.95.0.3
redis-py2.10.62.10.63.3.113.3.11
regex2018.02.212018.02.212018.02.212019.06.08
reportlab3.4.03.4.03.4.03.5.23
requests2.18.42.18.42.23.02.22.0
requests-oauthlibn/an/a1.2.01.2.0
retrying1.3.3n/a1.3.31.3.3
rope0.10.70.10.70.10.70.14.0
rpy22.8.53.0.43.2.23.2.2
rsa3.1.43.1.43.1.43.4.2
ruamel_yaml0.15.350.15.350.15.350.15.71
ruffus2.72.72.72.8.1
runipy0.1.50.1.50.1.50.1.5
s3transfer0.1.130.1.130.1.130.2.1
samtools1.91.91.101.10
scandir1.7n/an/an/a
scanpyn/an/a1.4.4.post1n/a
scikit-image0.14.10.14.00.15.00.15.0
scikit-learn0.20.30.19.10.21.30.21.3
scikit-misc0.1.1n/a0.1.10.1.1
scipy1.2.11.1.01.4.11.4.1
scons3.0.1n/an/an/a
seaborn0.9.00.9.00.9.00.9.0
secretstoragen/an/a3.1.13.1.1
send2trash1.5.01.5.01.5.01.5.0
serpent1.27n/an/an/a
service_identity17.0.017.0.017.0.018.1.0
setuptools0.6c1140.4.341.0.141.0.1
sh1.12.141.12.141.12.141.12.14
shapelyn/an/a1.6.41.6.4
simplegeneric0.8.10.8.10.8.10.8.1
simpleitkn/a1.0.11.0.11.2.0rc2.dev1167+gd4cf2
simplejson3.15.03.15.03.15.03.16.0
singledispatch3.4.0.33.4.0.33.4.0.33.4.0.3
sip4.19.84.19.84.19.84.18.1
six1.13.01.11.01.13.01.12.0
slackern/an/a0.14.00.14.0
slicerator0.9.70.9.7n/an/a
smart_open1.8.01.8.01.8.01.8.4
smmap2n/a2.0.52.0.52.0.5
snakemaken/a5.6.05.19.35.19.3
snakemake-minimaln/a5.6.05.19.35.19.3
snakeviz1.0.01.0.01.0.02.0.0
snappy1.1.71.1.71.1.71.1.7
snowballstemmer1.2.11.2.11.2.11.9.0
sockjs-tornado1.0.31.0.31.0.31.0.6
sortedcollections1.0.11.0.11.0.11.1.2
sortedcontainers2.0.52.0.52.0.52.1.0
soupsieven/an/an/a1.9.2
sphinx1.8.11.8.11.8.12.1.2
sphinxcontrib1.01.01.01.0
sphinxcontrib-applehelpn/an/an/a1.0.1
sphinxcontrib-devhelpn/an/an/a1.0.1
sphinxcontrib-htmlhelpn/an/an/a1.0.2
sphinxcontrib-jsmathn/an/an/a1.0.1
sphinxcontrib-qthelpn/an/an/a1.0.2
sphinxcontrib-serializinghtmln/an/an/a1.1.1
sphinxcontrib-websupport1.0.11.0.11.0.11.1.2
sphinx_rtd_themen/a0.3.10.3.10.4.3
spyder3.2.83.2.83.3.63.3.6
spyder-kernelsn/an/a0.5.20.5.1
sqlalchemy1.2.121.2.121.2.121.3.5
sqlite3.31.13.28.03.31.13.30.1
ssl_match_hostname3.5.0.1n/an/an/a
statsmodels0.9.00.9.00.10.10.10.1
subprocess323.5.0n/an/an/a
suitesparse5.6.0n/a4.5.64.5.6
svgutils0.1.00.1.00.1.00.3.1
svgwrite1.1.6n/an/an/a
sympy1.31.31.31.4
system5.85.85.85.8
tabulate0.8.3n/an/an/a
tbb2019.92019.92019.72019.7
tbb4pyn/a2019.1n/an/a
tblib1.3.21.3.21.3.21.4.0
tensorboard2.0.01.10.02.1.02.1.0
tensorflow2.0.01.10.02.1.02.1.0
tensorflow-base2.0.01.10.02.1.02.1.0
tensorflow-estimator2.0.0n/a2.1.02.1.0
tensorflow-gpu2.0.01.10.02.1.02.1.0
termcolor1.1.01.1.01.1.01.1.0
terminado0.8.10.8.10.8.10.8.2
terminaltables3.1.03.1.03.1.03.1.0
testpath0.3.10.3.10.3.10.4.2
theano1.0.3n/a1.0.41.0.4
thrift-cppn/an/an/a0.11.0
tifffile2019.7.26.2n/a2020.2.162020.2.16
tk8.6.98.6.98.6.98.6.9
toolchain2.4.0n/a2.4.0n/a
toolchain_c_linux-642.4.0n/a2.4.0n/a
toolchain_cxx_linux-642.4.0n/a2.4.0n/a
toolshed0.4.6n/an/an/a
toolz0.9.00.9.00.9.00.10.0
toposortn/an/a1.51.5
torchvision0.2.10.2.10.2.10.5.0
tornado5.1.15.1.15.1.16.0.3
tqdm4.28.1n/a4.28.14.32.2
traceback21.4.0n/an/an/a
trackpy0.3.20.3.2n/an/a
traitlets4.3.24.3.24.3.24.3.2
traitsn/an/a5.1.25.1.2
traitsuin/an/a6.1.16.1.1
traittypes0.1.00.1.00.1.00.2.1
trollius2.22.22.2n/a
twisted18.9.018.7.018.9.019.2.1
twobitreadern/an/a3.1.63.1.7
twythonn/an/an/a3.7.0
typed-astn/an/an/a1.4.0
typing3.6.43.6.43.6.43.6.4
tzlocal1.5.11.5.11.5.11.5.1
ujson1.351.351.351.35
umap-learn0.3.60.3.20.3.60.3.9
unicodecsv0.14.10.14.10.14.10.14.1
unidecode1.0.221.0.221.0.221.1.1
unittest21.1.0n/an/an/a
unixodbc2.3.62.3.62.3.62.3.7
uritemplaten/an/a3.0.13.0.1
urllib31.221.221.221.25.3
util-linux2.212.212.212.21
virtualenv16.0.016.0.016.0.016.0.0
vtkn/an/a8.1.28.2.0
wcwidth0.1.70.1.70.1.70.1.7
webencodings0.5.10.5.10.5.10.5.1
werkzeug0.14.10.14.10.14.10.15.4
wheel0.33.40.32.00.33.40.33.4
widgetsnbextension3.2.13.2.13.2.13.5.0
wrapt1.11.21.10.111.11.21.11.2
wurlitzern/an/a1.0.31.0.3
wxpython4.0.1n/an/an/a
x2641!152.20180806n/a1!152.201808061!152.20180806
xarray0.11.3n/a0.14.10.14.1
xgboostn/an/a0.82n/a
xlrd1.1.01.1.01.1.01.2.0
xlsxwriter1.0.41.0.41.0.41.1.8
xlwt1.3.01.3.01.3.01.3.0
xmlrunnern/a1.7.71.7.71.7.7
xmltodictn/an/an/a0.12.0
xopen0.3.20.3.20.3.20.7.3
xorg-kbproto1.0.71.0.71.0.71.0.7
xorg-libice1.0.101.0.91.0.101.0.9
xorg-libsm1.2.31.2.21.2.31.2.3
xorg-libx111.6.91.6.61.6.81.6.7
xorg-libxaun/an/an/a1.0.9
xorg-libxdmcpn/an/an/a1.1.3
xorg-libxext1.3.41.3.31.3.41.3.4
xorg-libxpmn/a3.5.123.5.123.5.12
xorg-libxrender0.9.100.9.100.9.100.9.10
xorg-libxtn/a1.1.51.1.51.1.5
xorg-renderproto0.11.10.11.10.11.10.11.1
xorg-xextproto7.3.07.3.07.3.07.3.0
xorg-xproto7.0.317.0.317.0.317.0.31
xz5.2.45.2.45.2.45.2.4
yaml0.1.70.1.70.1.70.1.7
yarln/a1.2.41.2.41.3.0
zeromq4.2.54.2.54.2.54.3.2
zict0.1.30.1.30.1.31.0.0
zippn/an/a3.1.00.5.1
zlib1.2.111.2.111.2.111.2.11
zope1.01.01.01.0
zope.interface4.5.04.5.04.5.04.6.0
zstandardn/an/an/a0.11.1
zstd1.4.4n/an/a1.3.3
Multiprocessing

Some common issues with using multiprocessing on biowulf were already pointed out in the common pitfalls section. Beyond those multiprocessing can be made more robust by setting workers up to ignore the SIGINT signal so that a multiprocessing script can be terminated cleanly with scancel or Ctrl-C. The following script also makes sure to correctly detect the number of available CPUs in batch jobs:

#! /usr/bin/env python

from multiprocessing import Pool
import signal
import os

def init_worker():
    """
    This is necessary to be able to interrupt the
    script with CTRL-C (or scancel for that matter).
    It makes sure that the workers ignore SIGINT so
    that any SIGINT sent goes to the master process
    """
    signal.signal(signal.SIGINT, signal.SIG_IGN)

def worker(i):
    return i*i

if __name__ == '__main__':
    # the the number of allocated cpus (or 2 if not run as a slurm job)
    nproc = int(os.environ.get("SLURM_CPUS_PER_TASK", "2"))
    print("Running on %d CPUs" % nproc)
    # set up 50 tasks
    tasks = range(0, 100)
    p = Pool(nproc, init_worker)
    try:
        # run the processing pool
        results = p.map(worker, tasks)
    except (KeyboardInterrupt, SystemExit):
        p.terminate()
        p.join()
        sys.exit(1)
    else:
        p.close()
        p.join()
        # result summary
        print("\n".join("%d * %d = %d" % (a, a, b) for a, b in zip(tasks, results)))

It is also important to benchmark scaling of your code. Many algorithms won't scale well beyond a certain number of parallel multiprocessing workers which can lead to very inefficient resource usage (e.g. allocating 56 CPUs when parallel efficiency drops below 50% at 24 CPUs).

Using mpi4py

The python MPI library mpi4py is available in the python modules. In order to use this package it is necessary to load an additional module (mpi4py) to ensure that it can find the correct OpenMPI libraries. Here is an example for how to use this library:

The python MPI script:

#! /usr/bin/env python

from mpi4py import MPI

comm = MPI.COMM_WORLD

rank = comm.Get_rank()
size = comm.Get_size()
print("Hello! I'm rank {0} / {1} running in total...".format(rank, size))

comm.Barrier()

The batch script:

#!/bin/bash
#SBATCH --ntasks=8
#SBATCH --ntasks-per-core=1
#SBATCH --partition=multinode

module load mpi4py
module load python/3.7
#mpiexec  ./test.py
srun --mpi=pmix ./test.py

Submit with

[user@biowulf ~]$ sbatch test.sh
Using rpy2

In order to use the rpy2 package on biowulf it is necessary to load a separate rpy2 module which allows the package to find the correct R installation.

[user@cn3444 ~]$ module load python/3.7 rpy2
Python 3.7.5 (default, Oct 25 2019, 15:51:11)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpy2                                                       
>>> import rpy2.robjects as robjects                                  
>>> pi = robjects.r['pi']                                             
>>> pi[0]                                                             
3.141592653589793                                                     
Creating python environments

If you need common python packages at fixed versions or python packages that may not be suitable for installation in the general purpose python environments you can create your own environments using conda. This involves installing miniconda into your data directory (or a shared data directory for collaborations) and creating environments within that installation. This is a fairly quick and straight forward process. In the following example we will cover some basics of using conda to create private environments. Much more detailed documentation as available on the conda documentation pages.

Private python environments should be created in data directories, not the home directory since a conda installation can easily grow in space to exceed the home directory allocation.

[user@biowulf ~]$ cd /data/$USER

Download the miniconda installer and install to /data/$USER/conda. Don't install to your home directory since the quota there limits space.

[user@biowulf temp]$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
--2018-04-23 15:04:10--  https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving dtn04-e0... 10.1.200.240
Connecting to dtn04-e0|10.1.200.240|:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 58304693 (56M) [application/x-sh]
Saving to: “Miniconda3-latest-Linux-x86_64.sh”
2018-04-23 15:04:11 (118 MB/s) - “Miniconda3-latest-Linux-x86_64.sh” saved [58304693/58304693]

[user@biowulf temp]$ mkdir -p /scratch/$USER/temp
[user@biowulf temp]$ TMPDIR=/scratch/$USER/temp bash Miniconda3-latest-Linux-x86_64.sh -p /data/$USER/conda -b
PREFIX=/data/$USER/conda
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##
[...snip...]
installation finished.
[user@biowulf temp]$ rm Miniconda3-latest-Linux-x86_64.sh

To use the newly installed conda you will have to source an init file. Do this each time you are going to work with your environments. We then activate the base environment (previously called the root environment) and update the conda package manager wich itself is just a package:

[user@biowulf temp]$ source /data/$USER/conda/etc/profile.d/conda.sh
[user@biowulf temp]$ conda activate base
(base) [user@biowulf temp]$ which python
/data/$USER/conda/bin/python
(base) [user@biowulf temp]$ conda update conda
Solving environment: done

## Package Plan ##
[...snip...]

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) [user@biowulf temp]$ conda clean --all --yes
Cache location: /data/$USER/conda/pkgs
Will remove the following tarballs:

/data/$USER/conda/pkgs
------------------------
python-3.6.4-hc3d631a_1.tar.bz2             29.1 MB
[...snip...]
conda-4.5.1-py36_0.tar.bz2                   1.0 MB

---------------------------------------------------
Total:                                      59.4 MB

Removed python-3.6.4-hc3d631a_1.tar.bz2
[...snip...]

Now create a new environment called project1 with an older version of pysam from the bioconda channel and python 2.7:

(base) [user@biowulf temp]$ conda create -n project1 python=3.7 numpy scipy bioconda::pysam==0.15.3

Solving environment: done

## Package Plan ##
[...snip...]

Proceed ([y]/n)? y
[...snip...]
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate project1
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) [user@biowulf temp]$ conda activate project1
(project1) [user@biowulf temp]$ which python
/data/$USER/conda/envs/project1/bin/python
(project1) [user@biowulf temp]$ samtools --version
samtools 1.9
Using htslib 1.9
Copyright (C) 2018 Genome Research Ltd.
(project1) [user@biowulf temp]$ conda deactivate

Now an environment for a different project with current pysam plus some other tools. This time we add the bioconda channel to the channels for the environment so we don't have to use the bioconda:: prefix. A common pattern for environments used for bioinformatic software is to set up bioconda and conda-forge channels in the following order on a per-environment basis. This allows conda-forge packages to override packages from the defaults channel.

(base) [user@biowulf temp]$ conda create -n project2 python=3.6
[...snip...]
(base) [user@biowulf temp]$ conda activate project2
(project2) [user@biowulf temp]$ conda config --env --add channels defaults
(project2) [user@biowulf temp]$ conda config --env --add channels conda-forge
(project2) [user@biowulf temp]$ conda config --env --add channels bioconda
(project2) [user@biowulf temp]$ conda config --show-sources
==> /data/$USER/conda/envs/project2/.condarc <==
channels:
  - bioconda
  - conda-forge
  - defaults

(project2) [user@biowulf temp]$ conda install pysam bedtools hisat2
[...snip...]
(project2) [user@biowulf temp]$ which pip
/data/$USER/conda/envs/project2/bin/pip
(project2) [user@biowulf temp]$ pip install tensorflow-gpu
[...snip...]

Note that, as show above, pip can be used to install packages into conda environments as well.

List environments in the current conda install, then deactivate environments

(project2) [user@biowulf temp]$ conda info --env
# conda environments:
#
base                     /data/$USER/conda
project1                 /data/$USER/conda/envs/project1
project2              *  /data/$USER/conda/envs/project2
(project2) [user@biowulf temp]$ conda deactivate
(base) [user@biowulf temp]$ conda deactivate
[user@biowulf temp]$ 
Documentation