Selector-mpi (flory)
This page is specific to the Flory cluster
The script selector-mpi, located in the /home/bgo/shared/bin directory, makes it easy to setup the environment for supported Message Passing Interface (MPI) implementations and packages.
Usage
A typical command line would look like this:
source /home/bgo/shared/bin/selector-mpi --quiet -f -i gnu-openmpi lammps/20161117 qe/5.0.2Below is a table of all options available from the command line. The long form options are preceded with --, and short form a single -. For options with both a long and short form, either one may be used on the command line.
Command Line Options
| Long form1 | Short form2 | Option type | Required? | Description |
|---|---|---|---|---|
implementation |
i |
string | No | Set MPI implementation |
o |
No | Shortcut for -i gnu-openmpi
| ||
show |
s |
No | Shows available MPI implementations or package versions for implementation. To see package versions, -i or -o must specified first, otherwise MPI implementations will be shown.
| |
fullclean |
f |
No | Full (almost) clean of path. Cleans out extraneous path entries that the typical user does not need (e.g., sbin directories). | |
clean |
c |
No | Cleans all paths by removing entries that this script adds. NOTE: If this is specified, the script will clean the path and ignore all other options, except for verbose and quiet. | |
verbose |
v |
No | Be verbose | |
quiet |
q |
No | Be quiet. | |
help |
h |
No | Show the help text. |
A list of packages and their versions to use can be added to the end of the command line, the default version will be used for any unspecified package. In the example above, lammps/20161117 and qe/5.0.2 package/versions are selected. See examples below for details.
Examples
Show Available MPI Implementations
To get a list of available MPI implementations:
user $source /home/bgo/shared/bin/selector-mpi -sgnu-openmpi: GNU compiler and OpenMPI icc-openmpi: Intel compiler and OpenMPI (Not currently available)
Show Available Package Versions
To get a list of packages and their versions available for the gnu-openmpi MPI implementation:
user $source /home/bgo/shared/bin/selector-mpi -i gnu-openmpi -sImplementation: gnu-openmpi lammps: lammps/20140201 * lammps/20161117 qe: * qe/5.0.2 qe/5.3.0 qe/5.3.0-environ-0.2 qe/6.0 *: Default version.
Use Default Package Version
To use the default version of all packages available for the gnu-openmpi MPI implementation:
user $source /home/bgo/shared/bin/selector-mpi -i gnu-openmpiImplementation: gnu-openmpi Package: lammps/default (20161117) Package: qe/default (5.0.2)
Use Specific Package Versions
To use LAMMPS version 20161117, Quantum ESPRESSO version 5.0.2, and the default version for all other available packages for the gnu-openmpi MPI implementation:
user $source /home/bgo/shared/bin/selector-mpi -i gnu-openmpi lammps/20161117 qe/5.0.2Implementation: gnu-openmpi Package: lammps/20161117 Package: qe/5.0.2
See Details
To see in more detail what selector-mpi is doing, the verbose flag can be added to the command line. The previous command, with the verbose flag, gives:
user $source /home/bgo/shared/bin/selector-mpi --verbose -i gnu-openmpi lammps/20161117 qe/5.0.2Implementation: gnu-openmpi
Cleaning paths.
Removing previous implementation paths.
Updated PATH
Updated MANPATH
Updated LD_LIBRARY_PATH
Updating environmental variables for base implementation.
Adding to PATH: /home/bgo/shared/bin
Updating environmental variables for gnu-openmpi implementation.
Adding to PATH: /home/bgo/shared/gnu-openmpi/bin
Adding to LD_LIBRARY_PATH: /home/bgo/shared/gnu-openmpi/lib
Adding to LD_LIBRARY_PATH: /home/bgo/shared/gnu-openmpi/usr/lib
Adding to MANPATH: /home/bgo/shared/gnu-openmpi/share/man
Package: lammps/default (20161117)
Adding to PATH: /home/bgo/shared/gnu-openmpi/versioned/lammps/default/bin
Package: qe/default (5.0.2)
Adding to PATH: /home/bgo/shared/gnu-openmpi/versioned/qe/default/binAutomatically Select Packages on Login
To automatically select Open MPI compiled with the GNU compiler and the default version of all packages for every login, add the following line to the bottom of the $HOME/.bashrc file:
source /home/bgo/shared/bin/selector-mpi -i gnu-openmpi -f -qSee Make Changes Persistent and Global on the Initial Setup page for details.
It is recommended to put a line similar to this into all queue submission scripts to be sure which MPI implementation and package version is used.
Cleaning PATH
The PATH environmental variable, which defines a list of directories that is searched when looking for an executable program, can sometimes become cluttered. The --clean (or -c) command line option to selector-mpi is used to help clean up the path. For example, when the current path is:
user $echo $PATH/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pssc/bin:/opt/openmpi/bin:/opt/torque/bin:/opt/torque/sbin:/opt/mpich2/bin
Running selector-mpi with the --clean and --quiet command line options gives a PATH of:
user $source /home/bgo/shared/bin/selector-mpi --clean --quietuser $echo $PATH/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pssc/bin:/opt/torque/bin:/opt/torque/sbin:
where /opt/openmpi/bin and /opt/mpich2/bin have been removed from PATH. Adding the -f command line option gives:
user $source /home/bgo/shared/bin/selector-mpi --clean -f --quietuser $echo $PATH/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/bin:/bin:/usr/bin:/opt/torque/bin
where /usr/local/sbin, /usr/sbin, /sbin, and /opt/pssc/bin have been removed.
Advanced
The user can specify additional paths to be cleaned by defining an environmental variable called SELECTOR_USER_TO_CLEAR_PATH. For example, to have the /usr/lib64/qt-3.3/bin and /usr/NX/bin paths removed from PATH which is currently
user $echo $PATH/usr/lib64/qt-3.3/bin:/usr/NX/bin:/usr/local/bin:/bin:/usr/bin:/opt/torque/bin
run the following commands:
user $export SELECTOR_USER_TO_CLEAR_PATH=/usr/lib64/qt-3.3/bin:/usr/NX/binuser $source /home/bgo/shared/bin/selector-mpi --clean -f --quietuser $echo $PATH/usr/local/bin:/bin:/usr/bin:/opt/torque/bin
NOTE: Care must be taken when setting the SELECTOR_USER_TO_CLEAR_PATH environmental variable because it is used to match the prefix of each path in PATH. For example, with SELECTOR_USER_TO_CLEAR_PATH=/usr/local, any path beginning with /usr/local will be removed from PATH, like /usr/local/bin and /usr/local/lib64.