Software
Most software on the Hoffman2 Cluster is available via environmental modules. To list every application available via modules, enter at the terminal prompt:
$ module spider
To search for a particular application, and see which modules to load to use it:
$ module spider <app-name>
or:
$ modules_lookup -m <app-name>
or:
$ h2 modules <app-name>
Some modules are visible only after the module they depend on is loaded, so module avail may not list them: see How to find which applications are available via environmental modules.
Some applications are available as python or conda packages, which are not listed as modules.
Each application below says whether it is available on the Slurm (production) cluster, on the Grid Engine (legacy) cluster, or on both. Applications are still being installed on the Slurm cluster: if one you need is available only on the Grid Engine cluster, please request it by opening a ticket. To request or suggest software installation or updates, please submit via our helpdesk. Only software/applications that is required by multiple groups may be centrally installed or you and your group will receive given guidance on how to perform software installation in your $HOME or, if applicable, in your group project directory.
Available software on the Hoffman2 Cluster organized by category is discussed below, for faster navigation use the menu (which, depending on your device, might be located in the sidebar or accessible via the collapsed menu icon: ≡):
Productivity |
Development |
Discipline |
|---|---|---|
Hoffman2 Cluster tools
A collection of commands designed to show the status of specific user attributes on the cluster. The commands are designed to be issued from a terminal connected to the Hoffman2 Cluster.
The following tools work on the Grid Engine (legacy) cluster, hoffman2.idre.ucla.edu. Except for modules_lookup, myquota and shownews, which work on both clusters, they are not available on the Slurm cluster:
h2
h2 is a command line tool for the Slurm (production) cluster that answers common questions about your accounts, jobs, GPUs and software, and checks and submits job scripts. It is installed as /u/local/bin/h2 and is not available on the Grid Engine (legacy) cluster. Its output is formatted as Markdown, so it is readable in a terminal and can also be pasted into a ticket or an email.
To see all its commands, from a terminal connected to the Hoffman2 Cluster issue:
$ h2 --help
and, for the options of one command (e.g. recent):
$ h2 recent -h
Command |
What it does |
|---|---|
|
Your Slurm accounts, where the jobs of each account run, whether you can use |
|
Free and total GPUs by model and by node, with the |
|
The versions of an application installed as modules, and the modules to load first. See How to find which applications are available via environmental modules. |
|
Checks a job script against the cluster rules (e.g. a missing runtime, memory or account, a runtime over the limit, |
|
Runs |
|
Translates a Grid Engine ( |
|
Explains why a job is still pending: the reason, its place in the queue, and whether any node can run it. |
|
For a job that failed or behaved unexpectedly: the job’s details, the likely cause and how to fix it, and the end of its output. |
|
A job’s full accounting record: how it was submitted, its timing and its steps. |
|
Your recent jobs (by default, the last 3 days). Options include |
|
CPU and GPU hours used, by user, account and GPU model, with queue waits ( |
|
One compute node as Slurm sees it: its state, the CPUs, memory and GPUs in use, and its jobs. |
|
One PI group’s partition: its nodes, the jobs running on them (the group’s |
|
For AI coding assistants (Claude Code, Codex, OpenCode): links the Hoffman2 Cluster skill, which describes how to use the cluster, into the assistant’s skill directory. |
For example, to see which modules you need to load to use amber:
$ h2 modules amber
## Modules matching 'amber'
- amber/24_GPU: module load cuda/12.8; module load amber/24_GPU
and to check, and then submit, a job script:
$ h2 validate myjob.sh
$ h2 submit myjob.sh
h2 submit submits the job right away if h2 validate finds no errors, without asking. It clears the SLURM_* environment variables before calling sbatch, so a job submitted from inside an interactive session doesn’t inherit that session’s settings. From a login node, sbatch myjob.sh works as well.
Problems with these instructions? Please send comments here.
modules_lookup
modules_lookup finds every version of an application installed as an environmental module and prints the module load commands needed to use it, including any modules that must be loaded first. It works on both the Slurm (production) and the Grid Engine (legacy) clusters, and lists the modules of the cluster you run it on. On the Slurm cluster, h2 modules and job.q use it to look up modules.
To look up an application, from a terminal connected to the Hoffman2 Cluster issue modules_lookup -m followed by its name (not a name and version). For example, on the Slurm cluster:
$ modules_lookup -m amber
Looking for application = amber
amber/24_GPU via: module load cuda/12.8; module load amber/24_GPU
Run the commands after via: in the order shown: here module load cuda/12.8 first, because amber/24_GPU is visible only after cuda/12.8 is loaded (see How to find which applications are available via environmental modules). Application names are case sensitive (e.g. R, matlab). If the application isn’t installed as a module, modules_lookup says so; it may then be available as a Python or conda package, or as a container.
Its options are:
$ modules_lookup -m <name> # every version of <name>, and how to load it
$ modules_lookup -a # every module installed (slow; on the Slurm cluster, module spider is faster)
$ modules_lookup -h # help
Problems with these instructions? Please send comments here.
myjobs
myjobs (or myjob) displays your running and pending jobs, or those of another user given with -u. On the Slurm (production) cluster it runs squeue -u <username>; on the Grid Engine (legacy) cluster it is a wrapper around qstat. To see its options, from a terminal connected to the Hoffman2 Cluster issue the command:
$ myjobs -h
Usage: /u/local/bin/myjobs [-u username]
-u username Specify the user to check (defaults to current user: joebruin)
-h Show this help message
where username is any valid username on the cluster. For more ways to look at your Slurm jobs, see Monitoring and canceling Slurm jobs.
Problems with these instructions? Please send comments here.
myquota
myquota is a system utility that reports storage quota utilization for users and/or groups. It works the same way on the Slurm (production) and the Grid Engine (legacy) clusters.
Tip
If myquota is not reporting storage quota utilization for your filesystem consider running countdiskspace in the directory for which you would like to get space usage information (this command make take a long to time to run depending on the number of files and the space used by them).
To view the current quota and space utilization on filesystems to which you have access open a terminal on the Hoffman2 Cluster and issue myquota. For example, user joebruin, part of bruingrp for which project space was purchased, could see:
$ myquota
User quotas for joebruin (UID 1234) (in GBs):
Filesystem Usage (in GB) Quota File Count File Quota
/u/project/bruingrp 0.00 40000 1 40000000
Filesystem /u/project/bruingrp usage: 25297.3 of 40000.0 GBs (63.2%) and 10921845 of 40000000 files (27.3%)
/scratch 0.00 2000 138 5000000
Filesystem /scratch usage: 0.0 of 2000.0 GBs (0.0%) and 13 of 5000000 files (0.0%)
/u/home 1.5 19 407620 200000
Filesystem /u/home usage: 1.5 of 19.5 GBs (7.7%) and 113003 of 200000 files (56.5%)
where the data columns, from left to right, describe:
The first column lists the filesystem for which the quota is being reported.
The second column shows your current usage (in GB by default) on the filesystem.
The third column is your quota on the filesystem.
The fourth column shows your current file usage on the filesystem.
The fifth column shows your file quota on the filesystem.
Following each filesystem line of data is a summary that shows your usage (also in percent) on the filesystem. For a project directory, this summary line will tell you how much of the total project directory disk and file quota has been consumed in the aggregate by all users who have access to it.
To display the utilization, sorted by space consumption, by all users on a project directory on a terminal on the Hoffman2 Cluster issue myquota -ss -g myproject (where myproject is the name of your project directory if applicable). For example, to display the utilization on /u/project/bruingrp:
$ myquota -ss -g bruingrp
Group bruingrp (GID 4321) Report (/u/project/bruingrp):
Username UID Usage (in GB) Quota File Count File Quota
jsmith 15896 0.00 20000 1 20000000
amyr 15693 0.35 20000 22 20000000
bjones 16042 79.84 20000 74413 20000000
trant 15355 147.80 20000 11008 20000000
speedy 15493 2094.58 20000 65895 20000000
lquaid 15527 11652.37 20000 383864 20000000
Filesystem /u/project/bruingrp usage: 13974.9 of 20000.0 GBs (69.9%) and 535203 of 20000000 files (2.7%)
Short help display:
$ myquota -h
Usage: /u/local/bin/myquota.pyc [-v] [-u username] [-g groupname] [-q] [-p /path/to/volume] [-x{bkmgt}] [-P] [-i] [-f cachefile] [-F] [-w] [-r] [-s{sfni}[r]] [-t] [-V] [-h]
(use --help for extended help)
Full help display:
$ myquota --help
Usage: /u/local/bin/myquota.pyc [-v] [-u username] [-g groupname] [-q] [-p /path/to/volume] [-x{bkmgt}] [-P] [-i] [-f cachefile] [-F] [-w] [-r] [-s{sfni}[r]] [-t] [-V] [-h]
(use --help for extended help)
-u: comma separated username/uid list for which to print quota information
-g: comma separated groupname/gid list for which to print quota information
-q: print quotagroup information for groups without their own filesystem instead of regular group report
-p: path to volume (i.e. /u/project/jbruin)
-v: verbose output, includes core limits on user groups, etc.
-x{bkmgt}: numeric prefix (bytes, kB, MB, GB, TB)
-P: print usage percentages
-i: ignore invalid username (report on prototypical user)
-f: cachefile to use instead of /u/local/var/cache/quota.dat
-F: force rewrite of cache file with new data and do not output queue information (similar to -w -r but doesn't output queue info)
-w: rewrite cache file
-r: regenerate data instead of reading from cache
-s{s,f,n,i}: sort by space used, file count, name, or ID (UID/GID). adding an 'r' reverses the sort.
-h: help
-t: minute timeout before cache is considered stale (default 60)
-V: anti-verbose (brief) output
--rawdatadir: path to directory containing raw data files. Defaults are titan_quotas, passwd, group
--${STGSYSTEM}quotafile: full path to quota file (netapp, panasas) (i.e. titan_quotas)
--fslist: full path to sponsor filesystems file
--passwdfile: full path to password file (i.e. /etc/passwd)
--groupfile: full path to group file (i.e. /etc/group)
--help: extended help
version 1.1
Problems with these instructions? Please send comments here.
shownews
shownews shows the latest Hoffman2 Cluster announcements, such as newly installed software or changes to the computing environment. It works on both clusters, but each cluster has its own version and its own news items. From the Hoffman2 Cluster command line, issue:
$ shownews
On the Slurm (production) cluster, shownews lists the news items in a menu in your terminal (or in a window, if you have GUI applications enabled). Some useful options are:
$ shownews -b # print the current news items and exit
$ shownews -a # show archived news items
$ shownews slurm # show only the items whose name matches "slurm"
$ shownews -h # all the options
On the Grid Engine (legacy) cluster, shownews is a GUI application. You can add words to show only the matching news items (e.g., shownews slurm).
Problems with these instructions? Please send comments here.
check_usage
Note
check_usage now works only on the Grid Engine (legacy) cluster, hoffman2.idre.ucla.edu. It is not available on the Slurm (production) cluster, hoffman2.oarc.ucla.edu.
check_usage is text-based command that allows users to monitor their jobs instantaneous resources utilization (in terms of memory and CPU) and compare it with the actual resource requested. check_usage is based on the Unix command top which displays sorted information about processes running. When check_usage is invoked on a terminal opened on the Hoffman2 Cluster, it will show a summary of the current resource utilization of the user’s jobs (batch jobs and interactive sessions).
For example, user joebruin running job ID number 5611331 on host n2030, for which the user has requested exclusive access, 8 computing cores and at least 3GB per core, could see:
$ check_usage
User is joebruin
This command may take a few seconds before giving output...
==== on node: n2030
HOSTNAME CORES_USD CORES_REQ N_PROCS RES MEM(GB) VMEM(GB):
n2030 4.851 8 1 8.5 13.2
List of Job IDs, related resources requested and nodes on which the job is, or its tasks are, running:
JOBID: 5611331
hard resource_list: exclusive=TRUE,h_data=3g,h_rt=43200 exec_host_list 1: n2030:8
+++++
the output of check_usage indicates that the instantaneous resource consumption of job 5611331 is: of 4.851 cores (CORES_USD column) out of the 8 cores requested (CORES_REQ column) and of 8.5 GB of resident memory (RES MEM(GB) column) and 13.2 GB of virtual memory (VMEM(GB) column).
To see which processes are actually consuming the computational resources on the node the command can be run with the -v, verbose, flag as shown below:
$ check_usage -v
User is joebruin
This command may take a few seconds before giving output...
==== on node: n2030 processes are
Output from command top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23409 joebruin 20 0 12.7g 8.5g 58m S 635.8 27.1 306:44.45 python
Summary:
HOSTNAME CORES_USD CORES_REQ N_PROCS RES MEM(GB) VMEM(GB):
n2030 6.358 8 1 8.5 12.7
List of Job IDs, related resources requested and nodes on which the job is, or its tasks are, running:
JOBID: 5611331
hard resource_list: exclusive=TRUE,h_data=3g,h_rt=43200 exec_host_list 1: n2030:8
+++++
the verbose output of check_usage shows the relevant output from the command top for any processes running by the user joebruin and its summary. In the present case only one process is running, python (COMMAND column of output of top), and the summary shows that at the time the command was run the user’s job was using 6.358 (CORES_USD column of the summary) of the 8 computing cores available to the job (CORES_REQ column), 8.5 GB of resident memory (RES MEM(GB) column).
If a user is running more than one job the output of check_usage contains the information for each and every job on each node in which is running (including array jobs for which tasks are shown).
To see a complete list of option at the command line issue:
$ check_usage --help
Usage: /u/local/bin/check_usage [OPTIONS]
Prints out instantaneous resource usage of SGE jobs by a given user
With no [OPTION] prints out resource usage of current user
-u <username> prints out resource usage of user <username>
-v prints out a verbose report of the resource usage
-h displays help
Problems with these instructions? Please send comments here.
myresources
Note
myresources now works only on the Grid Engine (legacy) cluster, hoffman2.idre.ucla.edu. It is not available on the Slurm (production) cluster, hoffman2.oarc.ucla.edu. On the Slurm cluster, h2 whoami shows your Slurm accounts and where their jobs run (see Accounts, QOS and where your jobs run).
A text-based tool to display accesslist membership and compute resources. To see to which computing resources you (or any valid user on the cluster) have access issue from a terminal connected to the Hoffman2 Cluster the command:
$ myresources
To see a compete list of options, use instead:
$ myresources --help
Usage: /u/local/bin/myresources [OPTIONS]
Prints out highp resource for a given user (if any)
With no [OPTION] prints out highp of the current user
-u <username> prints out highp resource of user <username>
-h displays help
Problems with these instructions? Please send comments here.
set_qrsh_env
Note
set_qrsh_env now works only on the Grid Engine (legacy) cluster, hoffman2.idre.ucla.edu. It is not available on the Slurm (production) cluster, hoffman2.oarc.ucla.edu. On the Slurm cluster it isn’t needed: a Slurm interactive session already has the job environment (e.g., $SLURM_JOB_ID).
Upon requesting an interactive session via the command qrsh you will be logged into a compute node. To load in the interactive session the scheduler environment (e.g., the job ID number, $JOB_ID, etc.) users should source the following script according to the shell they are using. The following commands are meant to be issued from a terminal connected to the Hoffman2 Cluster.
If the output of the command:
$ echo $SHELL
/bin/bash
or:
$ echo $SHELL
/bin/zsh
then issue:
$ . /u/local/bin/set_qrsh_env.sh
If the output of the command:
$ echo $SHELL
/bin/csh
or:
$ echo $SHELL
/bin/tcsh
then issue:
$ source /u/local/bin/set_qrsh_env.csh
Problems with these instructions? Please send comments here.
Environmental modules
Environment Modules let you change your shell environment ($PATH, $LD_LIBRARY_PATH, etc.) on the fly, to use the compilers, libraries and applications installed on the Hoffman2 Cluster. The Slurm (production) cluster runs Environment Modules 5.6.1.
Note
This section describes the Slurm (production) cluster, hoffman2.oarc.ucla.edu. On the Grid Engine (legacy) cluster, hoffman2.idre.ucla.edu, the modules and their versions are different, and all_apps_via_modules lists the modules installed there.
How to find which applications are available via environmental modules
Modulefiles on the Hoffman2 Cluster are organized in a hierarchy. Most applications are in the base tree, which is always visible, but some are visible only after you load the module they depend on. For example, the GPU builds of amber, gromacs and plumed, and Open MPI, appear only after module load cuda/12.8, and the Intel MKL and Intel MPI modules only after you load an intel module. module avail lists only the modules that are visible right now, so it can miss an application that is installed.
To search for an application in all the trees, connect via a terminal and use one of:
$ module spider amber # every version, in every tree
$ h2 modules amber # every version, with the module load lines to use
$ modules_lookup -m amber # same as h2 modules, in a different format
module spider prints each version under the tree it is in. When a tree becomes visible only after another module is loaded, the heading names that module (via ...):
$ module spider amber
------------ /u/local/Modules/cuda/12.8/modulefiles (via cuda/12.8) ------------
amber/24_GPU
h2 modules and modules_lookup -m print the commands to run, in the order to run them:
$ modules_lookup -m amber
Looking for application = amber
amber/24_GPU via: module load cuda/12.8; module load amber/24_GPU
So to use amber, run module load cuda/12.8 and then module load amber/24_GPU. modules_lookup -m takes an application name, not a name and version.
To list every module installed on the cluster, in every tree, run module spider with no arguments:
$ module spider
If an application isn’t found, it may be available as a Python or conda package (see Python and Mamba) or as a container (see Containers). To ask for software to be installed, see Software installation.
Environmental modules: Basic commands
Environmental modules consists of: a collection of files, called modulefiles, containing directives to load certain environmental variables (and in certain cases unload conflicting ones) which are interpreted by the module command to dynamically change your environment without the need to edit your $PATH in your shell initialization files.
Basic environmental modules commands are:
$ module help # prints a basic list of commands
$ module spider name # searches every tree for the modulefile name
$ module list # prints a list of the currently loaded modulefiles
$ module avail # lists the modulefiles visible with the modules loaded now
$ module show modulefile # shows how the modulefile will alter the environment
$ module whatis modulefile # prints basic information about the software
$ module help modulefile # prints a basic help for the modulefile
$ module load modulefile # loads the modulefile
$ module unload modulefile # unloads the modulefile
$ module purge # unloads all the modulefiles
where modulefile is the name of the module file for a given application (e.g., for MATLAB the module file name is matlab, and matlab/R2026a is a specific version of it). module load with only a name (e.g., module load matlab) loads the newest version. Give the version when your results must be reproducible.
Note
module is a shell function, not a program. Run module load on a line of its own: if you pipe its output (e.g., module load matlab 2>&1 | tail), the module is loaded in a subshell and has no effect on your shell.
Loading applications in interactive sessions
To run an application, such as MATLAB, interactively, first start an
interactive session on a compute node with srun. For example, to run MATLAB on one core with 10 GB of memory for 3 hours:
$ srun --time=03:00:00 --mem=10G --pty bash -l
$ module load matlab/R2026a
$ matlab -nodisplay
To use the MATLAB Desktop or another graphical application, start the session with x11session instead of srun (see Opening GUI applications from a Slurm interactive session).
Loading applications in shell scripts for batch execution
In a Slurm batch job script, start with module purge and then load the modules the job needs, prerequisites first:
#!/bin/bash
#SBATCH --account=pi_gobruin
#SBATCH --time=04:00:00
#SBATCH --mem=8G
module purge
module load cuda/12.8
module load amber/24_GPU
executable [arguments]
module purge removes the default modules, which can conflict with the application (see Default user environment upon login into the cluster), and makes the job independent of the modules loaded in the shell from which you submitted it. See Loading modules in Slurm jobs for details. To check that every module in a script exists, and that its prerequisites are loaded before it, run:
$ h2 validate myjob.sh
The module command is available in job scripts written for bash or tcsh. If a script runs in a shell where it isn’t defined (module: command not found), add the line for that shell before the first module command:
. /u/local/Modules/default/init/modules.sh
source /u/local/Modules/default/init/modules.csh
Application environment for distributed jobs
Parallel jobs that use Intel MPI or Open MPI need the same MPI library on every node they run on. Load the MPI module in the job script, after module purge, and start the program with mpirun (not srun):
Intel MPI is part of the
intelmodules (e.g.,module load intel/2026.0.0). Usemodule avail intelto see the versions.Open MPI is in the cuda tree:
module load cuda/12.8, thenmodule load openmpi/5.0.2.
Load the same compiler and MPI modules you used to build the program. Applications installed as modules (e.g., gromacs, amber) load their own MPI, so don’t load another one on top of it. For a complete example, see Distributed memory (MPI) jobs.
Default user environment upon login into the cluster
A new shell on the Slurm cluster, and therefore every job, starts with these modules loaded:
$ module list
Currently Loaded Modulefiles:
1) OARC 5) debugger/2026.2.0 <aL>
2) compiler-rt/2026.2.0 <aL> 6) libfabric/2.6.13 <aL>
3) umf/1.2.0 <aL> 7) mpi/2021.19 <aL>
4) tcm/1.6 <aL> 8) intel/2026.2.0
Key:
<module-tag> <aL>=auto-loaded
<aL> marks the modules that intel/2026.2.0 loaded for you. intel/2026.2.0 provides the Intel oneAPI C, C++ and Fortran compilers (icx, icpx, ifx), Intel MPI and the Intel Math Kernel Library (MKL). The GNU compilers (gcc, g++, gfortran) are those of the operating system (Rocky Linux 9, GCC 11.5) and need no module.
Many applications were built with intel/2024.1.0, which conflicts with the default intel/2026.2.0. Loading one of them in the default environment fails:
$ module load gromacs/2024.3
Loading intel/2024.1.0
ERROR: Module cannot be loaded due to a conflict.
HINT: Might try "module unload intel/2026.2.0" first.
Run module purge first (or module unload intel/2026.2.0) and then load the application, which loads the intel version it needs.
Changing your environment – Example 1: Loading a different compiler
To use a different version of the Intel compilers:
$ module avail intel # check which versions are available
$ module load intel/2024.1.0 # replaces intel/2026.2.0 and its modules
When you switch to a different compiler, the modules that depend on the old one are unloaded with it. Some modules, e.g. MKL, are in the tree of each intel version, so module avail lists different modules depending on which intel module is loaded. module spider searches all of them:
$ module spider mkl
----------------- /u/local/Modules/intel/2026.2.0/modulefiles ------------------
mkl/2026.2
------- /u/local/Modules/intel/2026.0.0/modulefiles (via intel/2026.0.0) -------
mkl/2026.0
------- /u/local/Modules/intel/2024.1.0/modulefiles (via intel/2024.1.0) -------
mkl/2024.1
The first heading has no via, because intel/2026.2.0 is already loaded.
Changing your environment – Example 2: Loading a python modulefile
The operating system’s python doesn’t include the extra packages installed on the Hoffman2 Cluster. To use a cluster installation of python and its packages, load a python module:
$ module avail python # python/3.10.20, python/3.12.13
$ module load python/3.12.13
For conda environments, see Mamba (module load miniforge).
Writing your own modulefiles
In some cases you may have applications and/or libraries compiled in your own $HOME (or in your group project directory) for which you may want to create your own modulefiles.
In these cases you will want to use the following environmental modules command:
$ module use $HOME/modulefiles
where: $HOME/modulefiles is the directory where your own modulefiles reside. The command, module use $HOME/modulefiles, adds: $HOME/modulefiles to your $MODULEPATH.
The command:
$ module avail
will now show your own modulefiles along with the modulefiles that we provide.
To make your own modulefiles available in every session, add the line:
module use $HOME/modulefiles
to your shell initialization file (~/.bashrc or ~/.cshrc). In a job script that starts with module purge, put module use $HOME/modulefiles after the purge.
A sample modulefile is included here for the application MYAPP version X.Y (installed in /path/to/my/software/dir/MYAPP/X.Y, which could, for example, be: $HOME/software/MYAPP/X.Y):
#%Module
# MYAPP module file
set name "MYAPP"
# Version number
set ver "X.Y"
module-whatis "Name : $name"
module-whatis "Version : $ver"
module-whatis "Description : Add desc of MYAPP here"
set base_dir /path/to/my/software/dir/$name/$ver
prepend-path PATH $base_dir/bin
prepend-path LD_LIBRARY_PATH $base_dir/lib
prepend-path MANPATH $base_dir/man
prepend-path INFOPATH $base_dir/info
setenv MYAPP_DIR $base_dir
setenv MYAPP_BIN $base_dir/bin
setenv MYAPP_INC $base_dir/include
setenv MYAPP_LIB $base_dir/lib
N.B.: Environment Modules doesn’t know which of your modules conflict with each other. To stop two conflicting modules from being loaded together, add a conflict line to your modulefile (e.g., conflict MYAPP stops two versions of MYAPP from being loaded at once). Modulefiles are written in Tcl, so they can also use Tcl commands. For more details see man modulefile.
Problems with the instructions on this section? Please send comments here.
Containers
Apptainer
Apptainer, formally Singularity, is a free, cross-platform and open-source software that can run Operating System Virtualization also known as Containerization. This type of virtualization allows you to run an Operating System within a host Operating System.
Apptainer allows users to ‘bring their own’ Operating System and root filesystem on the Hoffman2 Cluster. In some cases this may facilitate the process of porting/installing applications on the Hoffman2 Cluster. Users can run applications using system libraries and specific OS requirements different that the underlying operating system on the Hoffman2 Cluster.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider apptainer on the Slurm cluster and module av apptainer on the Grid Engine cluster (where the older singularity modules are also available).
Note
Running of OS Containers is supported using an unprivileged (non-setuid) build of Apptainer. This allows you to download or transfer your pre-built containers to the cluster, but you will have limited functionality building or modifying containers while on the Hoffman2 Cluster.
Apptainer Workflow
In some cases the software package you would like to run on the Hoffman2 Cluster is packeged within a Docker or Apptainer container. In this case you can skip the first of the following steps.
Create your Container This is can be done by installing Apptainer on your local computer (where you have root/sudo access) and build a container with the needed application. Many developers have already created containers with their software application installed. DockerHub is a large repository of container images that can be used by Apptainer.
Transfer and bring your container to the Hoffman2 Cluster Your built container will need to be transferred to the Hoffman2 Cluster or pulled, with the command:
apptainer pull, from a repository like DockerHub.Run your Apptainer container You can run applications in Apptainer in two ways: with the command
apptainer shellor, to run specific commands within a container, withapptainer exec.
Running Apptainer
On the Slurm cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=20G --pty bash -l
Then load the apptainer module file:
$ module purge
$ module load apptainer/1.3.4
(to see the installed versions use module spider apptainer). The module sets the $H2_CONTAINER_LOC variable, which points to ready-made containers of popular apps (ls $H2_CONTAINER_LOC). apptainer pull, apptainer exec and apptainer shell work as described in the GE interactive tab. Apptainer keeps its cache in ~/.apptainer/cache by default; to keep it from filling your $HOME, set export APPTAINER_CACHEDIR=$SCRATCH/.cache/apptainer before pulling images.
Example: start a new Apptainer shell on a container with TensorFlow version 2.4.1 on a GPU node
$ # get an interactive session on a GPU node:
$ srun --gres=gpu:1 --time=01:00:00 --mem=16G --pty bash -l
$ # load the apptainer module file:
$ module purge
$ module load apptainer/1.3.4
$ # start the Apptainer shell on the container:
$ apptainer shell --nv $H2_CONTAINER_LOC/tensorflow-2.4.1-gpu-jupyter.sif
Apptainer>
The --nv option makes the GPU available in the container, which carries its own CUDA, so you do not need to load a cuda module (see Requesting GPUs with Slurm).
Important
On the Grid Engine (legacy) cluster, in order to run Apptainer interactively, you need to request an interactive session, as shown in the example below (you can of course change or add other resources or modify the number of cores requested:
$ qrsh -l h_rt=1:00:00,h_data=20G # use exclusive to reserve the entire node
Then load the apptainer module file.
$ module load apptainer
Among other things the apptainer module file set the $H2_CONTAINER_LOC variable which points to a location on the filesystem where some ready-made containers of popular apps are available.
To learn how to import a container with apptainer pull, you can issue:
$ apptainer pull --help
To learn how to run a command within a container issue:
$ apptainer exec --help
or to interact with the container via a shell:
$ apptainer shell --help
Example: start a new Apptainer shell on a container with TensorFlow version 2.4.1 on a GPU Node
# get an interactive session on a GPU node:
qrsh -l gpu,RTX2080Ti,exclusive,h_rt=1:00:00
# load the apptainer module file:
module load apptainer
# start the Apptainer shell on the container:
apptainer shell --nv $H2_CONTAINER_LOC/tensorflow-2.4.1-gpu-jupyter.sif
Note that the prompt change to Apptainer> to reflect the fact that you are in a container.
From here on, TensorFlow can be executed with, for example:
python3
at the python prompt issue:
import tensorflow as tf
To submit a batch job that runs a command in a container on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q), giving it your apptainer exec ... command line as the command to run:
$ job.q -p apptainer
or create a job script similar to:
### apptainer_submit.job START ###
#!/bin/bash
#SBATCH --job-name=apptainer
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=10G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=apptainer.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load apptainer/1.3.4
module list
# keep the Apptainer cache out of your $HOME:
export APPTAINER_CACHEDIR=$TMPDIR/apptainer_cache
mkdir -p $APPTAINER_CACHEDIR
# This will run python3 (with the tensorflow package) on the tf_example.py script,
# assuming you ALREADY have a container named tensorflow-2.4.1.sif in $SCRATCH;
# change the command below to reflect your actual apptainer command:
apptainer exec $SCRATCH/tensorflow-2.4.1.sif python3 $HOME/myproject/tf_example.py
echo "Job $SLURM_JOB_ID ended at $(date)"
### apptainer_submit.job STOP ###
where you would replace the account, the resources requested and the Apptainer command as needed. For a container that uses a GPU, add #SBATCH --gres=gpu:1 and the --nv option to apptainer exec (see Requesting GPUs with Slurm). Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate apptainer_submit.job
$ sbatch apptainer_submit.job
On the Grid Engine (legacy) cluster, create a submission script similar to:
### submit_apptainer.sh START ### #!/bin/bash #$ -cwd # error = Merged with joblog #$ -o joblog.$JOB_ID #$ -j y # Edit the line below to request the appropriate runtime and memory # (or to add any other resource) as needed: #$ -l h_rt=1:00:00,h_data=10G # Email address to notify #$ -M $USER@mail # Notify when #$ -m bea # echo job info on joblog: echo "Job $JOB_ID started on: " `hostname -s` echo "Job $JOB_ID started on: " `date ` echo "Job $JOB_ID will run on: " cat $PE_HOSTFILE echo " " # load the job environment: . /u/local/Modules/default/init/modules.sh module load apptainer # This will run python3 (with the tensorflow package) on tf-example.py script # Assuming you ALREADY have a container named tensorflow-2.4.1.sif # change the command below to reflect your actual apptainer command apptainer exec tensorflow-2.4.1.sif python3 tf_example.py > output.$JOB_ID # echo job info on joblog: echo "Job $JOB_ID completed on: " `hostname -s` echo "Job $JOB_ID completed on: " `date ` echo " " ### submit_apptainer.sh STOP ###
To submit the job use:
qsub submit_apptainer.sh
References:
Apptainer User Guide
DockerHub
UCLA HPC Workshop on Containers
Editors
Emacs
“An extensible, customizable, free/libre text editor.” – GNU Emacs GNU Emacs can be accessed in a text-based or graphical mode (with mouse accessible menus and more).
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed). On the Grid Engine cluster, a more recent version is also available as a module (see module av emacs).
To start Emacs, open a terminal on the Hoffman2 Cluster and enter:
$ emacs -nw
To start Emacs and open filename, issue:
$ emacs -nw filename
On the Grid Engine (legacy) cluster, to run a more recent version of Emacs, issue:
$ module load emacs
$ emacs
or see which versions are available with:
$ module av emacs
and load the needed VERSION with:
$ module load emacs/VERSION
While the GNU Emacs Reference Card provides an exhoustive list of keyboard shortcuts, a quick reference is also provided here:
Note
Keyboard shortcuts |
Description |
Ctrl-x Ctrl-w [*] |
Write current buffer to a file |
Ctrl-x Ctrl-s |
Save current buffer to a file |
Ctrl-x Ctrl-c |
Exit Emacs |
Ctrl-x 2 [†] |
Split the emacs window vertically |
Ctrl-x 3 |
Split the emacs window horizontally |
Ctrl-x o |
Switch cursor to another open window (if more than one is open) |
Ctrl-x 0 |
Close current window (if more than one is open) |
Ctrl-s |
Search the current file or buffer forward |
Ctrl-r |
Search the current file or buffer forward |
Ctrl-g |
Abort current search |
Ctrl-x u |
Undo change |
Ctrl-h |
Help |
Ctrl-h t |
Emacs tutorial |
Note
To open the graphical user interface (GUI) of GNU Emacs, you will need to have connected to the Hoffman2 Cluster either via a remote desktop (a DCV remote desktop on the Slurm cluster, or a remote desktop on the Grid Engine cluster) or via terminal and SSH having followed directions on how to open GUI applications (on the Slurm compute nodes, see Opening GUI applications from a Slurm interactive session). Under these conditions, Emacs will start in GUI mode by default.
To start GNU Emacs from a remote desktop, click on Applications > Accessories > Emacs or, from a terminal, issue the command:
$ emacs &
On the Grid Engine (legacy) cluster, to run a more recent version of Emacs, issue:
$ module load emacs
$ emacs &
or see which versions are available with:
$ module av emacs
and load the needed VERSION with:
$ module load emacs/VERSION
References:
Problems with the instructions on this section? Please send comments here.
gedit
A fully featured graphical text editor within Gnome desktop, gedit comes with built-in searchable documentation under its Help menu.
Note
Available on: the Grid Engine (legacy) cluster and, on the Slurm (production) cluster, only on the DCV remote desktop node (dcv2.hoffman2.oarc.ucla.edu), as part of the operating system (no module needed). gedit is not installed on the Slurm compute nodes, so you cannot open it from an x11session or another Slurm interactive session: on the Slurm cluster, use it from a DCV remote desktop session.
Note
To open the graphical user interface (GUI) of gedit on the Slurm cluster, you will need to be connected via a DCV remote desktop (gedit runs on the DCV node itself). On the Grid Engine (legacy) cluster, you will need to have connected either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications.
To start gedit from a remote desktop, click on Applications > Accessories > gedit Text Editor or, from a termial, issue the command:
$ gedit &
References:
https://help.gnome.org/users/gedit/stable/index.html.en
Problems with the instructions on this section? Please send comments here.
nano
A simple text editor with additional features and functionalities. See the GNU nano homepage for more information.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed). On the Grid Engine cluster, a more recent version is also available as a module (see module av nano).
To launch nano:
$ nano
or you can launch nano with options. To see all the options, issue:
$ nano --help
References:
Problems with the instructions on this section? Please send comments here.
Vi/Vim/eVim
Vi, Vim and eVim are ubiquitus text editor available in most unix instllations. With many built-in fnction vi and is a very versatile text editors most suited to edit code.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster (vi and vim), as part of the operating system (no module needed). For eVim, see the Graphical user interface tab.
The Vi editor available on most Unix/Linux distributuion is actually Vim (Vi IMproved), an improved distribution of the basic Vi editor. To start the editor in text mode (i.e., with no GUI interface), issue on the Hoffman2 Cluster shell prompt:
$ vi
Launch vim with filename:
$ vi filename
Many resources and tutorial are available online. Vi tutorials. See also vim website for more information. Documentation is also available by entering
$ :help
while in the editor.
Note
Vi is a modal editor which means that it can be accessed in two primary modes: command mode, the mode in which vi starts, in which a variety of commands can be entered (e.g., to insert, alter, or navigate within the open file, etc.) and the insert mode, in which text can be inserted as typed. Type i to toggle from the command mode to the insert mode and Esc to switch back from the insert mode to the command mode.
While the Vi Reference Card provides a more extensive list of the basic vi commands a quick reference is also provided here:
Keyboard shortcuts |
Description |
Esc :w |
Write current buffer to a file |
Esc :x |
Save current buffer to a file and quit vi |
Esc :q |
Exit vi if no changes are made |
Esc :q! |
Exit vi and undo any changes |
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Evim is the graphical version of Vim; you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions regarding how to open GUI applications.
$ evim &
Launch evim with filename:
$ evim filename &
Getting help and options:
$ evim --help
References:
Vim Cheat sheet https://vimsheet.com/
Vim Tutorial https://www.tutorialspoint.com/vim/vim_introduction.htm
Evim tutorial http://www.linux-tutorial.info/modules.php?name=ManPage&sec=1&manpage=evim
Problems with the instructions on this section? Please send comments here.
Compilers
GNU Compiler Collection (gcc)
“The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,…)” – GNU Compiler Collection (gcc)
Note
Available on: the Slurm (production) cluster, where GCC 11.5 is part of the operating system (no module needed: there is no gcc module), and the Grid Engine (legacy) cluster, where module av gcc shows the installed versions.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
use the GNU Compiler Collection (GCC 11.5) that is part of the operating system: there is no gcc module to load. To invoke the C, C++ and Fortran compilers, use:
$ gcc --help
$ g++ --help
$ gfortran --help
The default environment on the Slurm cluster also loads the Intel compilers (see Intel C/C++ & Fortran compilers), which do not change the GNU compilers. Please refer to GNU Compiler Collection (gcc) documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of GNU Compiler Collection (gcc) with:
$ module av gcc
Load the default version of GNU Compiler Collection (gcc) in your environment with:
$ module load gcc
To load a different version, issue:
$ module load gcc/VERSION
where VERSION is to be replaced with the desired version of the GNU Compiler Collection (which needs to be one of the versions listed in the output of the command: module av gcc).
To invoke the C compiler, use:
$ gcc --help
For the C++ compiler, use:
$ c++ --help
For the fortran compiler, use:
$ gfortran --help
Please refer to GNU Compiler Collection (gcc) documentation to learn how to use this software.
To submit a batch job with the GNU compilers on the Slurm cluster, create a job script similar to:
### gcc_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gcc
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gcc.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module list
# GCC 11.5 is part of the operating system (no module needed);
# compile and run your program (substitute your source file and options):
gcc -O2 -o myprogram $HOME/myproject/myprogram.c
./myprogram
echo "Job $SLURM_JOB_ID ended at $(date)"
### gcc_submit.job STOP ###
where you would replace the account, the resources requested and the compile and run commands as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate gcc_submit.job
$ sbatch gcc_submit.job
References:
Problems with the instructions on this section? Please send comments here.
Intel C/C++ & Fortran compilers
The Intel /C++ and Fortran compilers “produce optimized code that takes advantage of the ever-increasing core count and vector register width in Intel processors” – Intel C/C++ & Fortran compilers
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider intel on the Slurm cluster and module av intel on the Grid Engine cluster.
‼️ On the Slurm cluster, use ifx instead of ifort
The classic compilers ifort, icc and icpc are not available in the default Intel modules on the Slurm (production) cluster. Use ifx (Fortran), icx (C) and icpx (C++), and for MPI mpiifx, mpiicx and mpiicpx: mpiifort, mpiicc and mpiicpc still exist but fail. To build existing code, see Building existing code with the oneAPI compilers. For the full details, see the news item Intel ifort replaced by ifx on the Slurm partition 🔧.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
the default environment already includes the Intel oneAPI compilers intel/2026.2.0 (and Intel MPI). To use another version, e.g.:
$ module purge
$ module load intel/2024.1.0
To see the installed versions, use module spider intel. The Intel oneAPI compilers are invoked with:
$ icx --help
$ icpx --help
$ ifx --help
for C, C++ and Fortran respectively. The classic compilers ifort, icc and icpc are not available (see On the Slurm cluster, use ifx instead of ifort above). For MPI programs, use mpiicx, mpiicpx or mpiifx and start them with mpirun (see Distributed memory (MPI) jobs). For example:
$ ifx -O2 -o myprog myprog.f90
$ mpiifx -O2 -o mympiprog mympiprog.f90
Building existing code with the oneAPI compilers. Most build systems let you choose the compilers on the command line, so code written for ifort, icc and icpc builds without editing its files:
$ make FC=ifx F77=ifx F90=ifx CC=icx CXX=icpx
$ ./configure FC=ifx F77=ifx CC=icx CXX=icpx
$ cmake -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ..
For MPI code, use mpiifx, mpiicx and mpiicpx in place of ifx, icx and icpx above. If a build script calls mpiifort directly, set export I_MPI_F90=ifx before you run it. If a Makefile sets the compiler with FC=ifort and ignores the command line, change ifort to ifx in the file.
Please refer to the Intel oneAPI compilers documentation and the Intel Fortran Compiler (ifx) documentation to learn how to use these compilers.
Note
On the Grid Engine (legacy) cluster, unless you have modified the default environment with which every account on the cluster is provided, a version of the Intel C/C++ and Fortran compiler is loaded in your environment. Most of the third party applications that were built on the cluster assume that you have this version of the Intel compiler loaded in your environment.
After requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Intel C/C++ & Fortran compilers with:
$ module avail intel
Load the default version of Intel C/C++ & Fortran compilers in your environment with:
$ module load intel
To load a different version, issue:
$ module load intel/VERSION
where VERSION is replaced by the desired version of Intel C/C++ & Fortran compilers.
To invoke the Intel compiler, use:
$ icc --help
For C++, issue:
$ icpc --help
For Fortran, enter:
$ ifort --help
Please refer to Intel C/C++ documentation and the Intel Fortran compilers documentation to learn how to use these compilers.
To submit a batch job with the Intel compilers on the Slurm cluster, create a job script similar to:
### intel_submit.job START ###
#!/bin/bash
#SBATCH --job-name=intel
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=intel.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load intel/2026.2.0
module list
# compile and run your program (substitute your source file and options).
# C: icx, C++: icpx, Fortran: ifx (ifort, icc and icpc are not available):
icx -O2 -o myprogram $HOME/myproject/myprogram.c
# Fortran example:
# ifx -O2 -o myprogram $HOME/myproject/myprogram.f90
./myprogram
echo "Job $SLURM_JOB_ID ended at $(date)"
### intel_submit.job STOP ###
where you would replace the account, the resources requested and the compile and run commands as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate intel_submit.job
$ sbatch intel_submit.job
References:
https://software.intel.com/content/www/us/en/develop/tools/compilers.html
https://software.intel.com/content/www/us/en/develop/tools/compilers/c-compilers/documentation.html
https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler.html
https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html
Problems with the instructions on this section? Please send comments here.
NVIDIA HPC SDK (PGI C/C++ compiler)
The PGI compilers and tools have merged into the NVIDIA HPC SDK, which provides the C, C++ and Fortran compilers nvc, nvc++ and nvfortran (the former pgcc, pgc++ and pgfortran, still available under those names), with support for OpenACC, OpenMP and CUDA Fortran.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider hpcsdk on the Slurm cluster and module av hpcsdk on the Grid Engine cluster. On the Slurm cluster the NVIDIA HPC SDK 24.9 is available built for CUDA 11 (hpcsdk/24.9-cuda11) and CUDA 12 (hpcsdk/24.9-cuda12).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load the NVIDIA HPC SDK in your environment with, e.g.:
$ module purge
$ module load hpcsdk/24.9-cuda12
which also loads the MPI library of the SDK (hpcx). To invoke the C, C++ and Fortran compilers, use:
$ nvc --help
$ nvc++ --help
$ nvfortran --help
To run code compiled for GPUs (e.g. with -acc or -cuda), request a GPU card for the session or job with --gres=gpu:1 (see Requesting GPUs with Slurm). Please refer to the NVIDIA HPC SDK documentation to learn how to use these compilers.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
load a version of the NVIDIA HPC SDK (hpcsdk/20.11 or hpcsdk/21.5) with, e.g.:
$ module load hpcsdk/21.5
and invoke the compilers with nvc, nvc++ and nvfortran.
To submit a batch job with the NVIDIA HPC SDK compilers on the Slurm cluster, create a job script similar to:
### hpcsdk_submit.job START ###
#!/bin/bash
#SBATCH --job-name=hpcsdk
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=hpcsdk.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load hpcsdk/24.9-cuda12
module list
# compile and run your program (substitute your source file and options):
nvc -O2 -o myprogram $HOME/myproject/myprogram.c
./myprogram
echo "Job $SLURM_JOB_ID ended at $(date)"
### hpcsdk_submit.job STOP ###
where you would replace the account, the resources requested and the compile and run commands as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate hpcsdk_submit.job
$ sbatch hpcsdk_submit.job
References:
Problems with the instructions on this section? Please send comments here.
Nvidia CUDA
“CUDA is a parallel computing platform and programming model developed by NVIDIA for general computing on graphical processing units (GPUs).” –NVIDIA CUDA Home Page
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider cuda on the Slurm cluster and module av cuda on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=8G --gres=gpu:1 --pty bash -l
load a version of CUDA in your environment with, e.g.:
$ module purge
$ module load cuda/12.8
To see the installed versions, use module spider cuda. To invoke the CUDA compiler, and to see the GPU card assigned to your session:
$ nvcc --help
$ nvidia-smi
GPU jobs must request the cards they use with --gres=gpu:N; to select a card type, add a constraint such as -C A100 (see Requesting GPUs with Slurm, and h2 gpus for the cards available). Please refer to CUDA documentation to learn how to use this software.
Note
On the Grid Engine (legacy) cluster, you can load CUDA in your environment only if you are on a GPU node. Please see GPU access to learn what type of GPU resources are available on the Hoffman2 Cluster and how to request interactive session on nodes with specific cards.
After requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l gpu,h_rt=1:00:00,h_data=2G
you can check the available versions of CUDA with:
$ module avail cuda
Load the default version of CUDA in your environment with:
$ module load cuda
To load a different version, issue:
$ module load cuda/VERSION
where VERSION is replaced by the desired version of CUDA.
To invoke the CUDA compiler:
$ nvcc --help
Please refer to CUDA documentation to learn how to use this software.
To submit a batch job with a CUDA program on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p cuda/12.8 -g 1
or create a job script similar to:
### cuda_submit.job START ###
#!/bin/bash
#SBATCH --job-name=cuda
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Request one GPU card (see: h2 gpus):
#SBATCH --gres=gpu:1
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=cuda.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cuda/12.8
module list
# compile and run your CUDA program (substitute your source file and options):
nvcc -O2 -o myprogram $HOME/myproject/myprogram.cu
nvidia-smi
./myprogram
echo "Job $SLURM_JOB_ID ended at $(date)"
### cuda_submit.job STOP ###
where you would replace the account, the resources requested and the CUDA program as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate cuda_submit.job
$ sbatch cuda_submit.job
See Requesting GPUs with Slurm to select a GPU card type.
References:
Problems with the instructions on this section? Please send comments here.
Debuggers and profilers
GNU debugger
“GDB, the GNU Project debugger, allows you to see what is going on ‘inside’ another program while it executes – or what another program was doing at the moment it crashed.” – GNU debugger
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed).
On the Slurm cluster, GDB is part of the operating system of the compute nodes (/usr/bin/gdb). Run it in an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example:
$ srun --time=01:00:00 --mem=4G --cpus-per-task=2 --pty bash -l
and, once the session starts, run GDB with:
$ gdb executable_name
where executable_name is your executable, compiled with -g to include debugging information.
The detailed usage for GDB can be found in the official documentation.
On the Grid Engine (legacy) cluster, GDB comes from the Linux system library tool which is available at /usr/bin/gdb.
Users who want to using GDB MUST request an interactive session for the debugging process (remember to specify a runtime, memory, number of computational cores, etc. as needed). You can request an interactive session with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
Once a qrsh session is acquired, GDB can be started with the simple command:
$ gdb executable_name
where executable_name is the user’s executable file name compiled from the program.
The detailed usage for GDB can be found in the official documentation.
References:
Problems with the instructions on this section? Please send comments here.
DDD
“GNU DDD is a graphical front-end for command-line debuggers such as GDB, DBX, WDB, Ladebug, JDB, XDB, the Perl debugger, the bash debugger bashdb, the GNU Make debugger remake, or the Python debugger pydb. Besides “usual” front-end features such as viewing source texts, DDD has become famous through its interactive graphical data display, where data structures are displayed as graphs.” –DataDisplayDebugger website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, users who want to use DDD MUST request an interactive session with enabling X11 forwarding for the graphical debugging process. Once a qrsh session is acquired, start DDD (it is part of the operating system, so no module is needed) with:
$ ddd &
The detailed usage for DDD can be found in the official documentation.
References:
Problems with the instructions on this section? Please send comments here.
Intel Advisor
“Intel Advisor is composed of a set of tools to help ensure your Fortran, C and C++ (as well as .NET on Windows*) applications realize full performance potential on modern processors, including Vectorization Advisor, Roofline Analysis, Threading Advisor, Offload Advisor (Intel® Advisor Beta only), Flow Graph Analyzer.” – Intel Advisor Website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. On the Slurm cluster, Advisor is a module in the Intel oneAPI module tree: module spider advisor shows which intel version provides it (currently advisor/2024.1, with intel/2024.1.0). On the Grid Engine cluster, it is the intel/advisor module (see module av intel).
On the Slurm cluster, to use the Intel Advisor command-line interface, request an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --cpus-per-task=2 --pty bash -l
and load Intel Advisor in your environment with:
$ module purge
$ module load intel/2024.1.0
$ module load advisor/2024.1
Note
If the advisor command is not found after loading the module, set up the Advisor environment with source /u/local/compilers/intel/oneapi/2024.1.0/advisor/2024.1/env/vars.sh (bash) or source /u/local/compilers/intel/oneapi/2024.1.0/advisor/2024.1/env/vars.csh (tcsh).
Then run an analysis of your program (./myprog) and view its results with:
$ advisor --collect=survey --project-dir=./advi_results -- ./myprog
$ advisor --report=survey --project-dir=./advi_results
To use the Intel Advisor graphical interface, open a GUI session on a compute node with x11session (see Opening GUI applications from a Slurm interactive session), for example:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
then load the modules as shown above and run:
$ advisor-gui &
On the Grid Engine (legacy) cluster, Intel Advisor is available as a standalone product and as part of Intel® Parallel Studio XE Professional Edition that the Hoffman2 Cluster already installed. When loading the intel module by the command below, the Intel Advisor environmental variables for version 18.0.4 will be automatically loaded accordingly.
$ module load intel
Users who want to use Intel Advisor GUI must request an interactive session with enabling X11 forwarding for the graphical debugging process. Once a qrsh session is acquired and the module command is loaded, Intel Advisor GUI can be launched by the command:
$ advixe-gui
Users who want to using Intel Advisor CLI must request an interactive session for the command-line debugging process. Once a qrsh session is acquired and the module command above is loaded, Intel Advisor CLI can be launched by the command:
$ advixe-cl --collect=survey -- <target> # to run an analysis from the CLI
$ advixe-cl --report=survey # to view the analysis result
$ advixe-cl --snapshot # to create a snapshot run of the analysis results
$ advixe-cl --collect=survey -- <target> # to re-run the analysis
The detailed information about how to launch Intel Advisor can be found in the official documentation of User Guide.
References:
Problems with the instructions on this section? Please send comments here.
Intel VTune Profiler
“Intel VTune Profiler is a performance analysis tool for users who develop serial and multithreaded applications. VTune Profiler helps you analyze the algorithm choices and identify where and how your application can benefit from available hardware resources.” – Intel VTune Profiler
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. On the Slurm cluster, VTune is a module in the Intel oneAPI module tree: load an intel module first (intel/2026.2.0 is loaded by default) and then module load vtune; module spider vtune shows which intel version provides each VTune version. On the Grid Engine cluster, it is the intel/vtune module (see module av intel).
On the Slurm cluster, to use the Intel VTune Profiler command-line interface, request an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --cpus-per-task=2 --pty bash -l
and load VTune in your environment with:
$ module purge
$ module load intel
$ module load vtune
Then profile your program (./myprog) with:
$ vtune -collect hotspots -result-dir r000hs -- ./myprog # to perform the hotspots collection on the given target
$ vtune -report hotspots -result-dir r000hs # to generate the 'hotspots' report for the result directory 'r000hs'
$ vtune -help collect # to display help for the collect action
To use the VTune graphical interface, open a GUI session on a compute node with x11session (see Opening GUI applications from a Slurm interactive session), for example:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
then load the modules as shown above and run:
$ vtune-gui &
On the Grid Engine (legacy) cluster, Intel VTune Profiler (formerly known as Intel VTune Amplifier) is available as a standalone product and as part of Intel Parallel Studio XE Professional Edition that the Hoffman2 Cluster installed. Users who want to using Intel VTune Profiler MUST request an interactive session. Once a qrsh session is ccquired, it can be started with the simple command: When loading the intel module by the command below, the Intel VTune Amplifier environmental variables for version 18.0.4 will be automatically loaded accordingly.
$ module load intel
Users who want to using Intel VTune Amplifier GUI must request an interactive session with enabling X11 forwarding for the graphical debugging process. Once a qrsh session is acquired and the module command above is loaded, Intel VTune Amplifier GUI can be launched by the command:
$ amplxe-gui
Users who want to using Intel VTune Amplifier CLI must request an interactive session for the command-line debugging process. Once a qrsh session is acquired and the module command above is loaded, Intel VTune Amplifier CLI can be launched by the command:
$ amplxe-cl -collect hotspots a.out # to perform the hotspots collection on the given target
$ amplxe-cl -report hotspots -r r000hs # to generate the 'hotspots' report for the result directory 'r000hs'
$ amplxe-cl -help collect # to display help for the collect action
The detailed information about how to launch Intel VTune Amplifier can be found in the official documentation of User Guide.
Note
The above commands is for the version of Intel VTune Amplifier integrated into Intel Parallel Studio XE (v18.0.4) installed on the Hoffman2 Cluster as of August 2020. According to the Intel’s website update, Intel VTune Amplifier has been renamed to Intel VTune Profiler starting with a standalone version of the VTune Profiler in the version of 2020+. It means in the future versions of Intel Parallel Studio XE Professional Edition to be installed on the Hoffman2 Cluster, to accommodate the product name change, the command line tool amplxe-cl will be renamed to vtune. Graphical interface launcher amplxe-gui will be renamed to vtune-gui.
References:
Problems with the instructions on this section? Please send comments here.
Valgrind Tools
“Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.” – valgrind.org
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed).
On the Slurm cluster, Valgrind is part of the operating system of the compute nodes (/usr/bin/valgrind), so no module is needed. Run it in an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example:
$ srun --time=01:00:00 --mem=8G --pty bash -l
Compile your program with -g (and preferably -O0) and, once the session starts, run it under Valgrind’s default tool (Memcheck) with:
$ valgrind --leak-check=yes myprog arg1 arg2
Under Valgrind your program runs much slower (e.g., 20 to 30 times) than normal and uses more memory, so request enough runtime and memory. The detailed information about how to use Valgrind can be found in the official documentation of User Manual.
On the Grid Engine (legacy) cluster, Valgrind is part of the operating system (/usr/bin/valgrind), so no module or environment setup is needed.
To run Valgrind, the user’s program needs to be compiled with -g to include debugging information so that Valgrind’s error messages include exact line numbers. -O0 can work fine with some slowdown. But -O1 and -O2 are not recommended.
Valgrind provides a bunch of debugging and profiling tools, including Memcheck, Cachegrind, Callgrind, Massif, Helgrind, DRD, DHAT, Experimental Tools (BBV, SGCheck) and Other Tools.
The most popular of Valgrind tools is Memcheck. It can detect many memory-related errors that are common in C and C++ programs and that can lead to crashes and unpredictable behaviour. Suppose the user’s program to be run like this:
$ myprog arg1 arg2
The following command line will run the program under Valgrind’s default tool (Memcheck):
$ valgrind --leak-check=yes myprog arg1 arg2
where --leak-check option turns on the detailed memory leak detector. The program will run much slower (eg. 20 to 30 times) than normal, and use a lot more memory. Memcheck will issue messages about memory errors and leaks that it detects.
The detailed information about how to use Valgrind can be found in the official documentation of User Manual.
References:
Problems with the instructions on this section? Please send comments here.
Build automation tools
GNU make
GNU Make is a tool to controls the generation of executables from the program’s non-source codes. Make configures how to build your program using a controlling file, makefile, which included each of the non-source files and how to compile the program one another.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed). On the Grid Engine cluster a make module is also available (module av make).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=4 --mem-per-cpu=2G --pty bash -l
use the version of GNU Make (4.3) that is part of the operating system (no module needed). To build a project, using the cores requested:
$ make -j $SLURM_CPUS_PER_TASK
Please refer to GNU Make documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
You can check the available versions of GNU Make with:
$ module avail make
To load a particular version, e.g. version 4.3, issue:
$ module load make/4.3
Please refer to GNU Make documentation to learn how to use this software.
To submit a batch job with GNU Make on the Slurm cluster, create a job script similar to:
### make_submit.job START ###
#!/bin/bash
#SBATCH --job-name=make
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=make.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module list
# GNU Make is part of the operating system (no module needed);
# build the project in $HOME/myproject (substitute your directory and target),
# using the cores requested:
make -C $HOME/myproject -j $SLURM_CPUS_PER_TASK
echo "Job $SLURM_JOB_ID ended at $(date)"
### make_submit.job STOP ###
where you would replace the account, the resources requested and the project directory and target as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate make_submit.job
$ sbatch make_submit.job
References:
Problems with the instructions on this section? Please send comments here.
Cmake
“CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK.” – CMake web site
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider cmake on the Slurm cluster and module av cmake on the Grid Engine cluster. On the Slurm compute nodes the operating system also provides a version of cmake (no module needed).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=4 --mem-per-cpu=2G --pty bash -l
load CMake in your environment with:
$ module purge
$ module load cmake/4.3.2
To see the installed versions, use module spider cmake. Load the modules of the compilers and libraries your code needs as well (the GNU compilers need no module). To configure and build a project, using the cores requested:
$ cmake -S src -B build
$ cmake --build build --parallel $SLURM_CPUS_PER_TASK
Please refer to CMake documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
You can check the available versions of CMake with:
$ module avail cmake
To load a particular version of CMake, e.g. version 3.19.5, issue:
$ module load cmake/3.19.5
Please refer to CMake documentation to learn how to use this software.
To submit a batch job with CMake on the Slurm cluster, create a job script similar to:
### cmake_submit.job START ###
#!/bin/bash
#SBATCH --job-name=cmake
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=cmake.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cmake/4.3.2
module list
# configure and build the project in $HOME/myproject/src (substitute your
# source directory and CMake options), using the cores requested:
cmake -S $HOME/myproject/src -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel $SLURM_CPUS_PER_TASK
echo "Job $SLURM_JOB_ID ended at $(date)"
### cmake_submit.job STOP ###
where you would replace the account, the resources requested and the source directory and the CMake options as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate cmake_submit.job
$ sbatch cmake_submit.job
References:
Problems with the instructions on this section? Please send comments here.
Programming languages
For C/C++ or FORTRAN see Compilers.
D/GDC
“GDC is a GPL implementation of the D compiler which integrates the open source D front end with GCC.” – GDC Project website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use GDC, use the module command:
$ module load gdc
Once loaded, the paths to GDC’s top level, binaries, include files, and libraries are defined by the environment variables
GDC_DIR, GDC_BIN, GDC_INC, and GDC_LIB, respectively.
See Environmental modules for further information.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with GDC’, you will need to create a submission script similar to:
### gdc_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load gdc
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### gdc_submit.sh STOP ###
where you would replace the resources requested and the GDC command as needed. Save the gdc_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x gdc_submit.sh
Submit the job with:
$ qsub gdc_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Java
Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. For more information, see the Java website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. On the Slurm cluster Java is part of the operating system (no module needed); on the Grid Engine cluster, use module av java to see the installed versions.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
Java is part of the operating system on the Slurm cluster, so no module is needed. Check its version with:
$ java -version
When you run a Java program, set the maximum size of the Java heap (-Xmx) a little below the memory requested for the session, for example:
$ java -Xmx3g -jar myprogram.jar
Please refer to the official Java documentation to learn how to use Java.
On the Grid Engine (legacy) cluster, this software works best when run into an interactive session requested with qrsh with the correct amount of memory specified.
After requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores) you can set up your environment to use Java with the module command:
$ qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use Java, use the module command:
$ module load java
This will load the default Java version. Once loaded, the paths to Java’s top level, binaries, and libraries are defined by the environment variables JAVA_HOME, JAVA_BIN, and JAVA_LIB, respectively.
See Environmental modules for further information.
Use the following command to discover other Java versions:
$ module available java
and load specific versions with the command:
$ module load java/VERSION
where VERSION is replaced by the desired version of Java (e.g. 1.8.0_111).
Please refer to the official Java documentation to learn how to use Java.
To submit a batch job with Java on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -c "java -Xmx3g -jar myprogram.jar"
or create a job script similar to:
### java_submit.job START ###
#!/bin/bash
#SBATCH --job-name=java
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=java.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module list
# Java is part of the operating system (no module needed). Keep the
# Java heap (-Xmx) a little below the memory requested; substitute your program:
java -Xmx3g -jar $HOME/myproject/myprogram.jar
echo "Job $SLURM_JOB_ID ended at $(date)"
### java_submit.job STOP ###
where you would replace the account, the resources requested and the Java command as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate java_submit.job
$ sbatch java_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Java’, you will need to create a submission script similar to:
### java_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=8G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load java
# in the following two lines substitute the command with the
# needed command below:
echo "java -help"
java -help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### java_submit.sh STOP ###
where you would replace the resources requested and the Java command as needed. Save the java_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x java_submit.sh
Submit the job with:
$ qsub java_submit.sh
Please refer to the official Java documentation to learn how to use Java.
References:
Problems with the instructions on this section? Please send comments here.
julia
“The Julia Language - A fresh approach to technical computing.” – julia
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider julia on the Slurm cluster and module av julia on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load julia in your environment with:
$ module purge
$ module load julia/1.11.1
To see the installed versions, use module spider julia. To invoke julia, using the cores requested:
$ julia --threads=$SLURM_CPUS_PER_TASK
Please refer to the julia official documentation to learn how to use this language.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G,arch=intel\* -pe shared 2
You can check the available versions of julia with:
$ module av julia
Load the default version of julia in your environment with:
$ module load julia
To load a different version, issue:
$ module load julia/VERSION
where VERSION is replaced by the desired version of julia.
To invoke julia:
$ julia
Please refer to the julia official documentation to learn how to use this language.
To submit a batch job with julia on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p julia -n julia-script.jl
or create a job script similar to:
### julia_submit.job START ###
#!/bin/bash
#SBATCH --job-name=julia
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=julia.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load julia/1.11.1
module list
# substitute julia-script.jl with your actual julia script (use its full path):
julia --threads=$SLURM_CPUS_PER_TASK $HOME/myproject/julia-script.jl
echo "Job $SLURM_JOB_ID ended at $(date)"
### julia_submit.job STOP ###
where you would replace the account, the resources requested and the julia script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate julia_submit.job
$ sbatch julia_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the julia you will need to create a submission script similar to:
### julia_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load julia
# substitute the julia-script.jl with your actual julia script
# in the two lines below:
echo 'julia julia-script.jl'
julia julia-script.jl
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### julia_submit.sh STOP ###
where you would replace the resources requested and the julia command as needed. Save the julia_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x julia_submit.sh
Submit the job with:
$ qsub julia_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
mono
“Mono is a software platform designed to allow developers to easily create cross platform applications part of the .NET Foundation. Sponsored by Microsoft, Mono is an open source implementation of Microsoft’s .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of cross platform applications.” –Mono Project website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session (e.g., run-time, memory, number of cores, etc. as needed), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use mono, use the module command:
$ module load mono
This will load the default Mono version. Once loaded, the paths to Mono’s top level, include files, and libraries are defined by the environment variables MONO_DIR, MONO_INC, and MONO_LIB, respectively.
See Environmental modules for further information.
Use the following command to discover other Mono versions:
$ module available mono
and load specific versions with the command:
$ module load mono/VERSION
where VERSION is replaced by the desired version of Mono (e.g. 5.10.0).
Please refer to the official Mono documentation to learn how to use Mono.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Mono’, you will need to create a submission script similar to:
### mono_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load mono
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### mono_submit.sh STOP ###
where you would replace the resources requested and the Mono command as needed. Save the mono_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x mono_submit.sh
Submit the job with:
$ qsub mono_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Perl
“Perl is a highly capable, feature-rich programming language with over 30 years of development. Perl runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large scale development projects.” – Perl website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider perl on the Slurm cluster and module av perl on the Grid Engine cluster. A version of Perl that is part of the operating system (/usr/bin/perl) is also available on both clusters without loading a module.
On the Grid Engine (legacy) cluster Perl is also available via the ActivePerl distribution.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load Perl in your environment with:
$ module purge
$ module load perl/5.40.0
To see the installed versions, use module spider perl. To run a Perl script:
$ perl myscript.pl
Please refer to the Perl documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
If you desire to use a version of Perl differen than the default one, you can check the available versions of Perl with:
$ module av perl
Load the default version of Perl in your environment with:
$ module load perl
To load a different version, issue:
$ module load perl/VERSION
where VERSION is replaced by the desired version of Perl.
To invoke Perl:
$ perl &
Please refer to Perl documentation to learn how to use this software Perl documentation.
To submit a batch job with Perl on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p perl -n myscript.pl
or create a job script similar to:
### perl_submit.job START ###
#!/bin/bash
#SBATCH --job-name=perl
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=perl.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load perl/5.40.0
module list
# substitute the Perl script to run below (use its full path):
perl $HOME/myproject/myscript.pl
echo "Job $SLURM_JOB_ID ended at $(date)"
### perl_submit.job STOP ###
where you would replace the account, the resources requested and the Perl script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate perl_submit.job
$ sbatch perl_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Perl you will need to create a submission script similar to:
### Perl_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load perl
# substitute the command to run the needed Perl command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Perl_submit.sh STOP ###
where you would replace the resources requested and the Perl command as needed. Save the Perl_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
chmod u+x Perl_submit.sh
submit the job with:
qsub Perl_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
ActivePerl
“ActivePerl is a distribution of Perl from ActiveState” – ActiveState .
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use ActivePerl, use the module command:
$ module load activeperl
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Affymetrics’ Analysis Power Tools you will need to create a submission script similar to:
### activeperl_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load activeperl
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### activeperl_submit.sh STOP ###
where you would replace the resources requested and the APT command as needed. Save the APT_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x activeperl_submit.sh
submit the job with:
$ qsub activeperl_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
POP-C++
POP-C++ is a comprehensive object-oriented system for developing HPC applications in large, heterogeneous, parallel and distributed computing infrastructures. It consists of a programming suite (language, compiler) and a run-time system for running POP-C++ applications. For more information, see the C++ website.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
To set up your environment to use pop-c++, use the module command:
$ module load pop-c++
See Environmental modules for further information.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with POP-C++’, you will need to create a submission script similar to:
### pop-c++_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load pop-c++
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### pop-c++_submit.sh STOP ###
where you would replace the resources requested and the POP-C++ command as needed. Save the pop-c++_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x pop-c++_submit.sh
Submit the job with:
$ qsub pop-c++_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Python
Python is an interpreted, high-level, general-purpose programming language.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider python on the Slurm cluster and module av python on the Grid Engine cluster. On the Slurm cluster the Python modules are python/3.10.20 and python/3.12.13; the python3 of the operating system (3.9) is not meant for research work.
On the Hoffman2 Cluster python is also available via Mamba.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load a version of Python in your environment with, e.g.:
$ module purge
$ module load python/3.12.13
To see the installed versions, use module spider python. After loading the module, you can start a python shell with:
$ python
To install the Python packages you need, create a Python virtual environment (or a conda environment, see Mamba) rather than using pip install --user: packages installed with --user go to $HOME/.local/lib/pythonX.Y/site-packages, are shared by every Python of the same version, and can break conda environments.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
To see the available version of Python:
$ module available python
To load a particular version of Python into your environment, e.g. version 3.9.6:
$ module load python/3.9.6
After loading the module, you can start a python shell with:
$ python
To check which libraries are already installed issue from within a python shell:
>>> help('modules')
To install libraries in your own $HOME directory issue at the shell command line:
$ pip install <python-package name> --user
do not substitute --user with your username.
The installed package will be stored in $HOME/.local/lib/pythonX.Y/site-packages.
In order to be able to find executables installed via python in your $HOME directory you may need to append the following command to your initialization files (e.g., $HOME/.bashrc) or issue it at the shell prompt:
export PATH=$PATH:$HOME/.local/bin
setenv PATH $PATH:$HOME/.local/bin
To submit a batch job with Python on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p python/3.12.13 -n myscript.py
or create a job script similar to:
### python_submit.job START ###
#!/bin/bash
#SBATCH --job-name=python
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=python.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load python/3.12.13
module list
# substitute the Python script to run below (use its full path):
python3 $HOME/myproject/myscript.py
echo "Job $SLURM_JOB_ID ended at $(date)"
### python_submit.job STOP ###
where you would replace the account, the resources requested and the Python script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate python_submit.job
$ sbatch python_submit.job
To run the script in a Python virtual environment, see Loading a python virtual environment in a job script.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Python’, you will need to create a submission script similar to:
### python_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load python
# in the following two lines substitute the command with the
# needed command below:
echo "python --help"
python --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### python_submit.sh STOP ###
where you would replace the resources requested and the Python command as needed. Save the python_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x python_submit.sh
Submit the job with:
$ qsub python_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Python virtual environments
Python’s venv module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site directories. A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python, and may optionally be isolated from the packages in the base environment, so only those explicitly installed in the virtual environment are available. When used from within a virtual environment, common installation tools such as pip will install Python packages into a virtual environment without needing to be told to do so explicitly.
To create a python virtual environment at a terminal prompt on the Slurm cluster type:
$ srun --time=01:00:00 --mem=10G --pty bash -l # you can modify the resources requested as needed
$ module purge
$ module load python/3.12.13
$ python -m venv $HOME/.virtualenvs/<NAME-OF-VIRT-ENV>
Whenever you use the virtual environment, load the same python module with which you created it. On the Grid Engine (legacy) cluster type instead:
$ qrsh -l h_data=10G # you can modify the resources requested as needed
$ module load python
$ python -m venv $HOME/.virtualenvs/<NAME-OF-VIRT-ENV>
to activate an existing python virtual environment:
$ source $HOME/.virtualenvs/<NAME-OF-VIRT-ENV>/bin/activate
$ source $HOME/.virtualenvs/<NAME-OF-VIRT-ENV>/bin/activate.csh
where <NAME-OF-VIRT-ENV> is the name for your virtual environment. Alternatively you can modify the location of the directory containing the virtual environments to a location (such as a project directory if applicable) where you may have more space. Python virtual environments can also be created withing a project directory and conventionally stored there in a directory called venv or .venv.
Within the vitual environment packages can be installed via pip, to recreate a virtual environment you can generate a requirements.txt file from the existing environment with:
$ pip freeze > requirements.txt
and then use in the new environment:
$ pip install -r requirements.txt
Warning
Once created a python virtual environment cannot be moved or any directory in the path to the virtual environment renamed (since the path to them is hardcoded within them). Should you need to move a virtual environment directory to a new location you will need to generate a requirements.txt file from the existing environment to be moved and then recreate the environment in the new location with the requirements.txt file.
Problems with the instructions on this section? Please send comments here.
Loading a python virtual environment in a job script
On the Slurm cluster, in the job script use:
### python_virt_env_submit.job START ###
#!/bin/bash
#SBATCH --job-name=python_virt_env
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=python_virt_env.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load python/3.12.13
module list
# activate an already existing virtual environment, built with the same python
# module (CHANGE THE NAME & PATH OF THE VIRTUAL ENVIRONMENT AS NEEDED):
source $HOME/.virtualenvs/<NAME-OF-VIRT-ENV>/bin/activate
# substitute the Python script to run below (use its full path):
python $HOME/myproject/myscript.py
echo "Job $SLURM_JOB_ID ended at $(date)"
### python_virt_env_submit.job STOP ###
where you would replace the account, the resources requested, the python module (the one with which you created the virtual environment), the path of the virtual environment and the Python script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate python_virt_env_submit.job
$ sbatch python_virt_env_submit.job
On the Grid Engine (legacy) cluster, in the submission script use:
### python_virt_env_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment (load any needed package):
. /u/local/Modules/default/init/modules.sh
module load python
# To see which versions of python are available use: module av python
# activate an already existing conda environment (CHANGE THE NAME & PATH OF VIRT. ENV. AS NEEDED):
source $HOME/virtualenvs/<NAME-OF-VIRT-ENV>
# in the following two lines substitute the command with the actual command to run:
echo "python --version"
python --version
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### python_python_submit.sh STOP ###
Highlighted code corresponds to part that you may need to modify.
Problems with the instructions on this section? Please send comments here.
Mamba
Mamba is a fast, robust, and cross-platform package manager. It is a drop-in replacement for Conda and uses the same commands and configuration options as conda. Almost any conda commands can be swapped with a mamba command. Mamba provides a version of python.
Note
Available on: the Slurm (production) cluster, as the miniforge module (which provides both conda and mamba), and the Grid Engine (legacy) cluster, as the mamba module. To see the installed versions, use module spider miniforge on the Slurm cluster and module av mamba on the Grid Engine cluster.
On the Slurm cluster, conda and mamba come with the Miniforge distribution: load it with module load miniforge (e.g. module load miniforge/26.5.3-0). Its mamba (version 2) accepts the same commands as conda to create environments and install packages; switch environments with conda activate, which works as soon as the module is loaded (do not run conda init). On the Grid Engine cluster, load the mamba module instead (module load mamba). Environments created with the mamba modules on the Grid Engine cluster may not work on the Slurm cluster: recreate them there from an environment.yml file (conda env export > environment.yml on the Grid Engine cluster, then conda env create -f environment.yml on the Slurm cluster).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load the Miniforge distribution, which provides conda, mamba and a version of python, in your environment with, e.g.:
$ module purge
$ module load miniforge/26.5.3-0
To see the installed versions, use module spider miniforge. The module sets up the conda command, so conda activate works right away: do not run conda init, which adds a block to your ~/.bashrc that every later job inherits. Load the module when you need it, rather than in your ~/.bashrc. To create an environment and activate it:
$ conda create -n MYENV python=3.12 numpy
$ conda activate MYENV
mamba can be used in place of conda for commands such as mamba create and mamba install; use conda activate and conda deactivate to switch environments. To check which libraries are installed in the active environment:
$ conda list
See Mamba environments for more on creating environments.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
To see the available version of Mamba:
$ module available mamba
After loading the module, you can start a python shell with:
$ python
To check which libraries are already installed issue:
$ mamba list
or:
$ mamba list
To submit a batch job with a conda environment on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p miniforge -n myscript.py
or create a job script similar to:
### mamba_python_submit.job START ###
#!/bin/bash
#SBATCH --job-name=mamba_python
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=mamba_python.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load miniforge/26.5.3-0
module list
# activate an already existing conda environment (CHANGE THE NAME OF THE ENVIRONMENT)
# and ignore packages installed with pip install --user:
conda activate MYENV
export PYTHONNOUSERSITE=1
# substitute the Python script to run below (use its full path):
python $HOME/myproject/myscript.py
echo "Job $SLURM_JOB_ID ended at $(date)"
### mamba_python_submit.job STOP ###
where you would replace the account, the resources requested and the environment name and the Python script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate mamba_python_submit.job
$ sbatch mamba_python_submit.job
If you let job.q write the script, edit it to add conda activate MYENV after the module load line.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Python’, you will need to create a submission script similar to:
### mamba_python_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load mamba
# To see which versions of mamba are available use: module av mamba
# in the following two lines substitute the command with the
# needed command below:
echo "python --help"
python --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### mamba_python_submit.sh STOP ###
where you would replace the resources requested and the Python command as needed. Save the python_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
Submit the job with:
$ qsub mamba_python_submit.sh
References:
https://mamba.readthedocs.io/en
Problems with the instructions on this section? Please send comments here.
Mamba environments
The simplest way to install libraries in your own $HOME when using the central mamba distribution is to create a mamba environment:
After loading a version of conda and mamba in your environment, with, for example, on the Slurm cluster:
$ module purge
$ module load miniforge/26.5.3-0
or, on the Grid Engine (legacy) cluster:
$ module load mamba
you can proceed to create a new mamba environment with:
$ mamba create -n MYENVNAME
or to create an environment with a specific version of python use, for example:
$ mamba create -n MYENVNAME python=3.9
where: MYENVNAME is the name of your conda virtual environment.
or to create an environment with a specific package use, for example:
$ mamba create -n MYENVNAME scipy
where: MYENVNAME is the name of your conda virtual environment.
which can also be achieved with:
$ mamba create -n myenv python
$ mamba install -n myenv scipy
to install a certain version of a package:
$ mamba create -n myenv scipy=0.17.3
Environments created with -n are stored in $HOME/.conda/envs, which counts against your $HOME quota. For large environments, use -p with a path in your project directory, e.g. mamba create -p /u/project/<group>/envs/myenv python=3.12, and activate it with conda activate /u/project/<group>/envs/myenv. Avoid $SCRATCH for environments you rely on, as files there that are not used for 14 days are deleted.
Environment creation from yaml files
$ mamba env create -f environment.yml
Installed mamba environments
On the Grid Engine (legacy) cluster, several general use environments for various packages have been centrally installed. On either cluster, to see which environments (yours and the centrally installed ones) are available issue:
$ mamba env list
Loading mamba environments
To load an environment:
$ conda activate ENVNAME
where ENVNAME is the name of the mamba environment. With the mamba modules on the Grid Engine (legacy) cluster you can also use mamba activate ENVNAME. On the Slurm cluster, use conda activate: mamba activate (mamba version 2) fails with Shell not initialized unless you run mamba shell init, which, like conda init, changes your ~/.bashrc and should be avoided.
Loading a mamba environment in a job script
On the Slurm cluster, in the job script use:
### mamba_python_submit.job START ###
#!/bin/bash
#SBATCH --job-name=mamba_python
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=mamba_python.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load miniforge/26.5.3-0
module list
# activate an already existing conda environment (CHANGE THE NAME OF THE ENVIRONMENT)
# and ignore packages installed with pip install --user:
conda activate MYENV
export PYTHONNOUSERSITE=1
# substitute the Python script to run below (use its full path):
python $HOME/myproject/myscript.py
echo "Job $SLURM_JOB_ID ended at $(date)"
### mamba_python_submit.job STOP ###
where you would replace the account, the resources requested, the version of miniforge (use the one with which you created the environment), the environment name and the Python script as needed. export PYTHONNOUSERSITE=1 keeps packages installed with pip install --user in $HOME/.local from overriding the ones in the environment. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate mamba_python_submit.job
$ sbatch mamba_python_submit.job
On the Grid Engine (legacy) cluster, in the submission script use:
### mamba_python_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load mamba
# To see which versions of mamba are available use: module av mamba
# activate an already existing conda environment (CHANGE THE NAME OF THE ENVIRONMENT):
conda activate MYENV
# in the following two lines substitute the command with the actual command to run:
echo "python --version"
python --version
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### mamba_python_submit.sh STOP ###
Highlighted code corresponds to part that you may need to modify.
Problems with the instructions on this section? Please send comments here.
Ruby
Ruby is a high-level and general-purpose programming language. First released in 1995, Ruby has a clean and easy syntax that allows users to learn quickly and easily. It also has similar syntax to those used in C++ and Perl.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed). On the Grid Engine cluster a ruby module is also available (module av ruby).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
use the version of Ruby that is part of the operating system (no module needed). To verify the version of Ruby:
$ ruby --version
To use the interactive Ruby prompt:
$ irb
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
check available versions by entering:
$ module available ruby
To load a particular version, e.g. 1.9.2, enter:
$ module load ruby/1.9.2
To verify the version of Ruby
$ ruby --version
To use the interactive Ruby prompt, e.g.
$ irb
To submit a batch job with Ruby on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -c "ruby myscript.rb"
or create a job script similar to:
### ruby_submit.job START ###
#!/bin/bash
#SBATCH --job-name=ruby
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=ruby.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module list
# Ruby is part of the operating system (no module needed);
# substitute the Ruby script to run below (use its full path):
ruby $HOME/myproject/myscript.rb
echo "Job $SLURM_JOB_ID ended at $(date)"
### ruby_submit.job STOP ###
where you would replace the account, the resources requested and the Ruby script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate ruby_submit.job
$ sbatch ruby_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Ruby’, you will need to create a submission script similar to:
### ruby_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load ruby
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### ruby_submit.sh STOP ###
where you would replace the resources requested and the Ruby command as needed. Save the ruby_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x ruby_submit.sh
Submit the job with:
$ qsub ruby_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Tcl
Tcl is a high-level, general-purpose, interpreted, and dynamic programming language. It was designed with the goal of being very simple but powerful. It usually goes with the Tk extension as Tcl/Tk, and enables a graphical user interface (GUI).
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed). On the Grid Engine cluster a tcl module is also available (module av tcl).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
use the version of Tcl/Tk that is part of the operating system (no module needed). Example of using Tcl interactively:
$ tclsh
% set x 32
32
% expr $x*3
96
On the Grid Engine (legacy) cluster, start by requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
The version of Tcl/Tk provided with the OS shoud suffice for most applications.
Example of using Tcl interactively:
$ tclsh
% set x 32
32
% expr $x*3
96
To submit a batch job with Tcl on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -c "tclsh myscript.tcl"
or create a job script similar to:
### tcl_submit.job START ###
#!/bin/bash
#SBATCH --job-name=tcl
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=tcl.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module list
# Tcl is part of the operating system (no module needed);
# substitute the Tcl script to run below (use its full path):
tclsh $HOME/myproject/myscript.tcl
echo "Job $SLURM_JOB_ID ended at $(date)"
### tcl_submit.job STOP ###
where you would replace the account, the resources requested and the Tcl script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate tcl_submit.job
$ sbatch tcl_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with TCL’, you will need to create a submission script similar to:
### tcl_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load tclsh
# in the following two lines substitute the command with the
# needed command below:
echo "perl --help"
perl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### tcl_submit.sh STOP ###
where you would replace the resources requested and the TCL command as needed. Save the tcl_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x tcl_submit.sh
Submit the job with:
$ qsub tcl_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Programming libraries
ARPACK
“ARPACK is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.” – ARPACK
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Load the ARPACK module which works with the compiler and MPI set as default on the Hoffman2 Cluster (or build your own version of the library against a preferred compiler/MPI):
module load arpack
To link a Fortran program against the serial ARPACK library, use:
ifort -O program.f $ARPACK_HOME/libarpack_LINUX64.a -o program
where program.f is the program you would like to link to the ARPACK library. Examples of programs that use ARPACK can be found in $ARPACK_HOME/EXAMPLES.
To link a Fortran program against the MPI ARPACK library, use:
mpiifort program.f $ARPACK_HOME/parpack_MPI-LINUX64.a $ARPACK_HOME/libarpack_LINUX64.a -o program
where program.f is the program you would like to link to the MPI ARPACK library. Examples of programs that user MPI ARPACK can be found in $ARPACK_HOME/PARPACK/EXAMPLES/MPI.
References:
Problems with the instructions on this section? Please send comments here.
ATLAS
“The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing research effort focusing on applying empirical techniques in order to provide portable performance. At present, it provides C and Fortran77 interfaces to a portably efficient BLAS implementation, as well as a few routines from LAPACK.” –ATLAS website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Although there are versions of ATLAS installed on the Grid Engine (legacy) cluster, we recommend to use the Intel MKL library (available on both clusters) for full BLAS and LAPACK routines which performs best according to our benchmarks. Please check the Intel-MKL library page for how to use the Intel MKL-based BLAS and LAPACK libraries for optimal performance.
Listed below is the information about the old versions of the ATLAS library installed on the Grid Engine (legacy) cluster that we are deprecating to support:
To run ATLAS from a Fortran Program for an ATLAS BLAS routine, enter:
$ ifort pgm.f(90) -L$ATLAS_HOME/lib -lblas -o pgm
Replace pgm.f(90) with the name of the file containing your source code and pgm with the name of the executable to be created.
Set ATLAS_HOME to: /u/local/apps/atlas/current. You can either set an environment variable or replace $ATLAS_HOME in the command shown above.
For an ATLAS LAPACK routine, enter:
$ ifort pgm.f(90) -L$ATLAS_HOME/lib -llapack -lblas -latlas -o pgm
Replace pgm.f(90) with the name of the file containing your source code and pgm with the name of the executable to be created.
Set ATLAS_HOME to: /u/local/apps/atlas/current. You can either set an environment variable or replace $BLAS_HOME in the command shown above.
To run ATLAS from a C Program, replace ifort in the commands shown above to icc.
To use ATLAS from a C++ program, you must declare each function you will call as being extern as in the following example:
extern “C” void sgesv(int *, int *, float *, int *, int *, float *, int *, int * );
Code the function name and the argument list for the function you are calling.
To compile and link, replace ifort in the command with icpc.
References:
Problems with the instructions on this section? Please send comments here.
BLAS
“The BLAS (Basic Linear Algebra Subprograms) are routines that provide standard building blocks for performing basic vector and matrix operations. The Level 1 BLAS perform scalar, vector and vector-vector operations, the Level 2 BLAS perform matrix-vector operations, and the Level 3 BLAS perform matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they are commonly used in the development of high quality linear algebra software, LAPACK for example.” –BLAS website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. We recommend the BLAS routines of Intel MKL (on the Slurm cluster module load intel and then module load mkl; on the Grid Engine cluster module load intel). The reference (Netlib) BLAS library is also part of the operating system on both clusters (link with -lblas, no module needed).
Although there are various versions of BLAS installed on the Hoffman2 Cluster, we recommend to use Intel MKL-based BLAS which performs best according to our benchmarks. Please check the Intel-MKL library page for how to use the Intel MKL-based BLAS library for optimal performance.
Listed below is the information about the old versions of the BLAS libraries installed on the Grid Engine (legacy) cluster that we are deprecating to support:
There are four different libraries that include the Basic Linear Algebra Subprograms (BLAS) routines:
BLAS library from the Netlib Repository |
This library was compiled using the Intel Compiler or other high-performance Fortran compiler that was purchased for the cluster. This library is the simplest one to link to and use. |
ATLAS library |
When this library was built, it automatically optimized its performance for whatever system it was built on, in this case, these routines are optimized for the cluster compute nodes. |
Intel-MKL library |
The Intel-MKL library includes the BLAS routines. The Intel-MKL library performed very well in our benchmarks. |
GNU Scientific Library (GSL) |
For a comparison of these libraries see: BLAS Benchmark. |
For each of the four libraries, the installed locations are:
The BLAS library from the Netlib Repository is installed in:
/u/local/apps/blas/current/The ATLAS library is installed in:
/u/local/apps/atlas/current/The Intel-MKL library is installed in:
/u/local/compilers/intel/current/current/mkl/The GSL library is installed in:
/u/local/apps/gsl/current/
To run BLAS from a Fortran Program, compile and link with the BLAS library from the Netlib Repository:
$ ifort pgm.f -L$BLAS_HOME -lblas
To compile and link with the ATLAS library:
$ ifort pgm.f -L$ATLAS_HOME -lf77blas -latlas
To compile and link with the Intel-MKL library please refer to the Intel MKL page and:
Replace pgm.f(90) with the name of the file containing your source code
Replace pgm with the name of the executable to be created.
Set BLAS_HOME to: /u/local/apps/blas/current
Set ATLAS_HOME to: /u/local/apps/atlas/current
To run BLAS from a C program, use a BLAS routine from GSL. In your program, include the appropriate GSL header files as follows:
$ #include <gsl/gsl_blas.h>
To compile and link enter:
$ CC pgm.c -I$GSL_HOME/include -L$GSL_HOME/lib -lgsl -lgslcblas -lm [-static] -o pgm
Replace CC with either gcc or icc depending on which compiler you want to use.
Replace pgm.c with the name of the file containing your source code
Replace pgm with the name of the executable to be created
Set GSL_HOME to: /u/local/apps/gsl/current
If you omit -static, you will have to set the LD_LIBRARY_PATH environment variable at run time to include $GSL_HOME/lib
To use a BLAS routine from Netlib, ATLAS or Intel-MKL, use BLAS from a C program, and replace ifort with icc and add an _ to the end of the subroutine name. For example, to call sgemm code:
extern void sgemm_( char *, char *, int *, int *, int * float *, float *, int *, float *, int *, float *, float *, int * );
If you use gcc instead of icc, you additionally have to add:
$ -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -lg2c
to the command used to compile and link.
To run BLAS from a C++ program you must declare each BLAS function you will call as being extern as in the following example:
extern “C” void sgemm_( char *, char *, int *, int *, int * float *, float *, int *, float *, int *, float *, float *, int * );
Code the function name (with _ appended) and the argument list for the function you are calling.
To compile and link, replace ifort with icpc.
SGEMM and DGEMM compute, in single and double precision, respectively:
where \(A\) is an \(M\times N\) matrix, \(B\) is an \(N\times K\) matrix, \(C\) is an \(M\times K\) matrix; \(\alpha\) and \(\beta\) are scalars.
In the following test, we use:
All cases were run on a single processor on one of the Hoffman2 Cluster compute nodes. The code is single-threaded and statically linked.
MFLOPS is calculated as:
Versions of BLAS compared: BLAS library from the Netlib Repository, ATLAS library, Intel-MKL library, AMD ACML Library and Goto BLAS.
References:
Problems with the instructions on this section? Please send comments here.
Boost C++
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains more than one hundred individual libraries.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To see the available versions of Boost:
$ module available boost
To load boost into your environment:
$ module load boost/version
where version is the Boost version, e.g. 1_59_0 means Boost version 1.59.0. This
command sets up the environment variables $BOOST_INC and $BOOST_LIB for the
header file path and the library path, respectively.
For exmaple:
module load boost/1_59_0
echo $BOOST_INC
/u/local/apps/boost/1_59_0/gcc-4.4.7/include
echo $BOOST_LIB
/u/local/apps/boost/1_59_0/gcc-4.4.7/lib
References:
Problems with the instructions on this section? Please send comments here.
cuDNN
“The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned implementations for standard routines such as forward and backward convolution, pooling, normalization, and activation layers. “ –NVIDIA CUDA Home Page
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, the cuDNN library can only work with Nvidia CUDA it is also installed in the same library directory where other CUDA libraries are to load this library in your environment you will need to be on GPU node and load the cuda module (please see: Nvidia CUDA).
cuDNN will only work on GPU card with a computing capability 3.0 and up, see GPU access to see the type of cards you can request on the Hoffman2 Cluster and their computing capability.
References:
Problems with the instructions on this section? Please send comments here.
FFTW
“FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). We believe that FFTW, which is free software, should become the FFT library of choice for most applications.” –FFTW website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider fftw on the Slurm cluster and module av fftw on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --cpus-per-task=2 --pty bash -l
load the serial version of FFTW in your environment with:
$ module purge
$ module load fftw/3.3.10-serial
or the version that also includes the MPI library (libfftw3_mpi) with:
$ module purge
$ module load fftw/3.3.10-parallel
Both modules load the intel/2024.1.0 module (compilers and Intel MPI) they were built with, and set the environment variables FFTW_DIR, FFTW_BIN, FFTW_INC and FFTW_LIB for FFTW’s top level, binaries, include files and (static) libraries. As the libraries were built with the Intel compilers, compile and link your program with the Intel compilers, for example:
$ icx myprog.c -I$FFTW_INC -L$FFTW_LIB -lfftw3 -o myprog
$ mpiicx myprog.c -I$FFTW_INC -L$FFTW_LIB -lfftw3_mpi -lfftw3 -o myprog
The double precision FFTW library is also part of the operating system of the compute nodes (no module needed), for use with the GNU compilers: gcc myprog.c -lfftw3 -lm -o myprog.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
To load the default version of fftw into your environment, use the command:
$ module load fftw
Once loaded, your environment variables for PATH and LD_LIBRARY_PATH will be prepended with /u/local/apps/fftw3/3.3.8-gcc/bin and /u/local/apps/fftw3/3.3.8-gcc/lib, respectively, and the FFTW binaries and libraries can thereby be used in the compilation and linking of programs.
Man pages will also be available via a prepending of /u/local/apps/fftw3/3.3.8-gcc/share/man to your environment variable for MANPATH.
References:
Problems with the instructions on this section? Please send comments here.
GNU GSL
“The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.” –GNU GSL website.
Note
Available on: the Slurm (production) cluster, as part of the operating system (no module needed), and the Grid Engine (legacy) cluster, as a module (to see the installed versions, use module av gsl).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
GSL is part of the operating system of the compute nodes, so no module is needed. Check the installed version with:
$ gsl-config --version
and compile and link your program with:
$ gcc myprog.c $(gsl-config --cflags) $(gsl-config --libs) -o myprog
Note
GSL is not available from Fortran.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To load the default version of gsl into your environment, use the command:
$ module load gsl
Once loaded, the path for gsl’s top level, binaries, include files, and
libraries are defined by the environment variables
GSL_DIR, GSL_BIN, GSL_INC, and GSL_LIB, respectively, which
can be used to compile and link your program.
Use the following command to discover other gsl versions:
$ module available gsl
See Environmental modules for further information.
Note
GSL is not available from Fortran.
References:
Problems with the instructions on this section? Please send comments here.
HDF
Hierarchical Data Format (HDF) is a set of file formats (HDF4, HDF5) designed to store and organize large amounts of data. Originally developed at the National Center for Supercomputing Applications, it is supported by The HDF Group, a non-profit corporation whose mission is to ensure continued development of HDF5 technologies and the continued accessibility of data stored in HDF. For more information, see the HDF Group website.
Note
Available on: the Slurm (production) cluster, where HDF5 is part of the operating system (no module needed), and the Grid Engine (legacy) cluster, where HDF4 and HDF5 are modules (to see the installed versions, use module av hdf). HDF4 and HDFView are not available on the Slurm cluster: if you need them there, please request them by opening a ticket.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
HDF5 (with its C, C++, Fortran and high-level libraries) is part of the operating system of the compute nodes, so no module is needed. Compile and link your program with the HDF5 compiler wrappers:
$ h5cc myprog.c -o myprog # C
$ h5c++ myprog.cpp -o myprog # C++
$ h5fc myprog.f90 -o myprog # Fortran 90 (GNU Fortran)
The HDF5 command-line tools, such as h5dump and h5ls, are also available.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To load the default version of HDF5 into your environment, use the command:
$ module load hdf5
Once loaded, the paths to HDF5’s top level, binaries, include files, and
libraries are defined by the environment variables
HDF5_DIR, HDF5_BIN, HDF5_INC, and HDF5_LIB, respectively, which
can be used to compile and link your program.
Use the following command to discover other HDF5 versions:
$ module available hdf5
The related HDFView can also be loaded using the command:
$ module load hdfview
See Environmental modules for further information.
Note
HDF5 cannot be called from Fortran 77.
References:
https://portal.hdfgroup.org/display/HDF5/Learning+the+Basics
https://portal.hdfgroup.org/display/HDF5/Compiling+HDF5+Applications
https://support.hdfgroup.org/products/java/release/download.html
Problems with the instructions on this section? Please send comments here.
LAPACK
LAPACK (“Linear Algebra Package”) is a standard software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. For more information, see the LAPACK website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. We recommend the LAPACK routines of Intel MKL (on the Slurm cluster module load intel and then module load mkl; on the Grid Engine cluster module load intel). The reference (Netlib) LAPACK and BLAS libraries are also part of the operating system on both clusters (link with -llapack -lblas, no module needed).
Although there are various versions of LAPACK installed on the Hoffman2 Cluster, we recommend to use Intel MKL-based LAPACK which performs best according to our benchmarks. Please check the Intel-MKL library page for how to use the Intel MKL-based LAPACK library for optimal performance.
Old versions of LAPACK we no longer support on the Grid Engine (legacy) cluster are listed below.
There are two different libraries on the Grid Engine (legacy) cluster that include the LAPACK routines. These libraries are:
LAPACK library from the Netlib Repository |
This library was compiled using the Intel Compiler or other high-performance Fortran compiler that was purchased for the cluster. This library is the simplest one to link to and use. |
ATLAS library |
ATLAS includes a subset of the LAPACK routines. When this library was built, it automatically optimized its performance for whatever system it was built on, in this case, these routines are optimized for the cluster compute nodes. |
For a comparison of these libraries see: LAPACK Benchmark. See also How to Use the ScaLAPACK Library.
For each of the libraries, the installed locations are:
The LAPACK library from the Netlib Repository is installed in:
/u/local/apps/lapack/currentThe ATLAS library is installed in:
/u/local/apps/atlas/currentThe Intel-MKL library is installed in:
/u/local/compilers/intel/current/current/mkl
To run LAPACK from a Fortran Program, compile and link with the LAPACK library from Netlib by entering:
$ ifort pgm.f -L/u/local/apps/lapack/current -llapack -L/u/local/apps/blas/current -lblas
To compile and link with the ATLAS library, enter:
$ ifort pgm.f -L/u/local/apps/atlas/current/lib -llapack -lf77blas -lcblas -latlas
To compile and link with the Intel-MKL library, please see the Intel MKL page.
Note
Replace pgm.f with the name of the file containing your source code.
To use LAPACK from a C program, replace ifort in the commands above with icc and append an _ to the name of the function you are calling. For example:
$ extern void sgesv_(int *, int *, float *, int *, int *, float *, int *, int * );
Code the function name (with _ appended) and the argument list for the function you are calling.
To compile and link, replace ifort in the command with icpc.
If you are using the LAPACK from the Netlib Repositiory and the icpc compiler, add:
$ -L /u/local/compilers/intel/fce/current/lib -lifcore
to the command you use to compile and link.
SGESV and DGESV solve, in single and double precision, respectively:
where \(A\) is an \(M\times N\) matrix, \(X\) and \(B\) are an \(N\times N\) RHS matrices.
All cases were run on a single processor on one of the Hoffman2 Cluster compute nodes. The code is single-threaded and statically linked.
MFLOPS is calculated as:
Versions of LAPACK compared: LAPACK library from the Netlib Repository, ATLAS library, Intel-MKL library, AMD ACML Library and Goto BLAS.
References:
Problems with the instructions on this section? Please send comments here.
Intel MKL
Intel Math Kernel Library, or Intel MKL, is a library of optimized math routines for science, engineering, and financial applications. Core math functions include BLAS, LAPACK, ScaLAPACK, sparse solvers, fast Fourier transforms, and vector math. For more information, see the Intel MKL website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. On the Slurm cluster, MKL is a module in the Intel oneAPI module tree: load an intel module first (intel/2026.2.0 is loaded by default) and then module load mkl; module spider mkl shows which intel version provides each MKL version. On the Grid Engine cluster, MKL is included in the intel module (see module av intel).
On the Slurm cluster, load Intel MKL in your environment with:
$ module load intel
$ module load mkl
which sets MKLROOT. With the Intel oneAPI compilers, the simplest way to link against MKL is the -qmkl option, for example:
$ icx myprog.c -qmkl -o myprog # threaded MKL
$ ifx myprog.f90 -qmkl=sequential -o myprog # sequential MKL
Run your program on a compute node (see Slurm interactive sessions and Slurm batch jobs). Threaded MKL should use only the cores you requested with --cpus-per-task: if needed, set MKL_NUM_THREADS to $SLURM_CPUS_PER_TASK.
On the Grid Engine (legacy) cluster, Intel MKL is bundled with the Intel Parallel Studio. To use it, load the intel module:
$ module load intel
Once the Intel module is loaded, we recommend users to use the Intel MKL Link Line Advisor to make complex linking schemes for advanced MKL routines.
For example, the image below shows a snapshot to get compiling and linking options for BLAS and LAPACK routines with Intel Compiler 18 to be used in your applications from Intel MKL link Line Advisor:
The instructions below are for the old Intel compilers on the Grid Engine (legacy) cluster. For simple cases, there are several ways to run Intel-MKL from a FORTRAN program. If you wish to compile and link a single threaded BLAS or LAPACK routine with the Intel-MKL library, enter:
$ ifort pgm.f(90) -o pgm-sequential \
$MKLROOT/lib/em64t/libmkl_solver_lp64_sequential.a \
-Wl,--start-group \
$MKLROOT/lib/em64t/libmkl_intel_lp64.a \
$MKLROOT/lib/em64t/libmkl_sequential.a \
$MKLROOT/lib/em64t/libmkl_core.a \
-Wl,--end-group \
-lpthread
To compile and link a multiple threaded BLAS or LAPACK routine with the Intel-MKL library enter:
$ ifort pgm.f(90) -o pgm-omp \
$MKLROOT/lib/em64t/libmkl_solver_lp64.a \
-Wl,--start-group \
$MKLROOT/lib/em64t/libmkl_intel_lp64.a \
$MKLROOT/lib/em64t/libmkl_intel_thread.a \
$MKLROOT/lib/em64t/libmkl_core.a \
-Wl,--end-group \
-openmp \
-lpthread
Then: * Replace pgm.f(90) with the name of the file containing your source code * Replace pgm with the name of the executable to be created * Set MKLROOT /u/local/compilers/intel/current/current/mkl
For other Intel-MKL routines, select the appropriate libraries from the $MKLROOT/lib/em64t directory.
To run Intel-MKL from a C program, replace ifort with icc. For C++ replace ifort with icpc. Note that for C++, you might additionally have to declare any functions you call as being “extern” as in the following example for sgesv:
$ extern "C" void sgesv(int *, int *, float *, int *, int *, float *, int *, int * );
Code the function name and the argument list for the function you are calling.
See the documentation on the Hoffman2 Cluster at /u/local/compilers/intel/current/current/Documentation/en_US/mkl/.
References:
Problems with the instructions on this section? Please send comments here.
NetCDF
NetCDF (Network Common Data Form) is a machine-independent binary data formats as well as libraries to support the creation, access, and sharing of array-oriented scientific data. This format of data and its programming interfaces are originally available for C, C++, Java, and Fortran, but now also available for Python, IDL, MATLAB, R, Ruby, and Perl. NetCDF was currently developed and is maintained at Unidata, which is a part of the University Corporation for AtmosphericResearch (UCAR).
Note
Available on: the Slurm (production) cluster, where the NetCDF C library and utilities are part of the operating system (no module needed), and the Grid Engine (legacy) cluster, where NetCDF is a module (to see the installed versions, use module av netcdf). The NetCDF Fortran and C++ libraries are not yet available on the Slurm cluster: if you need them there, please request them by opening a ticket.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
The NetCDF C library is part of the operating system of the compute nodes, so no module is needed. Check the installed version with:
$ nc-config --version
and compile and link your C program with:
$ gcc code.c $(nc-config --cflags) $(nc-config --libs) -o code
The NetCDF utilities, such as ncdump and ncgen, are also available.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To check available versions:
$ module available netcdf
To load NetCDF:
$ module load netcdf/version
where version is NetCDF’s version. For example, 4.1.3 means the NetCDF
version 4.1.3. The string following version, if any, indicates the compiler
used to build the NetCDF library (e.g. gcc or intel). This command sets up the
environment variables $NETCDF_HOME, $NETCDF_BIN, $NETCDF_INC, and
$NETCDF_LIB for NetCDF’s top-level directory, the binary executable directory,
the header file directory, and the library directory, respectively.
For example:
$ module load netcdf
$ echo $NETCDF_HOME
/u/local/gcc/4.4.4/libs/netcdf/4.1.3
$ echo $NETCDF_BIN
/u/local/gcc/4.4.4/libs/netcdf/4.1.3/bin
$ echo $NETCDF_LIB
/u/local/gcc/4.4.4/libs/netcdf/4.1.3/lib
$ echo $NETCDF_INC
/u/local/gcc/4.4.4/libs/netcdf/4.1.3/include
To compile FORTRAN 90 code with NetCDF:
$ ifort code.f90 -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf
To compile C code with NetCDF:
$ icc code.c -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf -lm
To compile C++ code with NetCDF:
$ icpc code.cpp -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf_c++ -lnetcdf -lm
References:
Problems with the instructions on this section? Please send comments here.
PETSc
PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It supports MPI, and GPUs through CUDA or OpenCL, as well as hybrid MPI-GPU parallelism. PETSc (sometimes called PETSc/Tao) also contains the Tao optimization software library. – PETSc website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Since PETSc has many configurable options, the recommended way to install PETSc is to install a customized version under your home directory by following the installation instructions, and build your application(s) against it. The Hoffman2 Cluster support group has expertise in using PETSc. Please contact Technical support should you have Hoffman2-specific questions about PETSc.
Problems with the instructions on this section? Please send comments here.
ScaLAPACK
“ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines. ScaLAPACK solves dense and banded linear systems, least squares problems, eigenvalue problems, and singular value problems.” –ScaLAPACK website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of Intel MKL (on the Slurm cluster module load intel and then module load mkl; on the Grid Engine cluster module load intel).
The recommended way to use ScaLAPACK is via the Intel MKL, in which ScaLAPACK is built on top the optimized numerical routines available in MKL. To load Intel MKL into the user environment, see Intel MKL.
Once Intel MKL is loaded, use the Intel MKL link line
advisor
to determine the compile and link options. On the Slurm cluster, select Intel MPI as the MPI library (Intel MPI is loaded with the intel module) and run the resulting program with mpirun (see Distributed memory (MPI) jobs).
An example of selecting the MKL link line advisor options associated with Intel compiler 18 is appended below:
The compiler options and the link lines are then used build your application with ScaLAPACK.
References:
Problems with the instructions on this section? Please send comments here.
Trilinos
“The Trilinos Project is a community of developers, users and user-developers focused on collaborative creation of algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems on new and emerging high-performance computing (HPC) architectures.” –Trilinos website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Trilinos now contains more than 50 packages. Most users use only a subset of them. It is recommended to make a customized build under your home or group directory. The Hoffman2 Cluster support group has expertise in using Trilinos. Please contact Technical support if you have Hoffman2-specific Trilinos questions.
Problems with the instructions on this section? Please send comments here.
zlib
“zlib is designed to be a free, general-purpose, legally unencumbered – that is, not covered by any patents – lossless data-compression library for use on virtually any computer hardware and operating system. The zlib data format is itself portable across platforms.” –zlib website
Note
Available on: the Slurm (production) cluster, as part of the operating system (no module needed), and the Grid Engine (legacy) cluster, as a module (to see the installed versions, use module av zlib).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
zlib (library and zlib.h header) is part of the operating system of the compute nodes, so no module is needed. Compile and link your program with:
$ gcc myprog.c -lz -o myprog
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To load the default version of zlib into your environment, use the command:
$ module load zlib
Once loaded, zlib’s top level, include file, and
library directories are defined by the environment variables
ZLIB_DIR, $ZLIB_INC and $ZLIB_LIB, respectively, which
can be used to compile and link your program.
Use the following command to discover other zlib versions:
$ module available zlib
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.
Bioinformatics and biostatistics
Affymetrix - Analysis Power Tools
“The Analysis Power Tools (APT) is a collection of command line programs for analyzing and working with Affymetrix microarray data. These programs are generally focused on CEL file level analysis.” – Affymetrix APT Documentation
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
You can check the available versions of Affymetrics’ Analysis Power Tools with:
$ module av affymetrix
To load the default version of the Affymetrix Analysis Power Tools, issue:
$ module load affymetrix
You can load a different version of Affymetrix Analysis Power Tools in your environment with:
$ module load affymetrix/VERSION
where VERSION is replaced by the desired version of affymetrix.
To get the help menu of apt-probeset-summarize:
$ apt-probeset-summarize --help
To see which Affymetrics’ Analysis Power Tools are available, please refer to the Affymetrics’ Analysis Power Tools documentation.
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Affymetrics’ Analysis Power Tools you will need to create a submission script similar to:
### submit_job.sh START ### #!/bin/bash #$ -cwd # error = Merged with joblog #$ -o joblog.$JOB_ID #$ -j y # Edit the line starting with "#$ -l" to request the appropriate runtime and memory # (or to add any other resource) as needed: #$ -l h_rt=1:00:00,h_data=1G # Add multiple cores/nodes as needed (also edit the parallel environment if needed): #$ -pe shared 1 # Email address to notify #$ -M $USER@mail # Notify when #$ -m bea # echo job info on joblog: echo "Job $JOB_ID started on: " `hostname -s` echo "Job $JOB_ID started on: " `date ` echo " " # load the job environment: . /u/local/Modules/default/init/modules.sh module load affymetrics # substitute the command to run the needed APT command below: echo 'apt-probeset-summarize -a rma-sketch -a plier-mm-sketch -d chip.cdf -o output-dir *.cel' apt-probeset-summarize -a rma-sketch -a plier-mm-sketch -d chip.cdf -o output-dir *.cel # echo job info on joblog: echo "Job $JOB_ID ended on: " `hostname -s` echo "Job $JOB_ID ended on: " `date ` echo " " ### submit_job.sh STOP ###
where you would replace the resources requested and the APT command as needed. Save the APT_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x submit_job.sh
Submit the job with:
$ qsub APT_submit.sh
References:
https://www.affymetrix.com/support/developer/powertools/changelog/index.html
https://www.thermofisher.com/us/en/home/life-science/microarray-analysis/affymetrix.html
Problems with the instructions on this section? Please send comments here.
ANNOVAR
“ANNOVAR is an efficient software tool to utilize update-to-date information to functionally annotate genetic variants detected from diverse genomes (including human genome hg18, hg19, hg38, as well as mouse, worm, fly, yeast and many others).” – ANNOVAR Documentation
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Running ANNOVAR to prepare local annotation databases
Preparation of local annotation databases using ANNOVAR requires downloading databases from outside of the Hoffman2 Cluster. This step should be performed from the Hoffman2 Cluster transfer node (referred to as dtn). The transfer node can be accessed from your local computer via terminal and an ssh client:
$ ssh login_id@dtn.hoffman2.idre.ucla.edu
or, from any node of the Hoffman2 Cluster, with either:
$ ssh dtn1
or:
$ ssh dtn2
From the transfer node load ANNOVAR in your environment:
$ module load annovar
and use the ANNOVAR command to prepare a local annotation database:
$ annotate_variation.pl -downdb [optional arguments] <table-name> <output-directory-name>
On the Grid Engine (legacy) cluster, after requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
you can check the available versions of ANNOVAR with:
$ module av annovar
To load the default version of ANNOVAR, issue:
$ module load annovar
You can load a different version of ANNOVAR in your environment with:
$ module load annovar/VERSION
where VERSION is replaced by the desired version of ANNOVAR.
To use ANNOVAR, invoke any of the needed perl script from within the interactive session. For example, to invoke table_annovar.pl, issue:
$ table_annovar.pl --help
On the Grid Engine (legacy) cluster, to submit a job for batch execution with ANNOVAR, you will need to create a submission script similar to:
### ANNOVAR_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load annovar
# in the following two lines substitute the command with the
# needed ANNOVAR command below:
echo "annotate_variation.pl --help"
annotate_variation.pl --help
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### ANNOVAR_submit.sh STOP ###
where you would replace the resources requested and the ANNOVAR command as needed. Save the ANNOVAR_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x ANNOVAR_submit.sh
Submit the job with:
$ qsub ANNOVAR_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
BAMTools
“A software suite for programmers and end users that facilitates research analysis and data management using BAM files. BamTools provides both the first C++ API publicly available for BAM file support as well as a command-line toolkit.” – BAMTools
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider bamtools on the Slurm cluster and module av bamtools on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load BAMTools in your environment with:
$ module purge
$ module load bamtools
and check that it works with:
$ bamtools --version
$ bamtools help
Please refer to the BAMTools documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of BAMTools with:
$ module av bamtools
Load the default version of BAMTools in your environment with:
$ module load bamtools
To load a different version, issue:
$ module load bamtools/VERSION
where VERSION is replaced by the desired version of BAMTools.
To invoke BAMTools, enter:
$ bamtools &
Please refer to the BAMTools documentation to learn how to use this software.
To submit a batch job with BAMTools on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p bamtools
or create a job script similar to:
### bamtools_submit.job START ###
#!/bin/bash
#SBATCH --job-name=bamtools
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=bamtools.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load bamtools
module list
# substitute the command to run the needed BAMTools command below:
bamtools stats -in $HOME/myproject/input.bam
echo "Job $SLURM_JOB_ID ended at $(date)"
### bamtools_submit.job STOP ###
where you would replace the account, the resources requested and the BAMTools command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate bamtools_submit.job
$ sbatch bamtools_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with BAMTools, you will need to create a submission script similar to:
### bamtools_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load bamtools
# substitute the command to run the needed BAMTools command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### bamtools_submit.sh STOP ###
where you would replace the resources requested and the BAMTools command as needed. Save the BAMTools_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x bamtools_submit.sh
Submit the job with:
$ qsub bamtools_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
BEDtools
“The BEDTools allow a fast and flexible way of comparing large datasets of genomic features. The BEDtools utilities allow one to address common genomics tasks such as finding feature overlaps and computing coverage.” – BEDtools
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider bedtools on the Slurm cluster and module av bedtools on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load BEDtools in your environment with:
$ module purge
$ module load bedtools
and check that it works with:
$ bedtools --version
$ bedtools --help
Please refer to the BEDtools documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of BEDtools with:
$ module av bedtools
Load the default version of BEDtools in your environment with:
$ module load bedtools
To load a different version, issue:
$ module load bedtools/VERSION
where VERSION is replaced by the desired version of BEDtools.
To invoke BEDtools:
$ bedtools &
Please refer to BEDtools documentation to learn how to use this software BEDtools documentation.
To submit a batch job with BEDtools on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p bedtools
or create a job script similar to:
### bedtools_submit.job START ###
#!/bin/bash
#SBATCH --job-name=bedtools
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=bedtools.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load bedtools
module list
# substitute the command to run the needed BEDtools command below:
bedtools intersect -a $HOME/myproject/a.bed -b $HOME/myproject/b.bed > intersect.bed
echo "Job $SLURM_JOB_ID ended at $(date)"
### bedtools_submit.job STOP ###
where you would replace the account, the resources requested and the BEDtools command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate bedtools_submit.job
$ sbatch bedtools_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with BEDtools, you will need to create a submission script similar to:
### BEDtools_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load bedtools
# substitute the command to run the needed BEDtools command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### BEDtools_submit.sh STOP ###
where you would replace the resources requested and the BEDtools command as needed. Save the BEDtools_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x BEDtools_submit.sh
Submit the job with:
$ qsub BEDtools_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Bowtie
“An ultrafast memory-efficient short read aligner. Bowtie helps you visualize your data interactively. No javascript required, you build your dashboard in pure Python. Easy to deploy so you can share results with others.” – Bowtie
Note
Available on: the Slurm (production) cluster (Bowtie 2 only) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider bowtie2 on the Slurm cluster and module av bowtie on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load Bowtie 2 in your environment with:
$ module purge
$ module load bowtie2
and check that it works with:
$ bowtie2 --version
$ bowtie2 --help
Please refer to the Bowtie 2 manual to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Bowtie with:
$ module av bowtie
Load the default version of Bowtie in your environment with:
$ module load bowtie
To load a different version, issue:
$ module load bowtie/VERSION
where VERSION is replaced by the desired version of Bowtie.
To invoke bowtie:
$ bowtie &
Please refer to Bowtie documentation to learn how to use this software.
To submit a batch job with Bowtie 2 on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p bowtie2
or create a job script similar to:
### bowtie2_submit.job START ###
#!/bin/bash
#SBATCH --job-name=bowtie2
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=bowtie2.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load bowtie2
module list
# align with as many threads as cores requested (bowtie2 -p):
bowtie2 -p $SLURM_CPUS_PER_TASK -x $HOME/myproject/index/genome \
-U $HOME/myproject/reads.fq -S reads.sam
echo "Job $SLURM_JOB_ID ended at $(date)"
### bowtie2_submit.job STOP ###
where you would replace the account, the resources requested and the Bowtie 2 command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate bowtie2_submit.job
$ sbatch bowtie2_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Bowtie, you will need to create a submission script similar to:
### Bowtie_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load bowtie
# substitute the command to run the needed Bowtie command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Bowtie_submit.sh STOP ###
where you would replace the resources requested and the Bowtie command as needed. Save the Bowtie_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x Bowtie_submit.sh
Submit the job with:
$ qsub Bowtie_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
BWA
“Burrows-Wheeler Aligner, BWA, is a software package for mapping low-divergent sequences against a large reference genome.” – BWA
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider bwa on the Slurm cluster and module av bwa on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load BWA in your environment with:
$ module purge
$ module load bwa
and check that it works with:
$ bwa
$ bwa mem
Without arguments, bwa prints its version and the list of its commands.
Please refer to the BWA documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of BWA with:
$ module av bwa
Load the default version of BWA in your environment with:
$ module load bwa
To load a different version, issue:
$ module load bwa/VERSION
where VERSION is replaced by the desired version of BWA.
To invoke BWA, enter:
$ bwa &
Please refer to the BWA documentation to learn how to use this software.
To submit a batch job with BWA on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p bwa
or create a job script similar to:
### bwa_submit.job START ###
#!/bin/bash
#SBATCH --job-name=bwa
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=bwa.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load bwa
module list
# align with as many threads as cores requested (bwa mem -t):
bwa mem -t $SLURM_CPUS_PER_TASK $HOME/myproject/ref.fa $HOME/myproject/reads.fq > aln.sam
echo "Job $SLURM_JOB_ID ended at $(date)"
### bwa_submit.job STOP ###
where you would replace the account, the resources requested and the BWA command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate bwa_submit.job
$ sbatch bwa_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with BWA, you will need to create a submission script similar to:
### BWA_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load BWA
# substitute the command to run the needed BWA command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### BWA_submit.sh STOP ###
where you would replace the resources requested and the BWA command as needed. Save the BWA_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x BWA_submit.sh
Submit the job with:
$ qsub BWA_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Cellranger
“Cell Ranger is a set of analysis pipelines that process Chromium single-cell data to align reads, generate feature-barcode matrices, perform clustering and other secondary analysis, and more.” – Cell Ranger
Note
Available on: the Slurm (production) cluster (Cell Ranger 9.0.0) and the Grid Engine (legacy) cluster (Cell Ranger 5.0.1 to 10.1.0, Cell Ranger ARC and ATAC, Space Ranger and Xenium Ranger). To see the installed versions, use module spider cellranger on the Slurm cluster and module av cellranger on the Grid Engine cluster. If you need a version, or one of the other pipelines, that is not yet available on the Slurm cluster, please request it by opening a ticket.
Cell Ranger pipelines need a reference transcriptome (e.g., refdata-gex-GRCh38-2024-A). On the Slurm cluster no references are installed: download the one you need from the 10x Genomics downloads page into your project directory or your scratch directory. Pipelines such as cellranger count need many cores and a lot of memory (at least 64 GB for a human sample), so run them in a batch job and not on a login node.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=02:00:00 --cpus-per-task=4 --mem=16G --pty bash -l
load Cell Ranger in your environment with:
$ module purge
$ module load cellranger/9.0.0
and check that it works with:
$ cellranger --version
$ cellranger testrun --id=check_install
cellranger testrun runs the count pipeline on a small test dataset included with Cell Ranger. Run it from a directory under $SCRATCH, as it writes its output to the directory check_install. To see the pipelines and their options:
$ cellranger --help
$ cellranger count --help
To submit a batch job with Cell Ranger on the Slurm cluster, create a job script similar to:
### cellranger_submit.job START ###
#!/bin/bash
#SBATCH --job-name=cellranger
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=12:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=64G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=cellranger.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cellranger/9.0.0
module list
# run the pipeline with the cores and (a little less than the) memory requested:
cellranger count --id=sample1 \
--transcriptome=/u/scratch/j/joebruin/refdata-gex-GRCh38-2024-A \
--fastqs=/u/scratch/j/joebruin/fastqs \
--sample=sample1 \
--create-bam=true \
--localcores=$SLURM_CPUS_PER_TASK \
--localmem=60
echo "Job $SLURM_JOB_ID ended at $(date)"
### cellranger_submit.job STOP ###
where you would replace the account, the resources requested, the paths to your reference and FASTQ files and the sample name as needed. --localcores and --localmem (in GB) keep Cell Ranger within the cores and memory of the job: set --localmem a few GB below --mem. Cell Ranger writes its results to a directory named after --id, in the directory you submit the job from, so submit it from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate cellranger_submit.job
$ sbatch cellranger_submit.job
job.q can also write the job script for you (job.q -p cellranger, see Building a job script with job.q): give it the full cellranger count ... command line when it asks for the command to run.
On the Grid Engine (legacy) cluster, sample submission scripts are in /u/local/apps/cellranger/:
submit_cellranger_local_mode.shruns a Cell Ranger pipeline in a single jobsubmit_cellranger_cluster_mode.shsubmits the stages of a pipeline as separate jobs
Copy the one you need to a directory in your account, edit the resources requested and the cellranger command, and submit it with, e.g.:
$ cp /u/local/apps/cellranger/submit_cellranger_local_mode.sh .
$ qsub submit_cellranger_local_mode.sh
References for some pipelines (e.g., refdata-gex-GRCh38-2020-A and refdata-gex-mm10-2020-A) are installed in /u/local/apps/cellranger/spaceranger/references_and_datasets/ and /u/local/apps/cellranger/arc-2.0.0/ on the Grid Engine cluster.
References:
https://www.10xgenomics.com/support/software/cell-ranger/latest
https://www.10xgenomics.com/support/software/cell-ranger/downloads
Problems with the instructions on this section? Please send comments here.
Cufflinks
“Cufflinks assembles transcripts, estimates their abundances, and tests for differential expression and regulation in RNA-Seq samples. It accepts aligned RNA-Seq reads and assembles the alignments into a parsimonious set of transcripts. Cufflinks then estimates the relative abundances of these transcripts based on how many reads support each one, taking into account biases in library preparation protocols.” – Cufflinks
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider cufflinks on the Slurm cluster and module av cufflinks on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
load Cufflinks in your environment with:
$ module purge
$ module load cufflinks
and check that it works with:
$ cufflinks
Without arguments, cufflinks prints its version and the list of its options.
Please refer to the Cufflinks documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Cufflinks with:
$ module av cufflinks
Load the default version of Cufflinks in your environment with:
$ module load cufflinks
To load a different version, issue:
$ module load cufflinks/VERSION
where VERSION is replaced by the desired version of Cufflinks.
To invoke Cufflinks:
$ cufflinks &
Please refer to the Cufflinks documentation to learn how to use this software.
To submit a batch job with Cufflinks on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p cufflinks
or create a job script similar to:
### cufflinks_submit.job START ###
#!/bin/bash
#SBATCH --job-name=cufflinks
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=cufflinks.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cufflinks
module list
# run with as many threads as cores requested (cufflinks -p):
cufflinks -p $SLURM_CPUS_PER_TASK -o cufflinks_out $HOME/myproject/accepted_hits.bam
echo "Job $SLURM_JOB_ID ended at $(date)"
### cufflinks_submit.job STOP ###
where you would replace the account, the resources requested and the Cufflinks command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate cufflinks_submit.job
$ sbatch cufflinks_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Cufflinks, you will need to create a submission script similar to:
### Cufflinks_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load Cufflinks
# substitute the command to run the needed Cufflinks command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Cufflinks_submit.sh STOP ###
where you would replace the resources requested and the Cufflinks command as needed. Save the Cufflinks_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x Cufflinks_submit.sh
Submit the job with:
$ qsub Cufflinks_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Galaxy
“Galaxy is an open source, web-based platform for data intensive biomedical research.” –Galaxy website
If you are interested in using the Galaxy server on the Hoffman2 Cluster, please contact Weihong Yan wyan@chem.ucla.edu for authorization.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
References:
Problems with the instructions on this section? Please send comments here.
GATK
“The Genome Analysis Toolkit (GATK) is a set of bioinformatic tools for analyzing high-throughput sequencing (HTS) and variant call format (VCF) data. The toolkit is well established for germline short variant discovery from whole genome and exome sequencing data. GATK4 expands functionality into copy number and somatic analyses and offers pipeline scripts for workflows. Version 4 (GATK4) is open-source at https://github.com/broadinstitute/gatk.” – GATK
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider gatk on the Slurm cluster and module av gatk on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=8G --pty bash -l
load GATK in your environment with:
$ module purge
$ module load gatk
and check that it works with:
$ gatk --version
$ gatk --list
Please refer to the GATK documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of GATK with:
$ module av gatk
Load the default version of GATK in your environment with:
$ module load gatk
To load a different version, issue:
$ module load gatk/VERSION
where VERSION is replaced by the desired version of GATK.
To invoke GATK, enter:
$ gatk &
Please refer to the GATK documentation to learn how to use this software.
To submit a batch job with GATK on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p gatk
or create a job script similar to:
### gatk_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gatk
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gatk.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load gatk
module list
# keep the Java heap (-Xmx) a little below the memory requested:
gatk --java-options "-Xmx3g" HaplotypeCaller -R $HOME/myproject/ref.fasta \
-I $HOME/myproject/input.bam -O output.vcf.gz
echo "Job $SLURM_JOB_ID ended at $(date)"
### gatk_submit.job STOP ###
where you would replace the account, the resources requested and the GATK command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate gatk_submit.job
$ sbatch gatk_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with GATK, you will need to create a submission script similar to:
### gatk_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load gatk
# substitute the command to run the needed gatk command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### gatk_submit.sh STOP ###
where you would replace the resources requested and the gatk command as needed. Save the gatk_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x gatk_submit.sh
Submit the job with:
$ qsub gatk_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
IMPUTE2
“IMPUTE version 2 (also known as IMPUTE2) is a genotype imputation and haplotype phasing program based on ideas from Howie et al. 2009:
Howie, P. Donnelly, and J. Marchini (2009) A flexible and accurate genotype imputation method for the next generation of genome-wide association studies. PLoS Genetics 5(6): e1000529 [Open Access Article] [Supplementary Material]”
– IMPUTE 2 documentation website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider impute on the Slurm cluster and module av impute on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load IMPUTE2 in your environment with:
$ module purge
$ module load impute
and check that it works with:
$ impute2
Without arguments, impute2 prints its version and a short usage message.
Please refer to the IMPUTE2 documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of IMPUTE with:
$ module av impute
Load the default version of IMPUTE in your environment with:
$ module load impute
To load a different version, issue:
$ module load impute/VERSION
where VERSION is replaced by the desired version of IMPUTE.
To invoke IMPUTE:
$ impute &
Please refer to the IMPUTE documentation to learn how to use this software.
To submit a batch job with IMPUTE2 on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p impute
or create a job script similar to:
### impute2_submit.job START ###
#!/bin/bash
#SBATCH --job-name=impute2
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=impute2.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load impute
module list
# substitute the command to run the needed IMPUTE2 command below:
impute2 -m $HOME/myproject/genetic_map.txt -h $HOME/myproject/haplotypes.txt \
-l $HOME/myproject/legend.txt -g $HOME/myproject/genotypes.txt \
-int 1 5000000 -Ne 20000 -o impute2_out
echo "Job $SLURM_JOB_ID ended at $(date)"
### impute2_submit.job STOP ###
where you would replace the account, the resources requested and the IMPUTE2 command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate impute2_submit.job
$ sbatch impute2_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with IMPUTE, you will need to create a submission script similar to:
### impute_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load impute
# substitute the command to run the needed impute command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### impute_submit.sh STOP ###
where you would replace the resources requested and the IMPUTE command as needed. Save the impute_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x impute_submit.sh
Submit the job with:
$ qsub impute_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
InsPecT
“A Computational Tool to Infer mRNA Synthesis, Processing and Degradation Dynamics From RNA- And 4sU-seq Time Course Experiments” – Inspect
Warning
Inspect is currently not loaded on the Hoffman2 Cluster.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Inspect with:
$ module av inspect
Load the default version of Inspect in your environment with:
$ module load inspect
To load a different version, issue:
$ module load inspect/VERSION
where VERSION is replaced by the desired version of Inspect.
To invoke Inspect:
$ inspect &
Please refer to the Inspect documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Inspect, you will need to create a submission script similar to:
### Inspect_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load Inspect
# substitute the command to run the needed Inspect command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Inspect_submit.sh STOP ###
where you would replace the resources requested and the Inspect command as needed. Save the Inspect_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x inspect_submit.sh
Submit the job with:
$ qsub Inspect_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
MAQ
“Maq is a software that builds mapping assemblies from short reads generated by the next-generation sequencing machines. It is particularly designed for Illumina-Solexa 1G Genetic Analyzer, and has a preliminary functionality to handle AB SOLiD data.” – maq
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Maq with:
$ module av maq
Load the default version of maq in your environment with:
$ module load maq
To load a different version, issue:
$ module load maq/VERSION
where VERSION is replaced by the desired version of Maq.
To invoke maq:
$ maq &
Please refer to the Maq documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Maq, you will need to create a submission script similar to:
### maq_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load maq
# substitute the command to run the needed maq command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### maq_submit.sh STOP ###
where you would replace the resources requested and the Maq command as needed. Save the maq_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x maq_submit.sh
Submit the job with:
$ qsub maq_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Picard Tools
“Picard is a set of command line tools for manipulating high-throughput sequencing (HTS) data and formats such as SAM/BAM/CRAM and VCF” – Picard Tools
Note
Available on: the Slurm (production) cluster (module picard) and the Grid Engine (legacy) cluster (module picard_tools). To see the installed versions, use module spider picard on the Slurm cluster and module av picard_tools on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=8G --pty bash -l
load Picard Tools in your environment with:
$ module purge
$ module load picard
and check that it works with:
$ java -jar $PICARD -h
This lists the available tools. The module sets $PICARD to the Picard jar file, so run any tool with java [jvm-args] -jar $PICARD <PicardToolName> [options] (most tools run in 2 GB of Java heap, -Xmx2g).
Please refer to the Picard Tools documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=4G -pe shared 1
you can check the available versions of Picard Tools with:
$ module av picard_tools
Load the default version of Picard Tools in your environment with:
$ module load picard_tools
To load a different version, if available, issue:
$ module load picard_tools/VERSION
where VERSION is replaced by the desired version of Picard Tools.
To run Picard Tools at the shell prompt issue:
$ java [jvm-args] -jar $PICARD <PicardToolName> [OPTION1=value1] [OPTION2=value2] [...]
where:
<PicardToolName>is one of the tools available in the Picard toolkit[OPTION1=value1]key-value pairs are standard options relative to the particular<PicardToolName>[jvm-args]are java arguments (most of the commands are designed to run in 2GB of JVM, so it is recommended using the JVM argument-Xmx2g)
To see a list of available <PicardToolName> you can issue:
$ java -jar $PICARD -h
to see a list of options (i.e., [OPTION1=value1]) for each <PicardToolName> you can issue:
$ java -jar $PICARD <PicardToolName> -h
to see a full list of java options issue:
$ java -h
and to see the list of java options issue:
$ java -X
Please refer to the Picard Tools documentation to learn how to use this software.
To submit a batch job with Picard Tools on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p picard
or create a job script similar to:
### picard_submit.job START ###
#!/bin/bash
#SBATCH --job-name=picard
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=picard.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load picard
module list
# keep the Java heap (-Xmx) a little below the memory requested:
java -Xmx3g -jar $PICARD ValidateSamFile -I $HOME/myproject/input.bam -MODE SUMMARY
echo "Job $SLURM_JOB_ID ended at $(date)"
### picard_submit.job STOP ###
where you would replace the account, the resources requested and the Picard Tools command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate picard_submit.job
$ sbatch picard_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Picard Tools, you will need to create a submission script similar to:
### picard_tools_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=2G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load picard_tools
# substitute the command to run the needed Picard Tools command below:
echo 'java [jvm-args] -jar $PICARD <PicardToolName> [OPTION1=value1] [OPTION2=value2] [...]'
java [jvm-args] -jar $PICARD <PicardToolName> [OPTION1=value1] [OPTION2=value2] [...]
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### picard_tools_submit.sh STOP ###
where you would replace the resources requested (-l h_rt=1:00:00,h_data=2G and -pe shared 1) and the Picard Tools command (java [jvm-args] -jar $PICARD ...) as needed. Save the picard_tools_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x picard_tools_submit.sh
submit the job with:
$ qsub picard_tools_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
PLINK
“PLINK is a free, open-source whole genome association analysis toolset, designed to perform a range of basic, large-scale analyses in a computationally efficient manner.” – PLINK
Note
Available on: the Slurm (production) cluster (PLINK 1.9) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider plink on the Slurm cluster and module av plink on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load PLINK in your environment with:
$ module purge
$ module load plink
and check that it works with:
$ plink --version
$ plink --help
Please refer to the PLINK 1.9 documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of PLINK with:
$ module av plink
Load the default version of PLINK in your environment with:
$ module load plink
To load a different version, issue:
$ module load plink/VERSION
where VERSION is replaced by the desired version of PLINK.
To invoke PLINK:
$ plink &
Enter the PLINK command with any arguments. For example:
$ plink -ped test.ped --map test.map --maf 0.05 --assoc
where test.ped and test.map are your ped and map files.
$ java -jar /u/local/apps/plink/1.06/gPLINK2.jar
To run PLINK Interactively with R and Rserve, click R-plugins for details and examples.
If you need to use the functionalities of the statistical package R with PLINK, first use qrsh to obtain an interactive compute node, and load PLINK into your environment.
$ Start Rserve
$ module load R
$ R CMD Rserve
Rserve will run daemonized as a server. Verify it is running with
$ ps aux | grep Rserve
Please remember to kill the Rserve process when is no longer needed. Get the process ID from the command ps aux | grep Rserve and then enter kill pid where pid is the process ID.
To change the directory where your data to be analyzed is located, enter:
$ cd mydir
Enter the PLINK command with any arguments:
$ plink arguments
After you finish, kill the Rserve daemon on the same node where you started it before you exit your qrsh session. To do so, enter:
$ ps aux | grep Rserve
$ kill pid
where pid is the process ID of your Rserve process.
Please refer to the PLINK documentation to learn how to use this software.
To submit a batch job with PLINK on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p plink
or create a job script similar to:
### plink_submit.job START ###
#!/bin/bash
#SBATCH --job-name=plink
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=plink.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load plink
module list
# substitute the command to run the needed PLINK command below:
plink --ped $HOME/myproject/test.ped --map $HOME/myproject/test.map \
--maf 0.05 --assoc --threads $SLURM_CPUS_PER_TASK --out test_assoc
echo "Job $SLURM_JOB_ID ended at $(date)"
### plink_submit.job STOP ###
where you would replace the account, the resources requested and the PLINK command (and the paths to your input files) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate plink_submit.job
$ sbatch plink_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with PLINK, you will need to create a submission script similar to:
### plink_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load plink
# substitute the command to run the needed plink command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### plink_submit.sh STOP ###
where you would replace the resources requested and the PLINK command as needed. Save the plink_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x plink_submit.sh
Submit the job with:
$ qsub plink_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
SAMtools
“SAM (Sequence Alignment/Map) is a flexible generic format for storing nucleotide sequence alignment. SAM tools provide efficient utilities for manipulating alignments in the SAM and Bam formats.” – SAMtools
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider samtools on the Slurm cluster and module av samtools on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load SAMtools in your environment with:
$ module purge
$ module load samtools
and check that it works with:
$ samtools --version
$ samtools help
Please refer to the SAMtools documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of SAMtools with:
$ module av samtools
Load the default version of SAMtools in your environment with:
$ module load samtools
To load a different version, issue:
$ module load samtools/VERSION
where VERSION is replaced by the desired version of SAMtools.
To invoke SAMtools:
$ samtools &
Please refer to the SAMtools documentation to learn how to use this software.
To submit a batch job with SAMtools on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p samtools
or create a job script similar to:
### samtools_submit.job START ###
#!/bin/bash
#SBATCH --job-name=samtools
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=samtools.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load samtools
module list
# substitute the command to run the needed SAMtools command below:
samtools --version
echo "Job $SLURM_JOB_ID ended at $(date)"
### samtools_submit.job STOP ###
where you would replace the account, the resources requested and the SAMtools command as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate samtools_submit.job
$ sbatch samtools_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with SAMtools you will need to create a submission script similar to:
### samtools_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load samtools
# substitute the command to run the needed SAMtools command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### SAMtools_submit.sh STOP ###
where you would replace the resources requested and the SAMtools command as needed. Save the SAMtools_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x samtools_submit.sh
Submit the job with:
$ qsub samtools_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
SOLAR
“SOLAR-Eclipse is an extensive, flexible software package for genetic variance components analysis, including linkage analysis, quantitative genetic analysis, SNP association analysis (QTN and QTLD), and covariate screening. Operations are included for calculation of marker-specific or multipoint identity-by-descent (IBD) matrices in pedigrees of arbitrary size and complexity, and for linkage analysis of multiple quantitative traits and/or discrete traits which may involve multiple loci (oligogenic analysis), dominance effects, household effects, and interactions. Additional features include functionality for mega and meta-genetic analyses where data from diverse cohorts can be pooled to improve statistical significance.” – SOLAR
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of SOLAR with:
$ module av solar
Load the default version of SOLAR in your environment with:
$ module load solar
To load a different version, issue:
$ module load solar/VERSION
where VERSION is replaced by the desired version of SOLAR.
To invoke solar:
$ solar &
Please refer to the SOLAR documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution when running SOLAR, you will need to create a submission script similar to:
### solar_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load solar
# substitute the command to run the needed solar command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### solar_submit.sh STOP ###
where you would replace the resources requested and the solar command as needed. Save the solar_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x solar_submit.sh
submit the job with:
$ qsub solar_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
TopHat
“TopHat is a fast splice junction mapper for RNA-Seq reads. It aligns RNA-Seq reads to mammalian-sized genomes using the ultra high-throughput short read aligner Bowtie, and then analyzes the mapping results to identify splice junctions between exons.” – TopHat
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of TopHat with:
$ module av tophat
Load the default version of TopHat in your environment with:
$ module load tophat
To load a different version, issue:
$ module load tophat/VERSION
where VERSION is replaced by the desired version of TopHat.
To invoke TopHat:
$ tophat &
Please refer to the TopHat documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with TopHat, you will need to create a submission script similar to:
### tophat_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load tophat
# substitute the command to run the needed tophat command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### tophat_submit.sh STOP ###
where you would replace the resources requested and the TopHat command as needed. Save the tophat_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x tophat_submit.sh
Submit the job with:
$ qsub tophat_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
TreeMix
“TreeMix is a method for inferring the patterns of population splits and mixtures in the history of a set of populations.” – TreeMix
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of TreeMix with:
$ module av treemix
Load the default version of TreeMix in your environment with:
$ module load treemix
To load a different version, issue:
$ module load treemix/VERSION
where VERSION is replaced by the desired version of TreeMix.
To invoke TreeMix:
$ treemix &
Please refer to the TreeMix documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with TreeMix, you will need to create a submission script similar to:
### treemix_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load treemix
# substitute the command to run the needed TreeMix command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### treemix_submit.sh STOP ###
where you would replace the resources requested and the TreeMix command as needed. Save the treemix_submit.sh script in a location on your account from which you would like to submit your job. Mark the script as an executable script with:
$ chmod u+x treemix_submit.sh
Submit the job with:
$ qsub treemix_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
VEGAS
“Versatile Gene-based Association Study” – VEGAS
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of VEGAS with:
$ module av vegas
Load the default version of VEGAS in your environment with:
$ module load vegas
To load a different version, issue:
$ module load vegas/VERSION
where VERSION is replaced by the desired version of VEGAS.
To invoke VEGAS:
$ vegas &
Please refer to VEGAS documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with VEGAS, you will need to create a submission script similar to:
### VEGAS_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load VEGAS
# substitute the command to run the needed VEGAS command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### VEGAS_submit.sh STOP ###
where you would replace the resources requested and the VEGAS command as needed. Save the vegas_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x vegas_submit.sh
Submit the job with:
$ qsub vegas_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
Chemistry and chemical engineering
Amber
“Amber is the collective name for a suite of programs that allow users to carry out molecular dynamics simulations, particularly on biomolecules.” – Amber
Note
Available on: the Slurm (production) cluster (Amber 24 GPU build only, amber/24_GPU, which needs module load cuda/12.8 first) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider amber on the Slurm cluster and module av amber on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with one GPU (see Requesting GPUs with Slurm):
$ srun --time=01:00:00 --mem=8G --gres=gpu:1 --pty bash -l
load Amber in your environment with:
$ module purge
$ module load cuda/12.8
$ module load amber/24_GPU
The amber/24_GPU module is only visible after module load cuda/12.8. It loads its own Intel MPI (intel/2024.1.0) and Python, and sets $AMBERHOME (AmberTools) and $PMEMDHOME (pmemd). To check the version of sander and of the GPU version of pmemd issue:
$ sander --version
$ pmemd.cuda --version
Please refer to Amber documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Amber with:
$ module av amber
Load the default version of Amber in your environment with:
$ module load amber
To load a different version, issue:
$ module load amber/VERSION
where VERSION is replaced by the desired version of Amber.
To invoke one of the Amber executable, e.g. to check the version of sander issue:
$ sander --version
Please refer to Amber documentation to learn how to use this software.
To submit a batch job with Amber on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p amber/24_GPU -g 1
or create a job script similar to (the example below runs the GPU version of pmemd, pmemd.cuda, on a restart job for a water box from run 33 to 34, with the input files in $HOME/myproject):
### amber_submit.job START ###
#!/bin/bash
#SBATCH --job-name=amber
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores, memory and GPUs as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
#SBATCH --gres=gpu:1
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=amber.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cuda/12.8
module load amber/24_GPU
module list
# substitute the command to run the needed Amber command below:
cd $HOME/myproject
pmemd.cuda -O -i prod.in -c prod-33.rec -p water864.parm7 \
-o prod-34.out -e prod-34.mden -inf prod-34.info \
-r prod-34.rec -v prod-34.vel -x prod-34.crd
echo "Job $SLURM_JOB_ID ended at $(date)"
### amber_submit.job STOP ###
where you would replace the account, the resources requested and the Amber command as needed (see Requesting GPUs with Slurm to select a GPU type). To run on CPUs only instead, remove the --gres=gpu:1 line, request the number of MPI processes with --ntasks (see Distributed memory (MPI) jobs) and start pmemd.MPI (or sander.MPI) with mpirun (never with srun), e.g. mpirun pmemd.MPI -O -i prod.in .... Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate amber_submit.job
$ sbatch amber_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Amber, you will need to create a submission script similar to (the example below is relative to running sander on a restart job for a water box from run 33 to 34):
### amber_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe dc* 30
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load amber
export AMBER_HOME=$AMBERHOME
# substitute the command to run the needed Amber command below:
/usr/bin/time -v `which mpirun` -n $NSLOTS $AMBERHOME/bin/sander -O \
-i ./prod.in \
-c ./prod-33.rec \
-p ./water864.parm7 \
\
\
\
\
-o ./prod-34.out \
\
\
-e ./prod-34.mden \
-inf prod-34.info \
\
\
\
-r prod-34.rec \
\
-v prod-34.vel \
\
\
\
\
-x prod-34.crd \
>& amber.output.$JOB_ID
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Amber_submit.sh STOP ###
where you would replace the resources requested and the Amber command as needed. Save the amber_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x amber_submit.sh
Submit the job with:
$ qsub amber_submit.sh
Please refer to Amber documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
CP2K
“CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems.” – CP2K
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of CP2K with:
$ module av cp2k
Load the default version of CP2K in your environment with:
$ module load cp2k
To invoke CP2K:
$ cp2k.popt --version
Please refer to CP2K documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the CP2K you will need to create a submission script similar to:
### cp2k_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe dc* 30
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load cp2k
# substitute the command to run the needed cp2k command below:
time -v `which mpirun` -np $NSLOTS \
cp2k.popt CP2K.inp >& CP2K.output.$JOB_ID
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### cp2k_submit.sh STOP ###
where you would replace the resources requested and the CP2K command as needed. Save the cp2k_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x cp2k_submit.sh
Submit the job with:
$ qsub cp2k_submit.sh
Please refer to CP2K documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
CPMD
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Coming soon
This section is under construction. Please call again soon!
Gaussian
“Gaussian is a general purpose computational chemistry software package initially released in 1970 by John Pople and his research group at Carnegie Mellon University as Gaussian 70.” – Gaussian
Note
Available on: the Slurm (production) cluster (Gaussian 16 C.02 only) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider gaussian on the Slurm cluster and module av gaussian on the Grid Engine cluster.
Important
By contractual agreement with Gaussian, Inc., only authorized members of the UCLA community can use Gaussian. To request to be authorized to use Gaussian on the Hoffman2 Cluster you will need to perform the following two these actions:
navigate to the SIM account management portal and in the search bar below Request resource for your account type gaussian and press the adjacent REQUESTME button
Gaussian 16 is installed on the Slurm cluster in three builds, which must match the CPU of the compute node where they run: gaussian/g16c02_avx2 (nodes with AVX2, most nodes), gaussian/g16c02_avx (older Intel nodes with AVX only) and gaussian/g16c02_sse4. After requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --cpus-per-task=4 --mem=16G --pty bash -l
check whether the node supports AVX2 (if the command prints nothing, use the avx build, or the sse4 build if grep -w avx /proc/cpuinfo also prints nothing):
$ grep -m1 -ow avx2 /proc/cpuinfo
and load the matching build of Gaussian in your environment, e.g.:
$ module purge
$ module load gaussian/g16c02_avx2
Then run Gaussian on an input file with (set %nprocshared in the input file to the number of cores requested):
$ g16 < input.com > input.out
GaussView can be used to prepare inputs or visualize outputs. Long calculations are better run as batch jobs (see the Slurm batch tab).
Please refer to Gaussian documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, GaussView can be used to prepare inputs or visualize outputs. While GaussView can also be used to submit on the local node Gaussian jobs, it is preferable to submit Gaussian batch jobs via a submission script as described in the GE batch tab.
Please refer to Gaussian documentation to learn how to use this software.
To submit a batch job with Gaussian on the Slurm cluster, create a job script similar to the one below, which loads the Gaussian build that matches the CPU of the node the job lands on. (job.q -p gaussian/g16c02_avx2 can also write a job script for you, see Building a job script with job.q, but it always loads the AVX2 build, which does not run on the older nodes without AVX2.)
### gaussian_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gaussian
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed
# (set %nprocshared in your input file to the value of --cpus-per-task):
#SBATCH --time=02:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=5G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gaussian.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment, picking the Gaussian build that matches the CPU
# of the node the job runs on:
module purge
if grep -qw avx2 /proc/cpuinfo; then
module load gaussian/g16c02_avx2
elif grep -qw avx /proc/cpuinfo; then
module load gaussian/g16c02_avx
else
module load gaussian/g16c02_sse4
fi
module list
# use the job's node-local scratch directory for the Gaussian scratch files:
export GAUSS_SCRDIR=$TMPDIR
echo "GAUSS_SCRDIR=$GAUSS_SCRDIR"
# substitute the name of your Gaussian input file below:
/usr/bin/time -v g16 < $HOME/myproject/input.com > $HOME/myproject/input.out
echo "Job $SLURM_JOB_ID ended at $(date)"
### gaussian_submit.job STOP ###
Gaussian runs on the cores of one node: set %nprocshared in your input file to the value of --cpus-per-task (e.g. %nprocshared=8) and keep %Mem below the memory requested (--cpus-per-task times --mem-per-cpu; e.g. %Mem=36GB for 8 cores with 5G each). The scratch files go to the job’s node-local $TMPDIR, which is removed when the job ends. Replace the account, the resources requested and the input and output file names as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate gaussian_submit.job
$ sbatch gaussian_submit.job
On the Grid Engine (legacy) cluster, to submit Gaussian as a batch job you will need a submission script, a sample is given below. Please refer to Gaussian documentation to learn how to use this software. Some general directions on values to use in the Route Section of your Gaussian input file are given here:
In order for Gaussian to make use of your job’s memory allocation, your input file may include a %Mem instruction for dynamic memory. The default value for %Mem is 256MB or 32MW (mega-words) per core.
The %Mem value should be less than the memory per core that you request for your job. We recommend, for example, for a job requesting 1024MB per core enter:
%Mem=800MB
For jobs requesting 4096 MB per core, enter:
%Mem=3800MB
Modify the default %Mem value only if needed. A value that is too large may decrease the job’s performance instead of improving it.
If using Gaussian across multiple cores on the same compute node make sure to modify the Route Section of your job so that the %nprocshared directive is set to the same number of cores that you will request via the scheduler directive -pe shared N, that is, if for example requesting 36 cores add to your Gaussian input Route Section the line:
%nprocshared=36
accordingly you will need to make sure that your submission script contains the line:
#$ -pe shared 36
or submit your script with the command:
$ qsub -pe shared 36 -N YOUR_GAUSSIAN_INPUT_FILE_NAME submit_gaussian.sh
where YOUR_GAUSSIAN_INPUT_FILE_NAME is the name of your Gaussian input file and submit_gaussian.sh is a submission script as the one given below:
### submit_gaussian.sh START ###
###################################################################################################
# THIS SCRIPT ASSUMES THAT YOU WILL SUBMIT IT AS FOLLOWS:
# qsub -N YOUR_GAUSSIAN_INPUT_FILE_NAME submit_gaussian.sh
# YOU CAN MODIFY RESOURCES BELOW OR MODIFY THEM AT SUBMISSION, E.G.:
# qsub -N YOUR_GAUSSIAN_INPUT_FILE_NAME -l h_data=8G,h_rt=24:00:00 -pe shared 8 submit_gaussian.sh
# MAKE SURE THAT YOUR INPUT FILE PROLOG HAS A LINE:
# %nprocshared=8
# WITH THE SAME (OR LESS) NUMBER OF CORES REQUESTED (I.E.: -pe shared 8)
#!/bin/bash
#$ -cwd
#$ -o $JOB_NAME.joblog.$JOB_ID
#$ -j y
#$ -M $USER@mail
#$ -m bea
# CHANGE THE RESOURCES BELOW AS NEEDED:
#$ -l h_data=5G,h_rt=2:00:00,arch=intel-[Eg][5o][l-]*
# CHANGE THE NUMBER OF CORES AS NEEDED:
#$ -pe shared 36
###################################################################################################
# YOU GENERALLY WILL NOT NEED TO MODIFY THE LINES BELOW:
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# set job environment and GAUSS_SCRDIR variable
. /u/local/Modules/default/init/modules.sh
module load gaussian
export GAUSS_SCRDIR=$TMPDIR
# echo in joblog
module li
echo "GAUSS_SCRDIR=$GAUSS_SCRDIR"
echo " "
echo "/usr/bin/time -v $g16root/g16 < ${JOB_NAME%.*}.com > ${JOB_NAME%.*}.out"
/usr/bin/time -v $g16root/g16 < ${JOB_NAME%.*}.com > ${JOB_NAME%.*}.out
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
echo "Input file START:"
cat ${JOB_NAME%.*}.com
echo "END of input file"
echo " "
### submit_gaussian.sh STOP ###
where you would replace the resources requested and the Gaussian command as needed. Save the submit_gaussian.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x submit_gaussian.sh
Submit the job with:
$ qsub -N submit_gaussian.sh
For older versions of the software you can use:
$ # general submission
$ g09.q # or: gaussian09.q
$ # general serial submission
$ g09.q.serial # or: gaussian09.q.serial
$ #Runs on multiple cpus on a single node:
$ g09.q.multithread # or: gaussian09.q.multithread
$ #Runs on multiple cpus on multiple whole nodes:
$ g09.q.parallel # or: gaussian09.q.parallel
Note that if you are using g09.q.parallel, your input file should not contain %NProcShared or %LindaWorkers, or %NProc or %NProcLinda instructions specifying the number of processors to be used, or the nodes you job should run on. Your job will request any needed processors at runtime.
Please refer to Gaussian documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
GaussView
GaussView is a graphical user to Gaussian. GaussView
Note
Available on: the Slurm (production) cluster (GaussView 6.1.1 only) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider gaussview on the Slurm cluster and module av gaussview on the Grid Engine cluster.
Important
By contractual agreement with Gaussian, Inc., only authorized members of the UCLA community can use Gaussian. To request to be authorized to use Gaussian on the Hoffman2 Cluster you will need to perform the following two these actions:
navigate to the SIM account management portal and in the search bar below Request resource for your account type gaussian and press the adjacent REQUESTME button
Note
To open the graphical user interface (GUI) of GaussView on the Slurm cluster, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH with X11 forwarding enabled (see Opening GUI applications from a Slurm interactive session).
GaussView will let you submit a com file to Gaussian. When you close your GaussView session, any Gaussian process that is still running will be aborted, so run long calculations as Gaussian batch jobs instead.
Start an interactive session on a compute node with X11 forwarding with the x11session script (remember to specify the needed runtime, memory, number of computational cores, etc.), for example:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
then load a Gaussian build that matches the CPU of the node (gaussian/g16c02_avx2 on most nodes; see the Gaussian section) followed by GaussView, and start the GUI:
$ module purge
$ module load gaussian/g16c02_avx2
$ module load gaussview/6.1.1
$ gview &
Please refer to GaussView documentation to learn how to use this software.
Note
On the Grid Engine (legacy) cluster, to open the graphical user interface (GUI) of GaussView, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. Under these conditions, GaussView will start in GUI mode by default.
The GaussView program will let you submit a com file to Gaussian. The com file may be one created by GaussView, or one you created with a text editor. When you close your GaussView session, any Gaussian process that is still running will be aborted. If your calculations need to run for an extended period of time, we recommend that you instead run Gaussian in batch.
After requesting an interactive session (remember to specify the needed runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of GaussView with:
$ gaussview
Please refer to GaussiView documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
GROMACS
“GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles.” – GROMACS
Note
Available on: the Slurm (production) cluster (GROMACS 2024.3 for CPUs and 2026.1 for GPUs) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider gromacs on the Slurm cluster and module av gromacs on the Grid Engine cluster.
To run the molecular dynamics part (mdrun) of the GROMACS suite of programs, you are required to have previously generated an input file containing information about the topology, the structure and the parameters of your system. Such input file, which generally has a .tpr, a .tpb or a .tpa extension, is generated via the grompp part of GROMACS.
On the Slurm cluster two builds of GROMACS are available, both with the MPI-enabled gmx_mpi executable (there is no gmx):
gromacs/2024.3: CPU build with Intel MPI. It loadsintel/2024.1.0, which conflicts with the defaultintelmodule, so runmodule purgebefore loading it.gromacs/2026.1_ompi: GPU (CUDA) build with Open MPI and PLUMED. It is only visible aftermodule load cuda/12.8and loads Open MPI, UCX, PLUMED and Python for you.
You can execute the pre- and post-processing GROMACS tasks (such as gmx_mpi pdb2gmx, gmx_mpi solvate, gmx_mpi grompp, etc.) within an interactive session, which you can request for example with (remember to specify a runtime, memory, number of computational cores, etc. as needed):
$ srun --time=01:00:00 --cpus-per-task=2 --mem=4G --pty bash -l
Load GROMACS in your environment with:
$ module purge
$ module load gromacs/2024.3
or, for the GPU build in a session that requested a GPU (e.g. srun --time=01:00:00 --cpus-per-task=4 --mem=8G --gres=gpu:1 --pty bash -l, see Requesting GPUs with Slurm), with:
$ module purge
$ module load cuda/12.8
$ module load gromacs/2026.1_ompi
To check the version of GROMACS:
$ gmx_mpi -version
Please refer to GROMACS documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, you can execute the pre- and post-processing GROMACS tasks within an interactive session, which you can request for example with (remember to specify a runtime, memory, number of computational cores, etc. as needed):
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
To run pre- and post-processing parts of GROMACS (such as gmx pdb2gmx, gmx solvate, gmx grompp, etc.) you need to set GROMACS into your environment by loading the gromacs module file. You can check the available versions of GROMACS with:
$ module av gromacs
Load the default version of gromacs in your environment with:
$ module load gromacs
To load a different version, issue:
$ module load gromacs/VERSION
where VERSION is replaced by the desired version of gromacs.
To check the version of GROMACS:
$ gmx -version
Please refer to GROMACS documentation to learn how to use this software.
To submit a batch job with GROMACS on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p gromacs/2024.3
or create a job script similar to the one below, which runs gmx_mpi mdrun with 8 MPI processes on one node with the CPU build (see Distributed memory (MPI) jobs; the input file topol.tpr is in $HOME/myproject):
### gromacs_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gromacs
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, MPI processes and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gromacs.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load gromacs/2024.3
module list
# substitute the command to run the needed GROMACS command below
# (mpirun takes the number of MPI processes from --ntasks):
mpirun gmx_mpi mdrun -ntomp $SLURM_CPUS_PER_TASK -s $HOME/myproject/topol.tpr -deffnm md
echo "Job $SLURM_JOB_ID ended at $(date)"
### gromacs_submit.job STOP ###
mpirun takes the number of MPI processes from --ntasks: start gmx_mpi with mpirun, never with srun. To run on a GPU with the GPU build, use a job script similar to:
### gromacs_gpu_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gromacs_gpu
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores, memory and GPUs as needed:
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=2G
#SBATCH --gres=gpu:1
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gromacs_gpu.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load cuda/12.8
module load gromacs/2026.1_ompi
module list
# substitute the command to run the needed GROMACS command below
# (Open MPI: give each MPI process its --cpus-per-task cores):
mpirun --map-by ppr:$SLURM_NTASKS_PER_NODE:node:PE=$SLURM_CPUS_PER_TASK --bind-to core \
gmx_mpi mdrun -ntomp $SLURM_CPUS_PER_TASK -nb gpu -s $HOME/myproject/topol.tpr -deffnm md
echo "Job $SLURM_JOB_ID ended at $(date)"
### gromacs_gpu_submit.job STOP ###
where you would replace the account, the resources requested and the GROMACS command as needed (see Requesting GPUs with Slurm to select a GPU type). Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate gromacs_submit.job
$ sbatch gromacs_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with GROMACS, you will need to create a submission script similar to (remember to substitute $SAMPLECOMMAND for something like: gmx_mpi mpdrun ...):
### gromacs_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load gromacs
# substitute the command to run the needed gromacs command below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### gromacs_submit.sh STOP ###
where you would replace the resources requested and the GROMACS command as needed. Save the gromacs_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x gromacs_submit.sh
Submit the job with:
$ qsub gromacs_submit.sh
Please refer to GROMACS documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Jmol
“Jmol: an open-source Java viewer for chemical structures in 3D Jmol icon with features for chemicals, crystals, materials and biomolecules” – Jmol
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
No module or queue script is available for Jmol.
Note
On the Grid Engine (legacy) cluster, to open the graphical user interface (GUI) of Jmol, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. Under these conditions, Jmol will start in GUI mode by default.
Start requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
Then enter:
$ jmol &
References:
Problems with the instructions on this section? Please send comments here.
LAMMPS
“LAMMPS is a classical molecular dynamics code with a focus on materials modeling. It’s an acronym for Large-scale Atomic/Molecular Massively Parallel Simulator. – LAMMPS
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe dc\* 8
After the interactive session is awarded, if you will be testing the parallel version, you will want to load the scheduler environmental variables (such as $NSLOTS for the number of parallel workers, etc._:
$ . /u/local/bin/set_qrsh_env.sh
you can check the available versions of LAMMPS with:
$ modules_lookup -m lammps
Load the default version of LAMMPS in your environment with:
$ module load intel ; module load lammps
To load a different version, issue:
$ module load lammps/VERSION
where VERSION is replaced by the desired version of LAMMPS.
The LAMMPS executable is named lmp_mpi
To invoke LAMMPS in serial:
$ lmp_mpi < in.input
To invoke LAMMPS in parallel:
$ `which mpirun` -np $NSLOTS lmp_mpi
Please refer to LAMMPS documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with LAMMPS, you will need to create a submission script similar to:
### lammps_submit.sh START ### #!/bin/bash #$ -cwd # error = Merged with joblog #$ -o joblog.$JOB_ID #$ -j y # Edit the line below to request the appropriate runtime and memory # (or to add any other resource) as needed: #$ -l h_rt=1:00:00,h_data=1G # Add multiple cores/nodes as needed: #$ -pe shared 1 # Email address to notify #$ -M $USER@mail # Notify when #$ -m bea # echo job info on joblog: echo "Job $JOB_ID started on: " `hostname -s` echo "Job $JOB_ID started on: " `date ` echo " " # load the job environment: . /u/local/Modules/default/init/modules.sh module load intel module load lammps export OMP_NUM_THREADS=1 export MKL_NUM_THREADS=1 # substitute the command to run the needed LAMMPS command below # (in particular the name of the input, input.in, and output, output.out.$JOB_ID, files): /usr/bin/time -v `which mpirun` -np $NSLOTS $LAMMPS_BIN/lmp_mpi < input.in 2>&1 > output.out.$JOB_ID # echo job info on joblog: echo "Job $JOB_ID ended on: " `hostname -s` echo "Job $JOB_ID ended on: " `date ` echo " " ### lammps_submit.sh STOP ###
where you would replace the resources requested and the LAMMPS command as needed. Save the LAMMPS_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x lammps_submit.sh
Submit the job with:
$ qsub lammps_submit.sh
Please refer to LAMMPS documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Molden
“The Molden project aims to esthablish a drug design platform free of charge.” – MOLDEN project
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to open the graphical user interface (GUI) of Molden, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. Under these conditions, Molden will start in GUI mode by default.
After requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Molden with:
$ module av molden
Load the default version of Molden in your environment with:
$ module load molden
To invoke Molden:
$ molden &
Please refer to Molden documentation to learn how to use this software.
References:
The project page (first two links below) is currently unreachable.
Problems with the instructions on this section? Please send comments here.
MOPAC
“MOPAC (Molecular Orbital PACkage) is a semiempirical quantum chemistry program based on Dewar and Thiel’s NDDO approximation.” – MOPAC
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of MOPAC with:
$ module av mopac
Load the default version of MOPAC in your environment with:
$ module load mopac
Input files to MOPAC, also known as MOPAC data sets, need to have an .mop, .dat, or .arc extension. An example of input file for geometry optimization of formic acid, formic_acid.mop is given below:
MINDO/3
Formic acid
Example of normal geometry definition
O
C 1.20 1
O 1.32 1 116.8 1 0.0 0 2 1
H 0.98 1 123.9 1 0.0 0 3 2 1
H 1.11 1 127.3 1 180.0 0 2 1 3
0 0.00 0 0.0 0 0.0 0 0 0 0
save this file as: formic_acid.mop and invoke MOPAC with:
$ mopac formic_acid.mop
Please refer to MOPAC documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with MOPAC, you will need to create a submission script similar to:
### MOPAC_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load mopac
# substitute the command to run the needed MOPAC command below:
echo 'mopac mymopinputfile.mop'
mopac mymopinputfile.mop
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### MOPAC_submit.sh STOP ###
where you would replace the input file, mymopinputfile.mop, resources requested and the MOPAC command as needed. Save the MOPAC_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x MOPAC_submit.sh
Submit the job with:
$ qsub MOPAC_submit.sh
Please refer to MOPAC documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
NAMD
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Coming soon
This section is under construction. Please call again soon!
NWChem
“NWChem provides many methods for computing the properties of molecular and periodic systems using standard quantum mechanical descriptions of the electronic wavefunction or density.” – NWChem
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider nwchem on the Slurm cluster and module av nwchem on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with 4 MPI processes on one node:
$ srun --time=01:00:00 --ntasks=4 --mem-per-cpu=2G --pty bash -l
load NWChem in your environment with:
$ module purge
$ module load nwchem/7.2.3
$ export NWCHEM_BASIS_LIBRARY=$NWCHEM_DIR/data/libraries/
$ export NWCHEM_NWPW_LIBRARY=$NWCHEM_DIR/data/libraryps/
(the two export lines tell NWChem where its basis set and pseudopotential libraries are). nwchem/7.2.3 loads its own Intel MPI (intel/2024.1.0), which conflicts with the default intel module: do not skip module purge and do not load another MPI on top of it. To invoke NWChem:
$ mpirun $NWCHEM_BIN/nwchem input.nw
where input.nw will need to be substituted with the actual name of your NWChem input file. mpirun takes the number of MPI processes from the Slurm allocation (start NWChem with mpirun, never with srun).
Please refer to NWChem documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe dc\* 8
After getting into the insteractive session, if you will be testing the parallel version, you will want to load the scheduler environmental variables (such as $NSLOTS for the number of parallel workers, etc._:
$ . /u/local/bin/set_qrsh_env.sh
you can check the available versions of _ with:
$ module av nwchem
Load the default version of NWChem in your environment with:
$ module load nwchem
To invoke NWChem:
$ `which mpirun` -np $NSLOTS $NWCHEM_BIN/nwchem input.nw
where: input.nw will need to be substituted wuth the actual name of your NWChem input file.
Please refer to NWChem documentation to learn how to use this software.
To submit a batch job with NWChem on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p nwchem/7.2.3
or create a job script similar to the one below, which runs NWChem with 8 MPI processes on one node (see Distributed memory (MPI) jobs):
### nwchem_submit.job START ###
#!/bin/bash
#SBATCH --job-name=nwchem
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, MPI processes and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=nwchem.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load nwchem/7.2.3
module list
# tell NWChem where its basis set and pseudopotential libraries are:
export NWCHEM_BASIS_LIBRARY=$NWCHEM_DIR/data/libraries/
export NWCHEM_NWPW_LIBRARY=$NWCHEM_DIR/data/libraryps/
# substitute the names of the input and output files below
# (mpirun takes the number of MPI processes from --ntasks):
mpirun $NWCHEM_BIN/nwchem $HOME/myproject/input.nw > $HOME/myproject/output.out.$SLURM_JOB_ID 2>&1
echo "Job $SLURM_JOB_ID ended at $(date)"
### nwchem_submit.job STOP ###
where you would replace the account, the resources requested and the NWChem command (in particular the names of the input and output files) as needed. mpirun takes the number of MPI processes from --ntasks; to use several nodes, request them with --nodes and --ntasks-per-node instead. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate nwchem_submit.job
$ sbatch nwchem_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with NWChem, you will need to create a submission script similar to:
### NWChem_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load nwchem
nwchem_basis_library=$NWCHEM_DIR/data/libraries/
nwchem_nwpw_library=$NWCHEM_DIR/data/libraryps/
ffield=amber
amber_1=$NWCHEM_DIR/data/amber_s/
amber_2=$NWCHEM_DIR/data/amber_q/
amber_3=$NWCHEM_DIR/data/amber_x/
amber_4=$NWCHEM_DIR/data/amber_u/
spce= $NWCHEM_DIR/data/solvents/spce.rst
charmm_s=$NWCHEM_DIR/data/charmm_s/
charmm_x=$NWCHEM_DIR/data/charmm_x/
# substitute the command to run the needed NWChem command below
# (in particular the names of the input and output files):
`which mpirun` -np $NSLOTS $NWCHEM_BIN/nwchem input.nw 2>&1 > output.out.$JOB_ID
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### NWChem_submit.sh STOP ###
where you would replace the resources requested and the NWChem command as needed. Save the NWChem_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x NWChem_submit.sh
Submit the job with:
$ qsub NWChem_submit.sh
Please refer to NWChem documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Open Babel
“Open Babel is a chemical toolbox designed to speak the many languages of chemical data. It’s an open, collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas.” – Open Babel
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider openbabel on the Slurm cluster and module av openbabel on the Grid Engine cluster.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=4G --pty bash -l
load Open Babel in your environment with:
$ module purge
$ module load openbabel/3.1.1
To invoke Open Babel:
$ obabel --help
(the old babel command is not part of Open Babel 3, use obabel). Please refer to Open Babel documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of Open Babel with:
$ module av openbabel
Load the default version of Open Babel in your environment with:
$ module load openbabel
To load a different version, issue:
$ module load openbabel/VERSION
where VERSION is replaced by the desired version of Open Babel.
To invoke Open Babel:
$ obabel --help
or:
$ babel --help
Please refer to Open Babel documentation to learn how to use this software.
To submit a batch job with Open Babel on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p openbabel/3.1.1
or create a job script similar to:
### openbabel_submit.job START ###
#!/bin/bash
#SBATCH --job-name=openbabel
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=openbabel.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load openbabel/3.1.1
module list
# substitute the needed Open Babel command below, e.g. to convert a file
# from the SMILES to the SDF format, adding 3D coordinates:
obabel $HOME/myproject/input.smi -O $HOME/myproject/output.sdf --gen3d
echo "Job $SLURM_JOB_ID ended at $(date)"
### openbabel_submit.job STOP ###
where you would replace the account, the resources requested and the Open Babel command as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate openbabel_submit.job
$ sbatch openbabel_submit.job
References:
Problems with the instructions on this section? Please send comments here.
Q-Chem
“Q-Chem is a comprehensive ab initio quantum chemistry software for accurate predictions of molecular structures, reactivities, and vibrational, electronic and NMR spectra.” – Q-Chem
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. On the Slurm cluster, Q-Chem 6.3.0 is available as qchem/6.3.0_SHRDMEM, the shared-memory (multi-threaded) version, which runs on the cores of one node. The parallel (MPI) version for the Slurm cluster is still being tested and will be documented here when it is ready. To see the installed versions, use module spider qchem on the Slurm cluster and module av qchem on the Grid Engine cluster.
On the Slurm cluster, request an interactive session with the cores, runtime and memory you need. For the shared-memory version, ask for one task with several cores, for example:
$ srun --nodes=1 --ntasks=1 --cpus-per-task=8 --mem-per-cpu=2G --time=01:00:00 --pty bash -l
then load Q-Chem in your environment and run it on the cores of your session with:
$ module purge
$ module load qchem/6.3.0_SHRDMEM
$ qchem -nt $SLURM_CPUS_PER_TASK sample.in sample.out
where you will modify the name of the input, sample.in, and output, sample.out, files as needed. The -nt option sets the number of threads; keep it equal to the number of cores of your session ($SLURM_CPUS_PER_TASK).
To modify the default memory create the file $HOME/.qchemrc and set its content to, for example:
$rem
MEM_TOTAL 8000
$end
Please refer to the Q-Chem documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe dc\* 8
After the insteractive session is awarded, if you will be testing the parallel version, you will want to load the scheduler environmental variables (such as $NSLOTS for the number of parallel workers, etc._:
$ . /u/local/bin/set_qrsh_env.sh
you can check the available versions of Q-Chem with:
$ module av qchem
Load the shared memory version of Q-Chem in your environment with:
$ module load qchem/current_sm
To run the shared memory version, issue:
$ qchem -nt $NSLOTS sample.in sample.out_$JOB_ID
where you will modify the name of the input, sample.in, and output, sample.out_$JOB_ID, files as needed.
To load the openmpi version, issue:
$ module load qchem/current_mpi
To run the openmpi version, issue:
$ qchem -mpi -nt 1 -np $NSLOTS sample.in sample.out_$JOB_ID
where you will modify the name of the input, sample.in, and output, sample.out_$JOB_ID, files as needed.
To modify the default memory create the file:
$ $HOME/.qchemrc
and set its content to, forexample:
$rem
MEM_TOTAL 8000
$end
Please refer to Q-Chem documentation to learn how to use this software Q-Chem documentation.
To submit a batch job with the shared-memory (multi-threaded) version of Q-Chem on the Slurm cluster, create a job script similar to the following:
### qchem_sm_submit.job START ###
#!/bin/bash
#SBATCH --job-name=qchem_sm
# your Slurm account (see: h2 whoami) -- need to specify only if have more than 1:
## SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=04:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=qchem_sm.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load qchem/6.3.0_SHRDMEM
module list
# substitute the command to run the needed Q-Chem command below
# (in particular the name of the input and output files):
/usr/bin/time -v qchem -nt $SLURM_CPUS_PER_TASK $HOME/myproject/sample.in $HOME/myproject/sample.out.$SLURM_JOB_ID
echo "Job $SLURM_JOB_ID ended at $(date)"
### qchem_sm_submit.job STOP ###
where you would replace the resources requested and the Q-Chem command as needed. Submit the job after checking it, with:
$ h2 validate qchem_sm_submit.job
$ sbatch qchem_sm_submit.job
You can also let job.q write a job script for you (see Building a job script with job.q), for example with job.q -p qchem/6.3.0_SHRDMEM -n sample.in -c "qchem -nt 8 sample.in sample.out" -s 8 -ns.
Please refer to the Q-Chem documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Q-Chem, you will need to create a submission script similar to:
### Q-Chem_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Change the number of cores/nodes as needed:
#$ -pe dc* 18
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load qchem/current_mpi
module li
echo " "
# substitute the command to run the needed Q-Chem command below
# (in particular the name of the input and output files):
echo "/usr/bin/time -apv qchem -mpi -nt 1 -np $NSLOTS sample.in sample.out_$JOB_ID"
/usr/bin/time -apv qchem -mpi -nt 1 -np $NSLOTS sample.in sample.out_$JOB_ID
# echo job info on joblog:
echo " "
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Q-Chem_submit.sh STOP ###
### Q-Chem_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Modify the number of cores/nodes as needed:
#$ -pe shared 12
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load qchem/current_sm
module li
echo " "
# substitute the command to run the needed Q-Chem command below
# (in particular the name of the input and output files):
echo "/usr/bin/time -apv qchem -nt $NSLOTS sample.in sample.out_$JOB_ID"
/usr/bin/time -apv qchem -nt $NSLOTS sample.in sample.out_$JOB_ID
# echo job info on joblog:
echo " "
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Q-Chem_submit.sh STOP ###
where you would replace the resources requested and the Q-Chem command as needed. Save the Q-Chem_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x Q-Chem_submit.sh
Submit the job with:
$ qsub Q-Chem_submit.sh
The following queue scripts are available for Q-Chem:
$ qchem.q
To run in parallel:
$ qchem.q.parallel
Please refer to Q-Chem documentation to learn how to use this software Q-Chem documentation.
References:
Problems with the instructions on this section? Please send comments here.
Quantum ESPRESSO
“Quantum ESPRESSO is an integrated suite of Open-Source computer codes for electronic-structure calculations and materials modeling at the nanoscale. It is based on density-functional theory, plane waves, and pseudopotentials.” – Quantum ESPRESSO
Note
Available on: the Slurm (production) cluster (Quantum ESPRESSO 7.3.1 only, serial build) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider espresso on the Slurm cluster and module av espresso on the Grid Engine cluster. If you need an MPI-parallel build on the Slurm cluster, please request it by opening a ticket.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=5G --pty bash -l
load Quantum ESPRESSO in your environment with:
$ module purge
$ module load espresso/7.3.1
espresso/7.3.1 loads intel/2024.1.0, which conflicts with the default intel module, so do not skip module purge. This build is serial (pw.x prints “Serial version”): run it on one core, without mpirun. To invoke, for example, the pw.x Quantum ESPRESSO binary use:
$ pw.x -inp <espresso.in>
where <espresso.in> is the name of the input file.
Please refer to Quantum ESPRESSO documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=5G -pe shared 4
you can check the available versions of Quantum ESPRESSO with:
$ modules_lookup -m espresso
Load the required version of Quantum ESPRESSO in your environment with, for example:
$ module load gcc/10.2.0; module load espresso/7.1
To invoke, for example, the pw.x Quantum ESPRESSO espresso binary (for testing purposes and assumed that you have requested 4 cores as in the qrsh command above) use:
$ `which mpirun` -genv OMP_NUM_THREADS 1 -n 4 `which/pw.x` -inp <espresso.in>
where <espresso.in> is the name of the input file.
Please refer to Quantum ESPRESSO documentation to learn how to use this software.
To submit a batch job with Quantum ESPRESSO on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p espresso/7.3.1
or create a job script similar to:
### espresso_submit.job START ###
#!/bin/bash
#SBATCH --job-name=espresso
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=5G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=espresso.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load espresso/7.3.1
module list
# substitute the command to run the needed Quantum ESPRESSO command below:
/usr/bin/time -v pw.x -inp $HOME/myproject/espresso.in > $HOME/myproject/output.$SLURM_JOB_ID
echo "Job $SLURM_JOB_ID ended at $(date)"
### espresso_submit.job STOP ###
where you would replace the account, the resources requested and the Quantum ESPRESSO command as needed. As the espresso/7.3.1 build is serial, request one task and one core and run pw.x without mpirun. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate espresso_submit.job
$ sbatch espresso_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution with Quantum ESPRESSO, you will need to create a submission script similar to:
### submit_qe.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=5G
# Add multiple cores/nodes as needed:
#$ -pe shared 8
# or to request cores from across nodes on the cluster:
# #$ -pe dc* 36
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load gcc/10.2.0; module load espresso/7.1
# or, at the terminal, check other version with:
# modules_lookup -m espresso
# show which modules are loaded in joblog file:
module li
echo ""
# substitute the command to run the needed Quantum ESPRESSO command below:
## echo line of command to run for joblog file:
echo "/usr/bin/time -v `which mpirun` -genv OMP_NUM_THREADS 1 -n $NSLOTS \\"
echo "`which pw.x` -inp espresso.in > output.$JOB_ID"
## actual command:
/usr/bin/time -v `which mpirun` -genv OMP_NUM_THREADS 1 -n $NSLOTS \
`which pw.x` -inp espresso.in > output.$JOB_ID
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### submit_qe.sh STOP ###
where you would replace the resources requested and the Quantum ESPRESSO command as needed. Save the submit_qe.sh script in a location on your account from which you would like to submit your job and submit the job with:
$ qsub submit_qe.sh
Please refer to Quantum ESPRESSO documentation to learn how to use this software.
References:
VMD
“VMD is a molecular visualization program for displaying, animating, and analyzing large biomolecular systems using 3-D graphics and built-in scripting.” – VMD
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to open the graphical user interface (GUI) of VMD, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. Under this conditions, VMD will start in GUI mode by default.
After requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=2G -pe shared 2
you can check the available versions of VMD with:
$ module av vmd
Load the default version of VMD in your environment with:
$ module load vmd
To invoke VMD:
$ vmd &
Please refer to VMD documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution with VMD, you will need to create a submission script similar to:
### VMD_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load VMD
# substitute the name of the name script to run with the needed one:
echo 'vmd -dispdev text -e myscript.vmd'
vmd -dispdev text -e myscript.vmd
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### VMD_submit.sh STOP ###
where you would replace the resources requested and the VMD command as needed. Save the VMD_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x VMD_submit.sh
Submit the job with:
$ qsub VMD_submit.sh
Please refer to VMD documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Engineering and mathematics
ABAQUS
Abaqus is a software suite for finite element analysis.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider abaqus on the Slurm cluster and module av abaqus on the Grid Engine cluster.
Note
To open the Abaqus/CAE graphical user interface (GUI) on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session).
On the Slurm cluster, from a terminal on the DCV desktop request an interactive session for GUI applications (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
For command-line work only (no GUI), an interactive session started with srun is enough:
$ srun --time=02:00:00 --cpus-per-task=2 --mem=8G --pty bash -l
Then load Abaqus in your environment with:
$ module purge
$ module load abaqus/2025
(to see the installed versions use module spider abaqus). To invoke Abaqus/CAE (from an x11session shell):
$ abaqus cae &
To see the options of the abaqus command:
$ abaqus help
Note
To open the Abaqus/CAE graphical user interface (GUI), you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications.
On the Grid Engine (legacy) cluster, on a terminal request an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=8G -pe shared 2
you can then check the available versions of Abaqus with:
$ module av abaqus
and then load the default version of Abaqus in your environment with:
$ module load abaqus
To load a different version, issue:
$ module load abaqus/VERSION
where VERSION is replaced by the desired version of Abaqus.
To invoke Abaqus/CAE:
$ abaqus cae &
Please refer to Abaqus documentation to learn how to use this software Abaqus documentation.
To submit a batch job with Abaqus on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p abaqus
or create a job script similar to:
### abaqus_submit.job START ###
#!/bin/bash
#SBATCH --job-name=abaqus
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=03:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=abaqus.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load abaqus/2025
module list
# name of your Abaqus input file (here myjob.inp) without the .inp extension:
NAME=myjob
# run the analysis on the cores requested (see: abaqus help):
abaqus job=$NAME input=$HOME/myproject/$NAME.inp cpus=$SLURM_CPUS_PER_TASK mp_mode=threads scratch=$TMPDIR interactive
echo "Job $SLURM_JOB_ID ended at $(date)"
### abaqus_submit.job STOP ###
where you would replace the account, the resources requested, the name and location of your input file and the Abaqus options as needed. The analysis runs on one node with the cores requested (cpus=$SLURM_CPUS_PER_TASK) and writes its temporary files to the job’s local $TMPDIR; its results (myjob.odb, myjob.dat, …) are written to the directory you submit the job from. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate abaqus_submit.job
$ sbatch abaqus_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Abaqus you will need to create a submission script similar to:
### Abaqus_submit.sh START ###
# Submit this script with:
#
# qsub -N NAME_OF_YOUR_INPUT_FILE Abaqus_submit.sh
#
# or to change the memory, run-time, number of cores, etc., with:
#
# qsub -l h_data=4G,h_rt=3:00:00 -pe dc\* 20 -N NAME_OF_YOUR_INPUT_FILE Abaqus_submit.sh
#
# NAME_OF_YOUR_INPUT_FILE should be an abaqus inp file.
###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=10G
# Modify the number of cores/nodes as needed:
#$ -pe shared 2
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
NAME=${JOB_NAME%.*}
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load abaqus
# create local abaqus_v6.env file to store MPI hosts:
startabaqus.sh ${PE_HOSTFILE} > ./abaqus_v6.env
#echo memory=\"3096\" >> ./abaqus_v6.env
# substitute the command to run the needed Abaqus command below:
# please see the output of the commands:
# module load abaqus
# abaqus help
# to see the available options to pass to:
# abaqus job=job_name ...
# if your job will be an abaqus analysis and you would like to
# have any files generated during the run to be prefixed by job_name
# and the input for your job is called: input.inp, you can then use
# the command as below (you should of course change to conform to your
# actual job_name and input file name):
echo "abaqus job=$NAME inp=${NAME}.inp -cpus $NSLOTS -mp_mode MPI scratch=$SCRATCH interactive"
abaqus job=$NAME inp=${NAME}.inp -cpus $NSLOTS -mp_mode MPI scratch=$SCRATCH interactive
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Abaqus_submit.sh STOP ###
where you would replace the resources requested and the Abaqus command as needed. Save the Abaqus_submit.sh script in a location on your account from which you would like to submit your job, submit the job with:
qsub -N NAME_OF_YOUR_INPUT_FILE Abaqus_submit.sh
where NAME_OF_YOUR_INPUT_FILE is the name of your Abaqus input file (with a .inp filename extension).
It is possible to alter the resources requested without modifying the Abaqus_submit.sh submission script with, for example:
qsub -l h_data=4G,h_rt=3:00:00 -pe dc\* 20 -N NAME_OF_YOUR_INPUT_FILE Abaqus_submit.sh
where NAME_OF_YOUR_INPUT_FILE is the name of your Abaqus input file (with a .inp filename extension).
Note
To learn options that can be passed to the abaqus command please see the output of:
$ module load abaqus
$ abaqus help
In the following execution procedures, "abaqus" refers to the command
used to run Abaqus.
Obtaining information
abaqus {help | information={environment | local | memory | release |
support | system | all} [job=job-name] | whereami}
Abaqus/Standard and Abaqus/Explicit execution
abaqus job=job-name
[analysis | datacheck | parametercheck | continue |
convert={select | odb | state | all} | recover |
syntaxcheck | information={environment | local |
memory | release | support | system | all}]
[input=input-file]
[user={source-file | object-file}]
[...]
[...]
References:
Problems with the instructions on this section? Please send comments here.
Ansys
“Next-generation pervasive engineering simulations” – Ansys
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider ansys on the Slurm cluster and module av ansys on the Grid Engine cluster.
Note
To run the Ansys graphical user interface (GUI) on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session).
On the Slurm cluster, from a terminal on the DCV desktop request an interactive session for GUI applications (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
Then load Ansys in your environment with:
$ module purge
$ module load ansys/2026R1
(to see the installed versions use module spider ansys). To invoke Ansys Workbench:
$ runwb2 &
or, for Ansys Fluent:
$ fluent &
Note
To run Ansys you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
On the Grid Engine (legacy) cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ qrsh -l h_rt=1:00:00,h_data=8G -pe shared 2
you can check the available versions of Ansys with:
$ module av ansys
load the default version of Ansys in your environment with:
$ module load ansys
To load a different version, issue:
$ module load ansys/VERSION
where VERSION is replaced by the desired version of Ansys.
To invoke Ansys:
$ runwb2 &
Please refer to Ansys documentation to learn how to use this software Ansys documentation.
To submit a batch job with Ansys on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p ansys
or create a job script similar to (the example below runs an Ansys Fluent job in batch, on one node, for the journal file batch_reformer.jou):
### ansys_submit.job START ###
#!/bin/bash
#SBATCH --job-name=ansys
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=03:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=ansys.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load ansys/2026R1
module list
# substitute the command to run the needed Ansys command below
# (here an Ansys Fluent run of the journal file batch_reformer.jou):
fluent 3ddp -g -t$SLURM_CPUS_PER_TASK -i $HOME/myproject/batch_reformer.jou
echo "Job $SLURM_JOB_ID ended at $(date)"
### ansys_submit.job STOP ###
where you would replace the account, the resources requested and the Ansys command as needed. -t$SLURM_CPUS_PER_TASK starts as many Fluent processes as cores requested. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate ansys_submit.job
$ sbatch ansys_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Ansys you will need to create a submission script similar to (the example below is to submit an Ansys Fluent job in batch for the input file batch_reformer.jou, change runtime, memory and add any other resource as needed):
### Ansys_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Modify the number of cores/nodes as needed:
#$ -pe dc* 34
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load ansys
which fluent
# Creating hostfile:
cat $PE_HOSTFILE | awk '{ for (i=1; i<=$2; i++) print $1}' > ./tmp.$JOB_ID
l_no=`wc -l ./tmp.$JOB_ID | awk '{print $1}'`
tail -n $(($l_no-1)) ./tmp.$JOB_ID > ./hostfile.$JOB_ID
rm ./tmp.$JOB_ID
echo "USING hostfile.$JOB_ID"
cat ./hostfile.$JOB_ID
echo "#####"
slots=$(($NSLOTS-1))
# substitute the command to run the needed Ansys command below:
echo "fluent 3ddp -g -t$slots -pinfiniband -cnf=./hostfile.$JOB_ID -nm -cc -ssh -i batch_reformer.jou"
fluent 3ddp -g -t$slots -pinfiniband -cnf=./hostfile.$JOB_ID -nm -cc -ssh -i batch_reformer.jou
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### Ansys_submit.sh STOP ###
where you would replace the resources requested and the Ansys command as needed. Save the Ansys_submit.sh script in a location on your account from which you would like to submit your job, submit the job with:
qsub Ansys_submit.sh
References:
Problems with the instructions on this section? Please send comments here.
COMSOL
COMSOL Multiphysics is a cross-platform finite element analysis, solver and multiphysics simulation software. It allows conventional physics-based user interfaces and coupled systems of partial differential equations. For more information, see the COMSOL website.
Note
OARC does not own publicly available licenses for this software. If you are interested to run COMSOL on the Hoffman2 Cluster you will need to either check out a license from a COMSOL license manager to which you have access or consider taking advantage of the licensing services available on the Hoffman2 Cluster and purchase a network type license directly with COMSOL, you will then need to communicate with us to request installation of the license and the license server Host ID.
Warning
If your group does not own or can connect to a license manager with a valid COMSOL license, any interactive or batch job submission will receive a licensing error as all licenses running on the cluster are reserved for the respective licensees.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider comsol on the Slurm cluster and module av comsol on the Grid Engine cluster.
Note
To run the COMSOL graphical user interface (GUI) on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session).
COMSOL input files are generally created within the COMSOL GUI frontend. On the Slurm cluster, from a terminal on the DCV desktop request an interactive session for GUI applications (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
Then, at the compute node shell prompt, enter:
$ module purge
$ module load comsol/6.4
$ comsol &
To see the installed versions use module spider comsol.
Note
To run COMSOL you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications.
On the Grid Engine (legacy) cluster, COMSOL input files are generally created within the COMSOL GUI frontend.
To run COMSOL up to version 5.3s, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=8G,h_rt=1:00:00
Next, at the compute node shell prompt, enter:
$ module load comsol
$ comsol
To run COMSOL up to version 5.4 and up, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=8G,h_rt=1:00:00
Next, at the compute node shell prompt, enter:
$ module load comsol
$ comsol
To load a specific version, issue:
$ module load comsol/VERSION
where VERSION is a specific version of COMSOL. To see which versions are available, issue:
$ module av comsol
Please refer to the COMSOL documentation to learn how to use this software.
To submit a batch job with COMSOL on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p comsol
or create a job script similar to:
### comsol_submit.job START ###
#!/bin/bash
#SBATCH --job-name=comsol
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=03:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=comsol.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load comsol/6.4
module list
# solve the model mymodel.mph on the cores requested:
comsol batch -np $SLURM_CPUS_PER_TASK -tmpdir $TMPDIR \
-inputfile $HOME/myproject/mymodel.mph \
-outputfile mymodel_solved.mph \
-batchlog mymodel.$SLURM_JOB_ID.log
echo "Job $SLURM_JOB_ID ended at $(date)"
### comsol_submit.job STOP ###
where you would replace the account, the resources requested and the name and location of your mph input file as needed. COMSOL solves the model on the cores requested (-np $SLURM_CPUS_PER_TASK) and writes the solved model and its log to the directory you submit the job from. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate comsol_submit.job
$ sbatch comsol_submit.job
On the Grid Engine (legacy) cluster, to submit a COMSOL batch job that will use COMSOL version 5.5, navigate to the directory where the mph input file is and issue:
$ qsub -N NAME_OF_MPH_FILE_WITH_NO_MPH_EXTENSION -l h_rt=HH:MM:SS /u/local/apps/submit_scripts/submit_comsol_multithreaded.shwhere:
NAME_OF_MPH_FILE_WITH_NO_MPH_EXTENSIONis the name of your mph input file without the .mph extensionHH:MM:SSis the runtime in hours, minutes and seconds (for example, for 24 hours use: 24:00:00).To submit a COMSOL batch job that will use COMSOL version 5.5, navigate to the directory where the mph input file is and issue:
$ qsub -N NAME_OF_MPH_FILE_WITH_NO_MPH_EXTENSION -l h_rt=HH:MM:SS /u/local/apps/submit_scripts/submit_comsol_5.4_multithreaded.shwhere:
NAME_OF_MPH_FILE_WITH_NO_MPH_EXTENSIONis the name of your mph input file without the .mph extensionHH:MM:SSis the runtime in hours, minutes and seconds (for example, for 24 hours use: 24:00:00).To run older versions of COMSOL in batch you can use queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
To run COMSOL multi-threaded, issue the following queue script:
$ comsol.q.multithreadTo run COMSOL in parallel, issue the following queue script:
$ comsol.q.parallel
Please refer to the COMSOL documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Maple
Maple is a symbolic and numeric computing environment as well as a multi-paradigm programming language. It covers several areas of technical computing, such as symbolic mathematics, numerical analysis, data processing, visualization, and others. See the Maplesoft website for more information.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for Maple.
To run Maple interactively with its GUI interface you must first connect to the cluster login node with X11 forwarding enabled. Then use qrsh to obtain an interactive compute node.
Note
To run Maple you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
module load maple
Next, enter:
maple [maple-command-line-parameters]
or,
xmaple [xmaple-command-line-parameters]
or,
mint [mint-command-line-parameters]
Note: Classic worksheet (-cw) is not available. Default is interface(prettyprint=true);
On the Grid Engine (legacy) cluster, the easiest way to run Maple in batch from the login node is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
The following queue scripts are available for Maple:
maple.q
Maple runs in serial.
See Altair Grid Engine batch jobs with qsub for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with the queue script listed above. After saving the command file, you can modify it if necessary. See Additional tools for a list of the most commonly used UGE commands.
References:
Problems with the instructions on this section? Please send comments here.
Mathematica
Wolfram Mathematica is a modern technical computing system spanning most areas of technical computing — including neural networks, machine learning, image processing, geometry, data science, visualizations, and others. The system is used in many technical, scientific, engineering, mathematical, and computing fields. For more informaiton, see the Wolfram website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider mathematica on the Slurm cluster and module av mathematica on the Grid Engine cluster.
You can use any text editor to make the appropriate input files for Mathematica.
Note
To run the Mathematica notebook interface (GUI) on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session).
On the Slurm cluster, for the GUI, from a terminal on the DCV desktop request an interactive session with, for example:
$ x11session --time=01:00:00 --mem=8G
or, for the command line interface only, request an interactive session with, for example:
$ srun --time=01:00:00 --mem=8G --pty bash -l
Then enter:
$ module purge
$ module load mathematica/15.0
To start the notebook interface (from an x11session shell):
$ wolframnb &
Or, to use its command line interface, enter:
$ math
To see the installed versions use module spider mathematica.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for Mathematica.
Note
To run Mathematica having followed directions to Opening GUI applications.
To run Mathematica interactively using its GUI interface, you must first connect to the cluster login node with X11 forwarding enabled.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=8G,h_rt=1:00:00
Then enter:
module load mathematica
Or, to use its command line interface, enter:
math
To submit a batch job with Mathematica on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p mathematica
or create a job script similar to:
### mathematica_submit.job START ###
#!/bin/bash
#SBATCH --job-name=mathematica
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=mathematica.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load mathematica/15.0
module list
# run the Wolfram Language script myscript.wl:
math -script $HOME/myproject/myscript.wl
echo "Job $SLURM_JOB_ID ended at $(date)"
### mathematica_submit.job STOP ###
where you would replace the account, the resources requested and the Wolfram Language script (a text file with the commands you would enter at the math prompt) as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate mathematica_submit.job
$ sbatch mathematica_submit.job
On the Grid Engine (legacy) cluster, the easiest way to run Mathematica in batch from the login node is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
The following queue script is available for Mathematica:
math.q
Next you will be prompted to choose to run your job in parallel or serial.
To run in parallel, issue:
math.q.parallel
To run in serial, issue:
math.q.serial
See Altair Grid Engine batch jobs with qsub for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with the queue script listed above. After saving the command file, you can modify it if necessary. See Additional tools for a list of the most commonly used UGE commands.
References:
Problems with the instructions on this section? Please send comments here.
MATLAB
“MATLAB combines a desktop environment tuned for iterative analysis and design processes with a programming language that expresses matrix and array mathematics directly.” – MathWorks
Under the Total Academic Headcount License, MATLAB and the full suite of toolboxes is available to the UCLA research community. On the Hoffman2 Cluster you have access to an unlimited number of licenses and to the full suite of MathWorks toolboxes including the MATLAB Parallel Server which lets you submit your MATLAB programs and Simulink simulations to an unlimited number of computational cores.
Note
Available on: the Slurm (production) cluster (MATLAB R2026a) and the Grid Engine (legacy) cluster. To see the installed versions, use module spider matlab on the Slurm cluster and module av matlab on the Grid Engine cluster.
Note
To open the MATLAB desktop on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session).
Warning
Do not use srun --x11 to open the MATLAB desktop: Slurm’s X11 forwarding can deadlock with it and freeze your whole DCV desktop. Use x11session instead.
On the Slurm cluster, from a terminal on the DCV desktop request an interactive session for GUI applications with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ x11session --time=02:00:00 --mem=8G -c 2
The MATLAB desktop needs about 5 GB of memory to start, so request at least 8 GB. Then load MATLAB in your environment with:
$ module purge
$ module load matlab/R2026a
(to see the installed versions use module spider matlab) and invoke the MATLAB desktop with:
$ matlab &
Drawing the desktop over X11 can be slow; for a faster start, use the MATLAB command window without the desktop:
$ matlab -nodesktop -nosplash
For work that does not need graphics, an interactive session started with srun is enough:
$ srun --time=02:00:00 --cpus-per-task=2 --mem=8G --pty bash -l
$ module purge
$ module load matlab/R2026a
$ matlab -nodisplay
To use the MATLAB compiler to create a stand-alone executable, load the MATLAB module and use mcc as described in the GE interactive tab:
$ mcc -m [mcc-options] main.m f1.m f2.m
Please refer to the MATLAB documentation to learn how to use this software.
Note
To run MATLAB you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications.
On the Grid Engine (legacy) cluster, after requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_rt=1:00:00,h_data=20G -pe shared 1
load the default version of MATLAB in your environment with:
$ module load matlab
You can check the available versions with:
$ module av matlab
To load a specific version, issue:
$ module load matlab/VERSION
where VERSION is replaced by the desired version of MATLAB.
To invoke MATLAB issue:
$ matlab &
To use the MATLAB compiler to create a stand-alone matlab executable, enter:
$ module load matlab
$ mcc -m [mcc-options] <space separated list of matlab functions to be compiled>
if more than one matlab function needs to be included in the compilation they should be listed placing the main function as first. If, for example, your matlab code is organized in main function, written in a separate file (for example: main.m) that calls code in functions written in separate files: f1.m, f2.m, you would use:
$ mcc -m [mcc-options] main.m f1.m f2.m
To create an executable that will run on a single processor, include this mcc option:
-R -singleCompThread
Warning
MATLAB virtual memory size issue
The Hoffman2 Cluster’s job scheduler currently enforces the virtual memory limit on jobs based on the h_data value in job submissions. It is important to set h_data large enough to run the job. On the other hand, setting too large h_data limits the number of available nodes to run the job or results in a job unable to start. During the runtime of a job, if the virtual memory limit is exceeded, the job is terminated instantly.
Matlab consumes a large amount of virtual memory when the Java-based graphics interface is used. Depending on the Matlab versions and the CPU models, we have measured that launching the Matlab GUI requires 15-20GB of virtual memory (without using any user data). For example, on Intel Gold Gold 6140 CPU, the virtual memory size of the MATLAB process is 20GB. On Intel E5-2670v3 CPU, the virtual memory size of the MATLAB process is 16GB.
MATLAB memory needs upon opening the MATLAB GUI Desktop on different CPUs.
Please refer to the MATLAB documentation to learn how to use this software.
To submit a batch job with MATLAB on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p matlab
or create a job script similar to:
### matlab_submit.job START ###
#!/bin/bash
#SBATCH --job-name=matlab
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=02:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=matlab.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load matlab/R2026a
module list
# run the MATLAB function or script myfunction.m (without the .m extension)
# on the cores requested:
matlab -batch "maxNumCompThreads($SLURM_CPUS_PER_TASK); addpath('$HOME/myproject'); myfunction"
echo "Job $SLURM_JOB_ID ended at $(date)"
### matlab_submit.job STOP ###
where you would replace the account, the resources requested and the name and location of your MATLAB function or script as needed. matlab -batch runs the code without the desktop and exits when it ends; maxNumCompThreads($SLURM_CPUS_PER_TASK) keeps MATLAB within the cores requested (for a single-threaded run, request one core and replace it with the -singleCompThread option). Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate matlab_submit.job
$ sbatch matlab_submit.job
On the Grid Engine (legacy) cluster, to submit a job for batch execution that will execute a MATLAB function that you have defined, you can create a submission script similar to:
#### submit_matlab.sh STOP ####
#!bin/bash
#$ -S /bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below as needed
#$ -l h_data=10G,h_rt=1:00:00
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "job $JOB_ID started on: " `date `
## commands here ##
. /u/local/Modules/default/init/modules.sh
module load matlab
module li
echo " "
export MCR_CACHE_ROOT=$TMPDIR
echo "MCR_CACHE_ROOT=$MCR_CACHE_ROOT"
echo " "
# substitute the command to run your code below:
echo "matlab -nojvm -nodisplay -nosplash -r MYMATLABFUNCTION >> output.$JOB_ID"
matlab -nojvm -nodisplay -nosplash -r MYMATLABFUNCTION >> output.$JOB_ID
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
#### submit_matlab.sh STOP ####
To submit MATLAB script from a terminal on the cluster, navigate to the directory where your MATLAB script is and use any one of the following scripts according to your needs:
$ /u/local/apps/submit_scripts/matlab_compile_and_submit_noSingleCompThreads.sh
$ /u/local/apps/submit_scripts/matlab_compile_and_submit.sh
$ /u/local/apps/submit_scripts/matlab_no_compile_submit_exclusive_change_dir.sh
$ /u/local/apps/submit_scripts/matlab_no_compile_submit_exclusive_dir.sh
$ /u/local/apps/submit_scripts/matlab_no_compile_submit_exclusive.sh
$ /u/local/apps/submit_scripts/matlab_no_compile_submit.sh
$ /u/local/apps/submit_scripts/matlab_no_compile_submit_v9.1.sh
to learn how to use them just issue, for example, for matlab_compile_and_submit_noSingleCompThreads.sh, issue:
$ /u/local/apps/submit_scripts/matlab_compile_and_submit_noSingleCompThreads.sh
which will give you:
Usage:
/u/local/apps/submit_scripts/matlab_compile_and_submit_noSingleCompThreads.sh [-t time in hours]
[ -s number of processes ] [-m memory per process (in GB)]
[-p parallel environment: 1 for shared 2 for distributed]
[-a add file or entire directory to the deployable archive] ...
[-a add other file or other entire directory to the deployable archive]
[-I add directory to the list of included directories] ...
[-I add other directory to the list of included directories]
[-f main matlab function] [-f matlab function 2] ... [-f matlab function n]
[-ns (to build a submission script without submitting the job)]
[-nts (to not addtime stamp to cmd file name)]
[-hp to run on owned nodes] [ --help ]
to submit the MATLAB script myscript.m or batch execution you can then use, for example:
$ /u/local/apps/submit_scripts/matlab_compile_and_submit_noSingleCompThreads.sh =t 3 -m 10 -f myscript.m
The following queue scripts are also available for MATLAB (however they are currently unsupported):
$ matlab.q
runs single or multi-processor in two steps: compile and execute. The matlab.q script will compile the MATLAB files into a stand-alone program so that the execution of MATLAB files on computers will not require a MATLAB license at run time. For serial or implicit multi-threaded MATLAB code, no extra work will be needed to run MATLAB .m files using matlab.q in most cases.
$ mcc.q
uses the MATLAB compiler to create a stand-alone executable. If you are using mcc.q interactively, it will ask you if you want the executable produced by mcc to use a single processor or not. If you are using mcc.q in command line mode, to create an executable that will run on a single processor specify this argument:
-R -singleCompThread
To run a previously generated matlab stand alone executable (generated with the MATLAB compiler) use:
$ matexe.q
runs a MATLAB stand-alone executable created with mcc.
Please refer to the MATLAB documentation to learn how to use this software.
Note
The MATLAB Parallel Server configuration described in this tab (MATLAB R2020b) is for the Grid Engine (legacy) cluster. On the Slurm cluster, run MATLAB batch jobs as shown in the Slurm batch tab; if you need the MATLAB Parallel Server with Slurm, please open a ticket.
On the Grid Engine (legacy) cluster, dispatch MATLAB batch jobs via the Parallel Computing Toolbox and the MATLAB Parallel Server running on the cluster. You can dispatch MATLAB batch jobs from a MATLAB desktop running either on your local computer or a Matlab desktop running on the cluster.
Please see MATLAB Access for University of California Los Angeles to lern how to install MATLAB on your local computer.
Note
Currently MATLAB version R2020b is supported on the Hoffman2 Cluster. Make sure to download locally this version of MATLAB.
Once you have installed MATLAB on your personal computer you will need to configure the local instance of the MATLAB Parallel Server so that it can dispatch jobs on the Hoffman2 Cluster. To do so follow these steps:
Transfer the archival file:
/u/local/apps/matlab/PARALLEL_TOOLBOX_SETUP/UCLA.nonshared.R2020b.zip
from the Hoffman2 Cluster to your local computer the file. Unzip the file in your local:
$MATLABROOT/toolbox/local
directory. This location will change with your specific OS. For example, on a Mac and for MATLAB version R2020b, open the Terminal application and at the command line issue:
$ cd /Applications/MATLAB_R2020b.app/toolbox/local
$ unzip ~/Downloads/UCLA.nonshared.R2020b.zip
Start MATLAB and at the MATLAB prompt issue:
>> rehash toolboxcache
>> configCluster
You will be prompted to enter your Hoffman2 Cluster username. Jobs will now be executed on Hoffman2.
If you decide to execute jobs locally use:
>> c = parcluster('local');
Log on the Grid Engine (legacy) cluster so that you can open the MATLAB desktop (see: GE interactive). Get an interactive session with the needed resources (e.g., run-time, memory, number of cores), for example with:
$ qrsh -l h_rt=1:00:00,h_data=12G
start the MATLAB desktop with:
$ module load matlab/R2020b
$ matlab &
at the MATLAB prompt issue:
>> rehash toolboxcache
>> configCluster
Jobs will now be submitted via the scheduler, if you decide to execute them on the local node where your MATLAB desktop is running, type:
>> c = parcluster('local');
If you already have a MATLAB script that you would like to submit to the cluster from the terminal command line (i.e., without opening the MATLAB desktop) you can do so using the script:
$ /u/local/apps/submit_scripts/MATLAB_PARALLEL_BATCH_SUBMISSION/matlab_batch_parallel_job_submit.sh
to see how the script work issue:
$ /u/local/apps/submit_scripts/MATLAB_PARALLEL_BATCH_SUBMISSION/matlab_batch_parallel_job_submit.sh --help
to learn more see:
$ /u/local/apps/submit_scripts/MATLAB_PARALLEL_BATCH_SUBMISSION/README.HOWTO
Before running jobs on the cluster you should make sure to specify scheduler parameters to be passed to your job. To do so open MATLAB and type commads similar to what shown below (you will need to change the parameters to fit your job needs):
>> % Get a handle to the cluster
>> c = parcluster;
>> % Specify the walltime (e.g. 5 hours)
>> c.AdditionalProperties.WallTime = '05:00:00';
>> % Specify memory to use for MATLAB jobs
>> c.AdditionalProperties.MemUsage = '8G';
>> % Specify the number of GPU Nodes requested (currently limited to 1 node)
>> c.AdditionalProperties.GpuNodes = 1;
>> % Specify the type of GPU
>> c.AdditionalProperties.GpuType = 'V100';
>> % Specify special submissions flags (e.g., exclusive, highp, etc…)
>> c.AdditionalProperties.AdditionalSubmitArgs='-l exclusive -l highp'
>> % Save changes:
>> c.saveProfile
>> % Check current properties:
>> c.AdditionalProperties
>> % Change or remove one of the properties, e.g.:
>> c.AdditionalProperties.AdditionalSubmitArgs = '';
>> c.saveProfile
Submit simple matlab job that checks the location of your $HOME directory on the cluster:
>> % Get a handle to the cluster
>> c = parcluster;
>> % Submit job to query from which directory is MATLAB running on the cluster
>> j = c.batch(@pwd, 1, {}, 'CurrentFolder', '.', 'AutoAddClientPath',false);
>> % Query job for state
>> j.State
>> % If state is finished, fetch the results
>> j.fetchOutputs{:}
>> % Delete the job after results are no longer needed
>> j.delete
To retrieve a list of running or completed jobs and view results:
>> c = parcluster;
>> jobs = c.Jobs;
>> % Get a handle to the job with ID 2
>> j2 = c.Jobs(2);
>> % Fetch results for job with ID 2
>> j2.fetchOutputs{:}
Please refer to the MATLAB documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
NCO
“The NCO toolkit manipulates and analyzes data stored in netCDF-accessible formats, including DAP, HDF4, and HDF5. It exploits the geophysical expressivity of many CF (Climate & Forecast) metadata conventions, the flexible description of physical dimensions translated by UDUnits, the network transparency of OPeNDAP, the storage features (e.g., compression, chunking, groups) of HDF (the Hierarchical Data Format), and many powerful mathematical and statistical algorithms of GSL (the GNU Scientific Library). NCO is fast, powerful, and free.” – The NCO website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use NCO, use the module command:
module load nco
You will then be able to invoke NCO’s binaries (i.e., ncap2, ncatted, ncbo, ncclimo, nces, ncecat, ncflint, ncks, ncpdq, ncra, ncrcat, ncremap, ncrename, ncwa) from the command line.
Please refer to the NCO documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the NCO you will need to create a submission script similar to:
### NCO_submit.sh START ###
#!/bin/bash
#$ -cwd
# error = Merged with joblog
#$ -o joblog.$JOB_ID
#$ -j y
# Edit the line below to request the appropriate runtime and memory
# (or to add any other resource) as needed:
#$ -l h_rt=1:00:00,h_data=1G
# Add multiple cores/nodes as needed:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
# Notify when
#$ -m bea
# echo job info on joblog:
echo "Job $JOB_ID started on: " `hostname -s`
echo "Job $JOB_ID started on: " `date `
echo " "
# load the job environment:
. /u/local/Modules/default/init/modules.sh
module load NCO
# substitute the command to run the needed NCO command (e.g.: ncap2,
# ncatted, ncb,o ncclimo, nces, ncecat, ncflint, ncks, ncpdq, ncra,
# ncrcat, ncremap, ncrename or ncwa) below:
echo '$SAMPLECOMMAND'
$SAMPLECOMMAND
# echo job info on joblog:
echo "Job $JOB_ID ended on: " `hostname -s`
echo "Job $JOB_ID ended on: " `date `
echo " "
### NCO_submit.sh STOP ###
where you would replace the resources requested and the NCO command as needed. Save the NCO_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
chmod u+x NCO_submit.sh
Submit the job with:
qsub NCO_submit.sh
Please refer to the `NCO documentation <http://nco.sourceforge.net/nco.html>`__ to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Octave
GNU Octave is software featuring a high-level programming language, primarily intended for numerical computations. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with MATLAB. For more information, see the GNU Octave website.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use Octave, use the module command:
$ module load octave
See How to use the module command for further information.
Please refer to the Octave documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
OpenSees
“OpenSees, the Open System for Earthquake Engineering Simulation, is an object-oriented, open source software framework. It allows users to create both serial and parallel finite element computer applications for simulating the response of structural and geotechnical systems subjected to earthquakes and other hazards. OpenSees is primarily written in C++ and uses several Fortran and C numerical libraries for linear equation solving, and material and element routines.” – OpenSees Wiki website.
On the Hoffman2 Cluster, OpenSees and OpenSeesMP is installed as an Apptainer container. This container is located on the Hoffman2 Cluster at $H2_CONTAINER_LOC/h2-opensees_3.3.0.sif
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as Apptainer containers (OpenSees 2.4.4, 3.3.0, 3.4.0 and 3.5.0). To see the installed versions, use module load apptainer and then ls $H2_CONTAINER_LOC/h2-opensees* on either cluster.
You can use any text editor to make the appropriate input files for OpenSees.
On the Slurm cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
At the compute node shell prompt, enter:
$ module purge
$ module load apptainer/1.3.4
$ apptainer exec $H2_CONTAINER_LOC/h2-opensees_3.5.0.sif OpenSees sample.tcl
where sample.tcl is your input file, or open a shell in the container (the prompt changes to Apptainer>) and run OpenSees, OpenSeesSP or OpenSeesMP from there:
$ apptainer shell $H2_CONTAINER_LOC/h2-opensees_3.5.0.sif
Apptainer> OpenSees
Please see the OpenSees documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for opensees.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
At the compute node shell prompt, enter:
$ module load apptainer
$ apptainer shell $H2_CONTAINER_LOC/h2-opensees_3.3.0.sif
$ OpenSeesMP
Please see the OpenSees documentation to learn how to use this software.
To submit a batch job with OpenSees on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q), giving it the apptainer exec ... command line shown below as the command to run:
$ job.q -p apptainer
or create a job script similar to:
### opensees_submit.job START ###
#!/bin/bash
#SBATCH --job-name=opensees
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=opensees.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load apptainer/1.3.4
module list
# keep the Apptainer cache out of your $HOME:
export APPTAINER_CACHEDIR=$TMPDIR/apptainer_cache
# run OpenSees (serial) from its container on the input file sample.tcl:
apptainer exec $H2_CONTAINER_LOC/h2-opensees_3.5.0.sif OpenSees $HOME/myproject/sample.tcl
echo "Job $SLURM_JOB_ID ended at $(date)"
### opensees_submit.job STOP ###
where you would replace the account, the resources requested, the container version and the name and location of your input file as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate opensees_submit.job
$ sbatch opensees_submit.job
The script above runs OpenSees in serial. Running OpenSeesMP in parallel (with MPI) from the container has not yet been documented for the Slurm cluster: if you need it, please open a ticket.
On the Grid Engine (legacy) cluster, to run OpenSees and OpenSeesMP, you will need to load Apptainer
The following queue script is available for opensees to run in Serial
### submit_opensees_ser.sh START ### #!/bin/bash #$ -cwd # error = Merged with joblog #$ -o joblog.$JOB_ID #$ -j y # Edit the line below to request the appropriate runtime and memory # (or to add any other resource) as needed: #$ -l h_rt=1:00:00 # Email address to notify #$ -M $USER@mail # Notify when #$ -m bea # echo job info on joblog: echo "Job $JOB_ID started on: " `hostname -s` echo "Job $JOB_ID started on: " `date ` echo "Job $JOB_ID will run on: " cat $PE_HOSTFILE echo " " # load the job environment: . /u/local/Modules/default/init/modules.sh module load apptainer # Runing OpenSeesMP in serial time apptainer exec $H2_CONTAINER_LOC/h2-opensees_3.3.0.sif OpenSeesMP sample.tcl > output.$JOB_ID # echo job info on joblog: echo "Job $JOB_ID completed on: " `hostname -s` echo "Job $JOB_ID completed on: " `date ` echo " " ### submit_opensees_ser.sh STOP ###To use OpenSeesMP in parallel, you will need to load the intel module and use mpirun
### submit_opensees_par.sh START ### #!/bin/bash #$ -cwd # error = Merged with joblog #$ -o joblog.$JOB_ID #$ -j y # Edit the line below to request the appropriate runtime and memory # (or to add any other resource) as needed: #$ -l h_rt=1:00:00 # Email address to notify #$ -M $USER@mail # Notify when #$ -m bea #$ -pe dc* 8 # echo job info on joblog: echo "Job $JOB_ID started on: " `hostname -s` echo "Job $JOB_ID started on: " `date ` echo "Job $JOB_ID will run on: " cat $PE_HOSTFILE echo " " # load the job environment: . /u/local/Modules/default/init/modules.sh module load apptainer module load intel # Runing OpenSeesMP in parallel `which mpirun` -np $NSLOTS apptainer exec $H2_CONTAINER_LOC/h2-opensees_3.3.0.sif OpenSeesMP sample.tcl > output.$JOB_ID # echo job info on joblog: echo "Job $JOB_ID completed on: " `hostname -s` echo "Job $JOB_ID completed on: " `date ` echo " " ### submit_opensess_par.sh STOP ###Please see the OpenSees documentation to learn how to use this software.
References:
Problems with the instructions on this section? Please send comments here.
Physics
CERN ROOT
ROOT is an object-oriented program and library developed by CERN. It was originally designed for particle physics data analysis and contains several features specific to this field, but it is also used in other applications such as astronomy and data mining. For more information, see the ROOT website.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=2G,h_rt=1:00:00
Use qrsh to obtain a session on a compute node. Then enter:
$ module load cern-root
$ root
To exit the cint C++ interpreter, at the ROOT prompt, enter:
.q
References:
Problems with the instructions on this section? Please send comments here.
Geant4
“Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science. “ – Geant4
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
$ qrsh -l h_data=5G,h_rt=1:00:00 -pe shared 1
To set up your environment to use Geant4, use the module command:
$ module load gcc/8.30
$ module load geant4
To test the installation:
$ module load gcc/8.30; module load geant4
$ cp -rp /u/local/apps/geant4/11.0.1/gcc-8.3.0/examples/basic/B1 ./
$ cd B1
$ mkdir build
$ cd build
$ cmake ..
References:
Problems with the instructions on this section? Please send comments here.
Statistics
R
R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis. For more information, see the R-project website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider R on the Slurm cluster and module av R on the Grid Engine cluster.
You can use any text editor to make the appropriate input files for R. RStudio, an IDE for R, can be used to prepare R scripts.
On the Slurm cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example:
$ srun --time=01:00:00 --mem=4G --pty bash -l
At the compute node shell prompt, enter:
$ module purge
$ module load R/4.6.1
$ R
To see which versions of R are installed on the Slurm cluster use:
$ module spider R
and load the version you need with module load R/VERSION. If your R code runs in parallel (e.g., with the parallel package), request the cores with --cpus-per-task and use $SLURM_CPUS_PER_TASK as the number of workers.
Please refer to the R documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for R. RStudio, an IDE for R, can be used to prepare R scripts.
Request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example:
$ qrsh -l h_data=2G,h_rt=1:00:00
At the compute node shell prompt, enter:
$ module load R
$ R
To see which versions of R are installed on the cluster use:
$ module av R
to load a different version of R issue:
$ module load R/VERSION
where: VERSION is the needed version.
Please refer to the R documentation to learn how to use this software.
Problems with the instructions on this section? Please send comments here.
On the Slurm cluster, the easiest way to submit an R batch job is with job.q, which writes the job script for you, checks it with h2 validate and submits it (see Building a job script with job.q). Run it from the directory that holds your R script:
$ job.q
and enter R at the first prompt, then choose the version. You can also give the answers on the command line; for example, to run myscript.R with R 4.6.1, 4 GB of memory and a runtime of 1 hour, passing it the argument 100:
$ job.q -p R/4.6.1 -n myscript.R -m 4 -t 1 -arg 100
job.q asks for the answers it doesn’t have, shows the job script and asks whether to submit it. Add -y to accept the defaults for everything else and submit without asking, or -ns to write the script without submitting it. To see the R versions installed, use module spider R.
To write the job script yourself instead, create a file similar to:
### R_submit.job START ###
#!/bin/bash
#SBATCH --job-name=myscript
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=myscript.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load R/4.6.1
module list
# run the R script (use its full path):
Rscript $HOME/myproject/myscript.R
echo "Job $SLURM_JOB_ID ended at $(date)"
### R_submit.job STOP ###
where you would replace the account, the resources requested, the R version and the R script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate R_submit.job
$ sbatch R_submit.job
To run a batch job with the version of R provided with RStudio Server, see RStudio Server.
On the Grid Engine (legacy) cluster, there are several ways to submit R batch jobs:
using the wrapper script, R_job_submitter.sh, that allows you to request a specific version of R and computational resources
using the sample submission script, R_submit.sh, provided below
using R.q which will force you to use a fixed version of R
if you intend to run a batch job using the version of R provided with Rstudio Server please refer to RStudio Server
$ /u/local/apps/submit_scripts/R_job_submitter.sh
the script allow you to select the R version and pass several arguments as shown below:
Usage:
/u/local/apps/submit_scripts/R_job_submitter.sh [-n R script name]
[-m memory per slot (in GB)] [-t time in hours] [-hp to run on owned nodes]
[-ex to run exclusively] [-s number of slots] [-v R version]
[-arg argument 1 to pass to R script] [-arg argument 2 to pass to R script]
... [-arg argument n to pass to R script]
[-ns (to build a submission script without submitting the job)]
[-nts (to not add time stamp to cmd file name)] [ --help ]
For example, to submit an R script, myscript.R, using R version 4.0.2, 4GB of memory and a runtime of 1 hour:
$ /u/local/apps/submit_scripts/R_job_submitter.sh -v 4.0.2 -m 4 -t 1 -n myscript.R
the command above will return something similar to:
Running myscript.R on 1 processes each with 4GB of memory for 1 hours
Your job 4264527 ("myscript_2020-09-02_18-11-23.cmd") has been submitted
this means that a submission script named myscript_2020-09-02_18-11-23.cmd was generated and submitted to the queues. To remove the time stamp from the submission script name you can add the -nts flag to your command, i.e.:
$ /u/local/apps/submit_scripts/R_job_submitter.sh -v 4.0.2 -m 4 -t 1 -n myscript.R -nts
you can check the status of your submission with:
$ myjobs
To submit a job for batch execution with R, you will need to create a submission script similar to:
### R_submit.sh START ###
#!/bin/bash
#$ -cwd
#$ -o joblog.$JOB_ID
#$ -j y
# Resources requested
# PLEASE CHANGE THE RESOURCES REQUESTED AS NEEDED:
#$ -l h_data=4G,h_rt=1:00:00
# PLEASE CHANGE THE NUMBER OF CORES REQUESTED AS NEEDED:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
#$ -m bea
# #$ -V
#
# Output job info on joblog file:
#
echo " "
echo "Job myscript, ID no. $JOB_ID started on: "` hostname -s `
echo "Job myscript, ID no. $JOB_ID started at: "` date `
echo " "
#
# Set up job environment:
#
. /u/local/Modules/default/init/modules.sh
module load R
# SHOULD YOU NEED TO LINK TO ANY PARTICULAR LIBRARY, USE:
# export LD_LIBRARY_PATH=/path/to/libdir/if/needed:$LD_LIBRARY_PATH
# SHOULD YOU NEED TO CHANGE THE LOCATION OF THE R TEMPORARY DIRECTORY:
# if [ ! -d $SCRATCH/R_scratch ]; then
# mkdir $SCRATCH/R_scratch
# fi
# export TMPDIR=$SCRATCH
#
# Run the R script:
#
echo " "
# (SUBSTITUTE THE NAME OF YOUR R SCRIPT AND OUTPUT BELOW):
echo R CMD BATCH --no-save --no-restore myscript.R output.$JOB_ID
# (SUBSTITUTE THE NAME OF YOUR R SCRIPT AND OUTPUT BELOW):
/usr/bin/time -v R CMD BATCH --no-save --no-restore myscript.R output.$JOB_ID
#
echo " "
echo "Job myscript, ID no. $JOB_ID finished at: "` date `
echo " "
### R_submt.sh STOP ###
where, in the highlighted lines, you would replace the resources requested and the name of the R script and output file as needed. Save the R_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x R_submit.sh
Submit the job with:
$ qsub R_submit.sh
The script R.q is also available to submit R serial jobs.
Please refer to the R documentation to learn how to use this software.
Problems with the instructions on this section? Please send comments here.
On the Slurm cluster, start a Jupyter Notebook/Lab session with the Slurm version of h2jupynb (see Jupyter Notebook/Lab with h2jupynb); to add R kernels follow R kernels, using an srun ... --pty bash -l interactive session instead of qrsh and the R versions listed by module spider R.
On the Grid Engine (legacy) cluster, Jupyter Notebook/Lab can be used to develop and run R very effectively. After opening a Jupyter Notebook/Lab on your locally running browser while harnessing the computing power of the Hoffman2 Cluster (see: Connecting via Jupyter Notebook/Lab to learn how to do so), you can start an R notebook by selecting the needed version of R from the New pulldown menu.
How to start an R Jupyter Notebook by clicking on the New pulldown menu in the classic Jupyter Notebook view.
Within a Jupyter Lab, an R notebook can be started clicking on the Launcher R icon.
How to start an R Jupyter Notebook by clicking on the R icon on in the Jupyter Lab Launcher window.
Jupyter notebooks combine the many aspects of classic IDEs and they have the added bonus of displaying results very fast as the graphic is rendered on the local client.
R Jupyter Notebook with R code implementing the booostrapping approximation of \({\pi}\) and a plot showing a visual approximation of \({\pi}\)
Please refer to the R documentation to learn how to use this software.
Problems with the instructions on this section? Please send comments here.
References:
R Libraries
R includes a set of base packages and additional add-on libraries. Several additional libraries have already been installed in any version of R available on the Hoffman2 Cluster (to see all versions currently available use: modules_lookup -m R). To see a list of the installed libraries, at the R command prompt, enter:
> library()
Additional libraries can be installed in each user directory where they are available to the particular user who has performed the installation. If a group project space is available, R libraries of common use for a group can also be installed in a group project space where they can be made available to all the users of such group.
Additional libraries not already installed with the versions of R available on the cluster (to see all versions currently available use module spider R on the Slurm cluster and modules_lookup -m R on the Grid Engine cluster), can be installed in a personal R library directory. On the Slurm cluster, each R module sets R_LIBS_USER to a personal library directory for that version of R (e.g., $HOME/R/4.6.1/gcc-11.5.0_intel-2026.2.0), so install.packages installs there directly. To install a library and its dependencies in this location you will need to run R interactively and issue at the R command line:
> install.packages('package_name', dependencies=TRUE)
R will inform you that you can’t write to the global directory, and ask if you want to use a personal library instead. When prompted answer yes. R will then prompt you with a path and ask if you want to use this. When prompted answer yes. R will then install the library in this location.
See the R Installation and Administration guide for more information on how to customize the install.packages command (for example you could add the repository by including in the argument of your install.packages command the string: repos=”http://cran.r-project.org”).
To see a list of directories that R searches for libraries issue at the R prompt:
> .libPaths()
Problems with the instructions on this section? Please send comments here.
If your group has purchased additional storage and you would like to perform an installation of certain R libraries that would be available to all of your group, you should follow these steps:
First, request the creation of a shared directory in your group space by opening a ticket at: https://support.idre.ucla.edu/helpdesk or sending an email to hpc@ucla.edu.
On the Slurm cluster, after the shared directory has been created, start an interactive session, load the needed version of R and install the packages in a directory named after it, for example for R/4.6.1 (in the code below update the name of the common directory as needed):
$ srun --time=02:00:00 --mem=10G --pty bash -l
$ module purge
$ module load R/4.6.1
$ mkdir -p /u/project/bruinsponsor/apps/R/4.6.1
$ export R_LIBS_SITE=/u/project/bruinsponsor/apps/R/4.6.1:$R_LIBS_SITE
$ R # at the R prompt check that the common directory is in .libPaths():
> .libPaths()
> install.packages('smile', lib='/u/project/bruinsponsor/apps/R/4.6.1')
To use the packages from this common directory, set R_LIBS_SITE in the same way (in your interactive session or in your job script, after module load R/4.6.1) before starting R.
On the Grid Engine (legacy) cluster, follow these steps:
Create an
R/<VERSION>(to see all versions currently available use:modules_lookup -m R) directory in your project directory, for example if your project group is calledbruinsponsor, the shared directory is calledappsand the version ofRfor which you intend to install supplemental libraries is4.2.2, compiled withgcc/10.2.0(available via the modulefiles:module load gcc/10.2.0; module load R/4.2.2), you would issue:Note
In the current example the project common directory is:
/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0You will need to update the name of this directory to reflect the name of your project directory and the desired version of R. To see all version of R available use the command:
$ modules_lookup -m R
in the code below update the name of the common directory as needed.
$ mkdir -p /u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0 # change the name as needed
Install packages the project common directory:
Note
In the current example the project common directory is:
/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0in the code below update the name of the common directory as needed.
$ qrsh -l h_data=10G $ module load gcc/10.2.0; module load R/4.2.2 $ mkdir -p /u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0 $ export R_LIBS_SITE=/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0:$R_LIBS_SITE $ # start R: $ R # at the R prompt check R libraries location: > .libPaths() # this should give you: [1] "/u/home/j/joebruin/R/x86_64-pc-linux-gnu-library-RH7/4.2.2/intel2022.1.1_gcc10.2.0" [2] "/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0" [3] "/u/local/apps/R/4.2.2/gcc10.2.0_intel2022.1.1/lib64/R/library" > # start the library installation, e.g., for package smile: > install.packages('smile',lib=.libPaths()[2]) > # or for packages from Bioconductor: > if (!requireNamespace("BiocManager", quietly = TRUE)) + install.packages("BiocManager",lib = .libPaths()[2]) > BiocManager::install(c("BiocParallel", "callr", "xfun","xml2"), update = TRUE, lib = .libPaths()[2])
Warning
In general only one user in the group will have write permission to the
/u/project/bruinsponsor/appsdirectory.Use packages from this common directory:
Note
In the current example the project common directory is:
/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0in the code below please update the name of the common directory to reflect your own.
$ qrsh -l h_data=10G $ module load gcc/10.2.0; module load R/4.2.2 $ export R_LIBS_SITE=/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0:$R_LIBS_SITE $ R # start R and at the R prompt check R libraries location: > .libPaths() # this should give you: [1] "/u/home/j/joebruin/R/x86_64-pc-linux-gnu-library-RH7/4.2.2/intel2022.1.1_gcc10.2.0" [2] "/u/project/bruinsponsor/apps/R/4.2.2_gcc_10.2.0" [3] "/u/local/apps/R/4.2.2/gcc10.2.0_intel2022.1.1/lib64/R/library"
Problems with the instructions on this section? Please send comments here.
Note
The R library rJava, a low-level R to Java interface, depends on the exact java version on the computing node. As it may happen that the default version of java on different computational nodes slightly differs (which may be due to an update in progress), rJava may appears to not work on some nodes. In this cases we suggest to modify the R command as follows:
On the Slurm cluster:
$ srun --time=01:00:00 --mem=5G --pty bash -l # request enough memory to start java
$ module purge
$ module load R/4.6.1
$ R CMD javareconf -e
$ R CMD BATCH filename
In a Slurm job script, add the R CMD javareconf -e line after module load R/VERSION.
On the Grid Engine (legacy) cluster:
$ qrsh -l h_data=5G # request enough memory to start java
$ module load R
$ R CMD javareconf -e
$ R CMD BATCH filename
For sh-based scripts use:
$ . /u/local/Modules/default/init/modules.sh
$ module load R
$ R CMD javareconf -e
$ R CMD BATCH filename
For csh-based scripts use:
$ source /u/local/Modules/default/init/modules.csh
$ module load R
$ R CMD javareconf -e
$ R CMD BATCH filename
Note
You may need to update the module load R command to reflect a preferred version of R. To see all version of R available use the command:
$ modules_lookup -m R
Please refer to the R documentation to learn how to use this software.
Problems with the instructions on this section? Please send comments here.
R libraries references:
https://hbctraining.github.io/Intro-to-R-flipped/lessons/04_introR_packages.html
https://cran.r-project.org/web/packages/available_packages_by_name.html
https://cran.r-project.org/web/packages/devtools/readme/README.html
Additional libraries, that are of relevant usage to the Hoffman2 Cluster community, can also be installed in the central repository upon request. See the Software installation page.
Problems with the instructions on this section? Please send comments here.
RStudio
RStudio is an integrated development environment for R, a programming language for statistical computing and graphics. For more information, see the RStudio website.
On the Hoffman2 Cluster, you can run either the RStudio IDE or RStudio Server versions.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions of the RStudio IDE, use module spider rstudio on the Slurm cluster and module av Rstudio on the Grid Engine cluster. The RStudio Server containers are available on both clusters (module load apptainer and then ls $H2_CONTAINER_LOC/h2-rstudio*sif).
RStudio IDE
RStudio IDE (formerly known as RStudio Desktop) is a standalone desktop version that can be launched on a compute node on the Hoffman2 Cluster. To open the RStudio IDE GUI, users need to follow the steps outlined in the opening GUI applications section. RStudio Desktop supports all versions of R that are installed on the Hoffman2 Cluster.
Warning
To open the RStudio IDE GUI on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session). Do not use srun --x11 for RStudio: Slurm’s X11 forwarding can deadlock with it and freeze your whole DCV desktop.
On the Slurm cluster, from a terminal on the DCV desktop, request an interactive session for GUI applications with the resources (memory and/or cores, computing time, etc.) that your R scripts will be needing, for example, for 2 cores with 4GB of memory each for 2 hours:
$ x11session --time=02:00:00 --mem-per-cpu=4G -c 2
At the compute node shell prompt, enter:
$ module purge
$ module load rstudio/2026.10.0
$ rstudio &
(to see the installed versions use module spider rstudio; note the lower-case module name on the Slurm cluster).
Note
The RStudio module loads the default version of R on the Slurm cluster. To use a different version of R, load the needed R module first (e.g., module load R/4.4.1, see module spider R) and then the RStudio module.
If RStudio’s Save As or Open dialogs fail to open, uncheck .
Warning
To open the RStudio IDE GUI, you MUST connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. If you do not follow these steps, you will not be able to open the RStudio GUI.
On the Grid Engine (legacy) cluster, to run Rstudio, first start an interactive session using qrsh requesting the correct amount of resources (memory and/or cores, computing time, etc.) that your R scripts will be needing.
Request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example, to request one computational core with 2GB or memory for 1 hour, issue at cluster command prompt:
$ qrsh -l h_data=5G,h_rt=1:00:00
At the compute node shell prompt, enter:
$ module load Rstudio
$ rstudio &
Note
The RStudio module will load into your environment the current default version of R on the cluster unless you have an R module already loaded. To witch versions of R simply load the needed R module before opening Rstudio.
References:
Problems with the instructions on this section? Please send comments here.
RStudio Server
RStudio Server allows users to start an RStudio session on a compute node that can be accessed through a web browser running on the local computer. As RStudio Server is executed inside a software container accessible via Apptainer, the version of R available to this version of RStudio is limited to the one installed within the container. RStudio Server bypasses the need to access a GUI application remotely, thus avoiding any associated inefficiencies.
The RStudio Server application is ran using Apptainer on a compute node to be rendered on a web browsed running on your local machine.
To find available RStudio container versions on the Hoffman2 Cluster issue the following commands from a terminal:
module load apptainer
ls $H2_CONTAINER_LOC/h2-rstudio*sif
You can follow these steps to start a RStudio Server session on the Slurm cluster:
Open a terminal and connect to the Hoffman2 Cluster (
hoffman2.oarc.ucla.edu), request an interactive session and start RStudio Server in it:# get an interactive session: srun --time=02:00:00 --mem=10G --pty bash -l # create small tmp directories for RStudio to write into: mkdir -pv $SCRATCH/rstudiotmp/var/lib $SCRATCH/rstudiotmp/var/run $SCRATCH/rstudiotmp/tmp # set up apptainer: module purge module load apptainer/1.3.4 # run RStudio Server (to use a different version of R, choose another # container from: ls $H2_CONTAINER_LOC/h2-rstudio*sif): apptainer run -B $SCRATCH/rstudiotmp/var/lib:/var/lib/rstudio-server -B $SCRATCH/rstudiotmp/var/run:/var/run/rstudio-server -B $SCRATCH/rstudiotmp/tmp:/tmp $H2_CONTAINER_LOC/h2-rstudio_4.5.0.sif
As described in the GE interactive tab, the
apptainer run ...command prints the node and the port on which RStudio Server is listening, the SSH tunnel command to run on your local computer and the temporary password for the session.Important
The tunnel command printed by the container names the legacy login host,
hoffman2.idre.ucla.edu. For a session on the Slurm cluster, usehoffman2.oarc.ucla.eduinstead.Open a new terminal window on your local computer and start the SSH tunnel. For example, user
joebruinwhose RStudio Server session started on node n1234 and on port 8787 would run:$ ssh -N -L 8787:n1234:8787 joebruin@hoffman2.oarc.ucla.edu
Open your web browser to
http://localhost:8787(use your port) and log in with your Hoffman2 Cluster user name and the temporary password.
To end the session, press Control-C in the terminal where apptainer run ... is running, then exit the interactive session.
On the Grid Engine (legacy) cluster, you can follow these steps to start a RStudio Server session:
Open a terminal and connect to the Hoffman2 Cluster, at the cluster command prompt issue:
# get an interactive job qrsh -l h_data=10G # Create small tmp directories for RStudio to write into mkdir -pv $SCRATCH/rstudiotmp/var/lib mkdir -pv $SCRATCH/rstudiotmp/var/run mkdir -pv $SCRATCH/rstudiotmp/tmp #Setup apptainer module load apptainer ## Run rstudio ## ## NOTE: you can change the version of R by selecting a different RStudio container ## ## use: ## ## module load apptainer; ls $H2_CONTAINER_LOC/h2-rstudio*sif ## ## to see which versions are available ## apptainer run -B $SCRATCH/rstudiotmp/var/lib:/var/lib/rstudio-server -B $SCRATCH/rstudiotmp/var/run:/var/run/rstudio-server -B $SCRATCH/rstudiotmp/tmp:/tmp $H2_CONTAINER_LOC/h2-rstudio_4.1.0.sif ## This command will display the following information: ## ## This is the Rstudio server container running R 4.3.2 from Rocker ## ## This is a separate R version from the rest of Hoffman2 ## When you install libraries from this Rstudio/R, they will be in ~/R/APPTAINER/h2-rstudio_4.3.2 ## ## ## Your Rstudio server is running on: <NODE> ## It is running on PORT: <PORT> ## ## Open a SSH tunnel on your local computer by running: ## ssh -N -L <PORT>:<NODE>:<PORT> <YOUR_H2C_USERNAME>@hoffman2.idre.ucla.edu ## ## Then open your web browser to http://localhost:<PORT> ## ## Your Rstudio Password is: <TEMPORARY_PASSWORD> ## Please run [CTRL-C] on this process to exit Rstudio ## ## You will need to run the `ssh -N -L ...` command on a separate terminal on your local computer ## ## ***USE THE <TEMPORARY_PASSWORD> WHEN RSTUDIO SERVER OPENS ON YOUR LOCAL BROWSER*** ##
After the
apptainer run ...command you will be prompted with information regarding the version of R and Rstudio, the node where the Rstudio session is running and the port through which the application is listening. There will also be three lines of instructing you on how to initiate an SSH tunnel on your local computer in order to be able to connect with your local browser to the Rstudio session running remotely on the cluster compute node, you will also be prompted with the temporary password which you will need to open the RStudio Server session on your browser. These instructions are relevant for the next steps and are highlighted in the sample output of theapptainer run ...command given below:$ apptainer run -B $SCRATCH/rstudiotmp/var/lib:/var/lib/rstudio-server -B $SCRATCH/rstudiotmp/var/run:/var/run/rstudio-server -B $SCRATCH/rstudiotmp/tmp:/tmp $H2_CONTAINER_LOC/h2-rstudio_4.1.0.sif INFO: Converting SIF file to temporary sandbox... This is the Rstudio server container running R 4.3.2 from Rocker This is a separate R version from the rest of the Hoffman2 Cluster When you install libraries from this Rstudio/R, they will be in ~/R/APPTAINER/h2-rstudio_4.3.2 Your Rstudio server is running on: <NODE> It is running on PORT: <PORT> Open a SSH tunnel on your local computer by running: ssh -N -L <PORT>:<NODE>:<PORT> <YOUR_H2C_USERNAME>@hoffman2.idre.ucla.edu Then open your web browser to http://localhost:<PORT> Your Rstudio Password is: <TEMPORARY_PASSWORD> Please run [CTRL-C] on this process to exit Rstudio
where
<NODE>is the name of the actual compute node where the Rstudio session is running, <PORT> is the number corresponding to the port on which the RStudio Server is running,<YOUR_H2C_USERNAME>is your Hoffman2 Cluster User ID and<TEMPORARY_PASSWORD>is the temporary password you will need to log onto the RStudion Server session. Make note of these instructions as they will be needed in the next step of the setup.Important
The version of R that you are running on RStudio Server does not correspond to any of the R versions available on the cluster via:
module av R. If you would like to run batch jobs with this version of R you will need to follow the information given in the tab of RStudio Server.Open a new terminal window on your local computer and initiate the SSH tunnel as indicated in the terminal in which the
apptainer run ...command was executed. For example, userjoebruinwhose RStudion Server which started on node n1234 and on port 8787, will need to run the SSH Port Forwarding command:
$ ssh -N -L 8787:n1234:8787 joebruin@hoffman2.idre.ucla.eduAfter issuing the SSH Port Forwarding command you will be prompted for your password and, if the SSH tunnel is successful the prompt will not return on this terminal (until the RStudio Server session is running). If you desire to free your terminal for other uses you can issue instead:
$ ssh -f -N -L <PORT>:<NODE>:<PORT> <YOUR_H2C_USERNAME>@hoffman2.idre.ucla.eduwhere
<NODE>is the name of the actual compute node where the Rstudio session is running,<PORT>is the number corresponding to the port on which the RStudio Server is running,<YOUR_H2C_USERNAME>is your Hoffman2 Cluster User ID.
You can also run the version of R available with RStudio Server in a batch job on the Slurm cluster, starting R from the software container where RStudio Server is installed, so that you can use the R libraries and packages that you have already installed from within an RStudio Server session. Create a job script similar to:
### rstudio_r_submit.job START ###
#!/bin/bash
#SBATCH --job-name=rstudio_r
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=10G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=rstudio_r.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load apptainer/1.3.4
module list
# keep the Apptainer cache out of your $HOME:
export APPTAINER_CACHEDIR=$TMPDIR/apptainer_cache
# use the R libraries you installed from RStudio Server with this container
# (update both lines if you use a different h2-rstudio container):
export R_LIBS_USER=$HOME/R/APPTAINER/h2-rstudio_4.5.0
apptainer exec $H2_CONTAINER_LOC/h2-rstudio_4.5.0.sif Rscript $HOME/myproject/myscript.R
echo "Job $SLURM_JOB_ID ended at $(date)"
### rstudio_r_submit.job STOP ###
where you would replace the account, the resources requested, the R script and, if you use a different version of R, the container and the R_LIBS_USER directory (ls $H2_CONTAINER_LOC/h2-rstudio*sif lists the containers). Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate rstudio_r_submit.job
$ sbatch rstudio_r_submit.job
On the Grid Engine (legacy) cluster, you can also run the version of R available with RStudio Server in a submitted batch job. Your submission script will need to start R from the software container where RStudio Server is installed. The following code is an example of a SGE job script that will submit a R batch job using the version of R inside of the RStudio container. You can use all the R libraries and packages that you have already installed from within an RStudio Server session.
You may need to modify the instructions given in below to match the particular R container you would want to use. To find available RStudio container versions on the Hoffman2 Cluster issue the following commands from a terminal:
module load apptainer
ls $H2_CONTAINER_LOC/h2-rstudio*sif
### submit_rstudio.sh START ###
#!/bin/bash
#$ -cwd
#$ -o joblog.$JOB_ID
#$ -j y
# Resources requested
# PLEASE CHANGE THE RESOURCES REQUESTED AS NEEDED:
#$ -l h_data=10G,h_rt=1:00:00
# PLEASE CHANGE THE NUMBER OF CORES REQUESTED AS NEEDED:
#$ -pe shared 1
# Email address to notify
#$ -M $USER@mail
#$ -m bea
#
# Output job info on joblog file:
#
echo " "
echo "Job myscript, ID no. $JOB_ID started on: "` hostname -s `
echo "Job myscript, ID no. $JOB_ID started at: "` date `
echo " "
#
# Set up job environment:
#
. /u/local/Modules/default/init/modules.sh
module load apptainer
# Export R Libs directory
## NOTE YOU MAY NEED TO UPDATE THE DEFINITION OF R_LIBS_USER TO
## MATCH THE VERSION OF R YOU ARE USING (IF NOT USING h2-rstudio_4.1.0.sif)
export R_LIBS_USER=$HOME/R/APPTAINER/h2-rstudio_4.1.0
#
# Run the job:
#
## REMEMBER TO SUBSTITUTE THE NAME OF THE R SCRIPT YOU INTEND TO RUN IN THE TWO LINES BELOW &
## TO CHANGE THE RSTUDIO SERVER CONTAINER IF A DIFFERENT VERSION OF R IS NEEDED (TO SEE AVAILABLE
## VERSIONS OF R ISSUE: module load apptainer; ls $H2_CONTAINER_LOC/h2-rstudio*sif)
echo "/usr/bin/time -v apptainer exec $H2_CONTAINER_LOC/h2-rstudio_4.1.0.sif R CMD BATCH --no-save --no-restore myRtest.R output.$JOB_ID"
/usr/bin/time -v apptainer exec $H2_CONTAINER_LOC/h2-rstudio_4.1.0.sif R CMD BATCH --no-save --no-restore myRtest.R output.$JOB_ID
echo " "
echo "Job myscript, ID no. $JOB_ID finished at: "` date `
echo " "
### submit_rstudio.sh STOP ###
If you installed many R packages from within RStudio Server, you will want to run any R batch job with the same version of R and R packages.
References:
Problems with the instructions on this section? Please send comments here.
Stata
Stata is a general-purpose statistical software package. Most of its users work in research, especially in the fields of economics, sociology, political science, biomedicine, and epidemiology. For more information, see the Stata website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster. To see the installed versions, use module spider stata on the Slurm cluster and module av stata on the Grid Engine cluster.
Note
To open the graphical user interface (GUI) of Stata, xstata, on the Slurm cluster, connect via DCV remote desktop (or via terminal and SSH with X11 forwarding enabled) and start your session with x11session (see Opening GUI applications from a Slurm interactive session). Alternatively you can open the text-based Stata interface in any interactive session.
On the Slurm cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example:
$ srun --time=01:00:00 --cpus-per-task=4 --mem=8G --pty bash -l
or, for the GUI, from a terminal on the DCV desktop:
$ x11session --time=01:00:00 --mem=8G -c 4
Then load Stata in your environment with:
$ module purge
$ module load stata/19
(to see the installed versions use module spider stata). To run Xstata, the multi-processor version of the GUI (from an x11session shell), enter:
$ xstata-mp &
To run Stata without its GUI interface, enter:
$ stata-mp
and, at the Stata prompt, use as many processors as cores requested (4 in the example above) with:
. set processors 4
xstata-se and stata-se are also available. The instructions on temporary files ($STATATMP), environment variables and user-written packages in the GE interactive tab also apply on the Slurm cluster, where the job ID is in $SLURM_JOB_ID (instead of $JOB_ID) and the array task ID in $SLURM_ARRAY_TASK_ID (instead of $SGE_TASK_ID).
Please refer to the Stata documentation to learn how to use Stata.
Note
To open the graphical user interface (GUI) of Stata, xstata, you will need to have connected to the Hoffman2 Cluster either via a remote desktop or via terminal and SSH having followed directions on how to open GUI applications. Alternatively you can open the text-based Stata interface.
On the Grid Engine (legacy) cluster, request an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example:
$ qrsh -l h_data=2G,h_rt=1:00:00
After getting into the interactive session, if you will be testing the parallel version, you will want to load the scheduler environmental variables (such as $NSLOTS for the number of parallel workers, etc.):
$ . /u/local/bin/set_qrsh_env.sh
To run Xstata interactively with its GUI interface, enter:
$ module load stata
$ xstata-se &
Or, for the multi-processor version of Xstata, enter:
$ module load stata
$ xstata-mp &
To run Stata interactively without its GUI interface, enter:
$ module load stata
$ stata-se
Or, for the multi-processor version of Stata:
$ module load stata
$ stata-mp
Stata writes temporary files to the directory /tmp or, if the $TMPDIR environmental variable is set, to the location pointed to by such variable. During a batch job, the $TMPDIR is set by the scheduler and points to a temporary directory located on the hard disk on the node where the job is running.
Should you need to have stata write its temporary files somewhere else then the locations indicated above, you can do by defining the $STATATMP before starting your stata session. On bash/sh shells you can do so by issuing:
$ export STATATMP=/path/to/your/stata/tmpdir
$ setenv STATATMP /path/to/your/stata/tmpdir
where: /path/to/your/stata/tmpdir should be substituted with an actual path on the cluster. If you intend to use your scratch directory, /path/to/your/stata/tmpdir should be set to $SCRATCH.
To verify the current location of the temporary directory Stata is using, you can issue at the Stata command prompt the following commands:
. tempfile junk
or:
. display "`junk'"
System environmental variables such as the location of your scratch on the cluster ($SCRATCH), or within a batch job context, the job ID number, $JOB_ID, or for array jobs the task ID number, $SGE_TASK_ID, can be accessed from Stata via macros. For example, to use $SCRATCH within an interactive Stata session or a Stata do file:
. local scratch : env SCRATCH
. display "`scratch'"
and to change to $SCRATCH within an interactive Stata session or a Stata do file:
. cd `scratch'
To access either $JOB_ID or $SGE_TASK_ID from within an interactive stata session or a stata do file:
. local jid : env JOB_ID
. display `jid'
or:
. local tid : env SGE_TASK_ID
. display `tid'
To install in your $HOME directory and manage user-written additions from the net, use the stata command net. To learn more at the stata command prompt, issue:
. help net
The contributed commands from the Boston College Statistical Software Components (SSC) archive are installed in the users $HOME directory as needed. To do so, start an interactive session of Stata and at its command prompt issue:
. ssc install pagkage-name
To check the location on your $HOME directory of stata packages, at the stata command prompt issue:
. sysdir
To check the locally installed packages, issue at the stata command prompt:
. ado
Please refer to the Stata documentation to learn how to use Stata.
To run Stata in batch you need to create an input script with a .do extension, the script will contain the Stata commands you would use at the Stata interactive prompt. To submit a batch job with Stata on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q):
$ job.q -p stata
or create a job script similar to:
### stata_submit.job START ###
#!/bin/bash
#SBATCH --job-name=stata
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=1G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=stata.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# load the job environment:
module purge
module load stata/19
module list
# tell Stata/MP how many cores to use (profile.do is read from the
# directory you submit the job from):
echo "set processors $SLURM_CPUS_PER_TASK" > profile.do
# run the do file myscript.do (the log, myscript.log, is written to the
# directory you submit the job from):
stata-mp -b do $HOME/myproject/myscript.do
echo "Job $SLURM_JOB_ID ended at $(date)"
### stata_submit.job STOP ###
where you would replace the account, the resources requested and the name and location of your do file as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate stata_submit.job
$ sbatch stata_submit.job
To run the same do file several times, for example with a different parameter each time, use a job array: add #SBATCH --array=1-7 to the script, pass the task ID to the do file with stata-mp -b do $HOME/myproject/myscript.do $SLURM_ARRAY_TASK_ID (read it in the do file as `1') and use #SBATCH --output=stata.%A.%a.out.
On the Grid Engine (legacy) cluster, to run Stata in batch you need to create an input script with a .do extension, the script will contain the Stata commands you would use at the Stata interactive prompt.
To submit a Stata script, say myscript.do, for batch executation you can create a script similar to:
#### stata_submit.sh START ####
#!/bin/bash
#$ -cwd
#$ -o joblog.$JOB_ID
#$ -j y
# Resources requested:
# UPDATE THE VALUE BELOW TO REFLECT YOUR NEEDS
#$ -l h_data=1g,h_rt=300
# UPDATE THE VALUE BELOW TO REFLECT YOUR NEEDS
#$ -pe shared 4
# Email address to notify
#$ -M $USER@mail
#$ -m bea
echo ""
echo "Job $JOB_ID started on: "` hostname -s `
echo "Job $JOB_ID started at: "` date `
echo ""
#
. /u/local/Modules/default/init/modules.sh
module load stata
# Tell stata how many processors to use ::
if [ -e ./profile.do ]; then
echo "set processors $NSLOTS" > profile.do
fi
cat ./profile.do
echo ""
#
# Run the user program
# CHANGE THE NAME OF THE STATA SCRIPT BELOW:
stata-mp -b do myscript.do 2>&1 > myscript.out.$JOB_ID
echo ""
echo "Job $JOB_ID ended on: "` hostname -s `
echo "Job $JOB_ID ended at: "` date `
echo ""
#### stata_submit.sh END ####
where you would replace the resources requested and Stata script name, myscript.do and the resources requested as needed. Save the stata_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x stata_submit.sh
Submit the job with:
$ qsub stata_submit.sh
If you have to run a stata task multiple times using the same do file but changing, for example, a parameter within the study you can take advantage of the scheduler built-in job array capability which lets you submits such series of tasks with a single job submission.
A sample submission script (stata_jobarray_submission.sh) for such array job is shown here (where in bold are elements that you may likely want to adapt to your own situation):
#### stata_jobarray_submit.sh START ####
#!/bin/bash
#$ -cwd
#$ -o joblog.$JOB_ID.$TASK_ID
#$ -j y
# Resources requested:
# UPDATE THE VALUE BELOW TO REFLECT YOUR NEEDS
#$ -l h_data=1g,h_rt=300
# UPDATE THE VALUE BELOW TO REFLECT YOUR NEEDS
#$ -pe shared 4
# Email address to notify
#$ -M $USER@mail
#$ -m bea
# UPDATE THE VALUES BELOW TO REFLECT YOUR NEEDS
#$ -t 1-7:1
echo ""
echo "Job $JOB_ID started on: "` hostname -s `
echo "Job $JOB_ID started at: "` date `
echo ""
#
. /u/local/Modules/default/init/modules.sh
module load stata
# Tell stata how many processors to use ::
if [ -e ./profile.do ]; then
echo "set processors $NSLOTS" > profile.do
fi
cat ./profile.do
echo ""
echo "Task id is $SGE_TASK_ID"
echo ""
#
# Run the user program
# CHANGE THE NAME OF THE STATA SCRIPT BELOW:
cp -p ./batch_test.do ./batch_test_$SGE_TASK_ID.do
stata-mp -b do myscript.do $SGE_TASK_ID 2>&1 > myscript.out.${JOB_ID}.${SGE_TASK_ID}
echo ""
echo "Job $JOB_ID.$TASK_ID ended on: "` hostname -s `
echo "Job $JOB_ID.$TASK_ID ended at: "` date `
echo ""
#### stata_jobarray_submit.sh END ####
where you would replace the resources requested and Stata script name, myscript.do and the resources requested as needed. Save the stata_submit.sh script in a location on your account from which you would like to submit your job, mark the script as an executable script with:
$ chmod u+x stata_jobarray_submit.sh
Submit the job with:
$ qsub stata_jobarray_submit.sh
Should the run-time of your tasks be very short, you should group set of tasks as described in: :ref: How do I pack multiple job-array tasks into one run?
Finally, the following queue script is available for submitting Stata bath jobs:
stata.q
runs stata-mp on 1-8 processors.
Please refer to the Stata documentation to learn how to use Stata.
References:
Problems with the instructions on this section? Please send comments here.
Visualization and rendering
GnuPlot
GnuPlot is a command-line program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems. For more information, see the GnuPlot website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed).
GnuPlot opens its plots in a graphical window. On the Slurm cluster, after connecting via Remote Desktop or via terminal and SSH with X11 Forwarding enabled, request an interactive session with X11 forwarding with x11session (see Opening GUI applications from a Slurm interactive session), for example with:
$ x11session --time=01:00:00 --mem-per-cpu=2G -c 1
GnuPlot is part of the operating system, so no module is needed. In the interactive session enter:
$ gnuplot
To only write plots to files (e.g., with set terminal pngcairo and set output 'myplot.png' in your GnuPlot script), a plain interactive session is enough:
$ srun --time=01:00:00 --mem=2G --pty bash -l
$ gnuplot $HOME/myproject/myplot.gp
Please see the Gnuplot documentation to learn how to use this software.
On the Grid Engine (legacy) cluster, to run GnuPlot interactively you must connect to the cluster login node with X11 forwarding enabled. Then use qrsh to obtain an interactive compute node.
Note
To run GnuPlot you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
gnuplot
Please see the Gnuplot documentation to learn how to use this software.
In a batch job GnuPlot cannot open a window: in your GnuPlot script, write the plots to files instead (e.g., with set terminal pngcairo and set output 'myplot.png'). To submit a batch job with GnuPlot on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q). GnuPlot is part of the operating system, so no software module is needed:
$ job.q -n myplot.gp -c "gnuplot myplot.gp"
or create a job script similar to:
### gnuplot_submit.job START ###
#!/bin/bash
#SBATCH --job-name=gnuplot
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=gnuplot.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# GnuPlot is part of the operating system (no module needed):
module purge
module list
# substitute the name of your GnuPlot script below:
gnuplot $HOME/myproject/myplot.gp
echo "Job $SLURM_JOB_ID ended at $(date)"
### gnuplot_submit.job STOP ###
where you would replace the account, the resources requested and the GnuPlot script as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate gnuplot_submit.job
$ sbatch gnuplot_submit.job
References:
Problems with the instructions on this section? Please send comments here.
GRACE
“Grace is a WYSIWYG tool to make two-dimensional plots of numerical data. It runs under various (if not all) flavors of Unix with X11 and M*tif (LessTif or Motif). It also runs under VMS, OS/2, and Windows (95/98/NT/2000/XP). Its capabilities are roughly similar to GUI-based programs like Sigmaplot or Microcal Origin plus script-based tools like Gnuplot or Genplot. Its strength lies in the fact that it combines the convenience of a graphical user interface with the power of a scripting language which enables it to do sophisticated calculations or perform automated tasks.” - GRACE Documentation website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for GRACE.
To run GRACE interactively you must connect to the cluster login node with X11 forwarding enabled. Then use qrsh to obtain an interactive session.
Note
To run GRACE you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
xmgrace
References:
Problems with the instructions on this section? Please send comments here.
Graphviz
“Graphviz is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.” -Graphviz website
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
you can run the Graphviz programs (dot, neato, circo, etc.), which are part of the operating system, so no module is needed. For example, to draw the graph described in the file mygraph.dot as a PNG image:
$ dot -V
$ dot -Tpng $HOME/myproject/mygraph.dot -o mygraph.png
To look at the images on the cluster, connect via Remote Desktop or via terminal and SSH with X11 Forwarding enabled and start the interactive session with x11session instead (see Opening GUI applications from a Slurm interactive session).
Note
On the Grid Engine (legacy) cluster, to run Graphviz you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use Graphviz, use the module command:
module load graphviz
See Environmental modules for further information.
To submit a batch job with Graphviz on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q). Graphviz is part of the operating system, so no software module is needed:
$ job.q -n mygraph.dot -c "dot -Tpng mygraph.dot -o mygraph.png"
or create a job script similar to:
### graphviz_submit.job START ###
#!/bin/bash
#SBATCH --job-name=graphviz
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=graphviz.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# Graphviz is part of the operating system (no module needed):
module purge
module list
# substitute the Graphviz command needed below:
dot -Tpng $HOME/myproject/mygraph.dot -o mygraph.png
echo "Job $SLURM_JOB_ID ended at $(date)"
### graphviz_submit.job STOP ###
where you would replace the account, the resources requested and the Graphviz command as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate graphviz_submit.job
$ sbatch graphviz_submit.job
References:
Problems with the instructions on this section? Please send comments here.
IDL
IDL, short for Interactive Data Language, is a programming language used for data analysis. It is popular in particular areas of science, such as astronomy, atmospheric physics and medical imaging. See the IDL webpage for more information.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for IDL.
To run IDL interactively you must first connect to the cluster login node with X11 forwarding enabled. Then use qrsh to obtain an interactive session.
Note
To run IDL you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
When the interactive session is granted enter at the command prompt of the compute node:
module load idl
idl
Please notice: IDL scripts (containing IDL commands and ending with a .pro extension) can be executed at the IDL command line.
References:
Problems with the instructions on this section? Please send comments here.
ImageMagick
ImageMagick is a free and open-source software suite for displaying, creating, converting, modifying, and editing raster images. It can read and write over 200 image file formats. For more information, see ImageMagick website.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for ImageMagick.
To run ImageMagick interactively you must connect to the cluster login node with X11 forwarding enabled. Then use qrsh to obtain an interactive compute node.
Note
To run ImageMagick you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
image-magick-command {see options}
where image-magick-command is one of the ImageMagick programs.
Each ImageMagick program is invoked by a separate command. To run an ImageMagick program, either enter the command that invokes it at the command line shell prompt, or use it in a script file and execute your script.
Documentation exist for all the ImageMagick commands.
For a list of commands, issue:
man ImageMagick
For image settings and image operators, issue:
man display
On the Grid Engine (legacy) cluster, each ImageMagick program is invoked by a separate command. To run an ImageMagick program, either enter the command that invokes it or use it in a script file. Not all ImageMagick commands are available in batch (e.g., display and import do not run in batch).
The easiest way to run ImageMagick in batch from a Grid Engine login node is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
Use the Grid Engine job.q queue script to create a job scheduler (UGE) command file for your script that contains an ImageMagick command and options. (The job.q on the Slurm cluster is a different script, which writes Slurm job scripts; see Building a job script with job.q.)
See Altair Grid Engine batch jobs with qsub for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with the queue script listed above. After saving the command file, you can modify it if necessary. See Additional tools for a list of the most commonly used UGE commands.
References:
Problems with the instructions on this section? Please send comments here.
Maya
“3D computer animation, modeling, simulation, and rendering software “ – Autodesk Maya
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to run Autodesk’s Maya you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
After requesting an interactive session (remember to specify a runtime, memory, number of cores, etc. as needed), for example with:
qrsh -l h_rt=1:00:00,exclusive
You can check the available versions of Autodesk’s Maya with:
module av maya
Load the default version of Maya in your environment with:
module load maya
To load a different version, issue:
module load maya/VERSION
where VERSION is replaced by the desired version of Maya.
To invoke Maya:
maya &
Please refer to Autodesk’ Maya documentation to learn how to use this software Autodesk’ Maya documentation.
On the Grid Engine (legacy) cluster, to submit a job for batch execution which uses any of the Autodesk’ Maya you can use the script:
/u/local/apps/submit_scripts/Render_job_submitter.sh
to learn how to use the script you can issue:
/u/local/apps/submit_scripts/Render_job_submitter.sh --help
References:
Problems with the instructions on this section? Please send comments here.
NCAR
“The NCAR Command Language (NCL), a product of the Computational & Information Systems Laboratory at the National Center for Atmospheric Research (NCAR) and sponsored by the National Science Foundation, is a free interpreted language designed specifically for scientific data processing and visualization.” -NCL website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to run NCL you will need to have followed directions to Opening GUI applications.
After requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
/u/local/apps/ncl/current/bin/ncl
References:
Problems with the instructions on this section? Please send comments here.
OpenDX
OpenDX is a programming environment for data visualization and analysis that employs a data-flow driven client-server execution model. It provides a graphical program editor that allows the user to create an interactive visualization using a point and click interface. It supports interactions in a number of ways, including via a graphical user interface with direct (i.e., in images) and indirect (i.e., via Motif widgets) interactors, visual programming, a high-level scripting language and a programming API. Furthermore, the indirect interactors are data-driven (i.e., self-configuring by data characteristics). Visual and scripting language programming support hierarchy (i.e., macros) and thus, can be used to build complete applications. The programming API provides data support, error handling, access to lower level tools, etc. for building modules and is associated with a Module Builder utility.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for OpenDX.
Note
To run OpenDX you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
dx
References:
Problems with the instructions on this section? Please send comments here.
ParaView
“ParaView is an open-source, multi-platform data analysis and visualization application. ParaView users can quickly build visualizations to analyze their data using qualitative and quantitative techniques. The data exploration can be done interactively in 3D or programmatically using ParaView’s batch processing capabilities.
ParaView was developed to analyze extremely large datasets using distributed memory computing resources. It can be run on supercomputers to analyze datasets of petascale size as well as on laptops for smaller data, has become an integral tool in many national laboratories, universities and industry, and has won several awards related to high performance computation.” -Paraview website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to run ParaView you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
After requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Then enter:
paraview
References:
Problems with the instructions on this section? Please send comments here.
POV-Ray
The Persistence of Vision Ray Tracer, most commonly acronymed as POV-Ray, is a cross-platform ray-tracing program that generates images from a text-based scene description. See the POV-Ray website for more information.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for POV-Ray.
Note
To run POV-Ray you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
The easiest way to run POV-Ray in batch from a Grid Engine login node is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
Create a simple script that calls /u/local/bin/povray or the /u/local/apps/povray/current/bin/povray executable. Use the Grid Engine job.q or jobarray.q queue scripts to create your UGE command file. (The job.q on the Slurm cluster is a different script, which writes Slurm job scripts; see Building a job script with job.q.)
POV-Ray can generate the frames of a movie using its animation options in cases when motion or other factors change with time. This requires only a single invocation of POV-Ray. For example, it is an ideal way to render a movie in which the camera rotates around the scene so that the scene can be viewed from all sides. To render the frames of a movie in which the geometry for each frame comes from a different time step of a simulation, you could have one POV-Ray scene file for each time step and submit the rendering to batch using UGE Job Arrays.
On the Grid Engine (legacy) cluster, POV-Ray is installed in /u/local/apps/povray/current/bin/povray.
It is recommended that you run POV-Ray in batch in two situations:
To render high quality images.
To render images for an animation.
To render in batch we recommend the following POV-Ray options:
D |
+FN or +FP |
+A |
|---|---|---|
Do not display the image. |
Save a PNG or PPM image respectively. |
Turn on anti-aliasing. |
POV-Ray can generate the frames of a movie using its animation options in cases when motion or other factors change with time. This requires only a single invocation of POV-Ray. For example, it is an ideal way to render a movie in which the camera rotates around the scene so that the scene can be viewed from all sides. To render the frames of a movie in which the geometry for each frame comes from a different time step of a simulation, you could have one POV-Ray scene file for each time step and submit the rendering to batch using UGE Job Arrays.
The easiest way to run POV-Ray in batch from a Grid Engine login node is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
Create a simple script that calls /u/local/bin/povray or the /u/local/apps/povray/current/bin/povray executable. Use the Grid Engine job.q or jobarray.q queue scripts to create your UGE command file. (The job.q on the Slurm cluster is a different script, which writes Slurm job scripts; see Building a job script with job.q.)
See Altair Grid Engine batch jobs with qsub for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with one of the queue scripts listed above. After saving the command file, you can modify it if necessary.
See Additional tools for a list of the most commonly used UGE commands.
References:
Problems with the instructions on this section? Please send comments here.
VTK
“The Visualization Toolkit is an open-source software system for 3D computer graphics, image processing and visualization. VTK is distributed under the OSI-approved BSD 3-clause License.” – VTK website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
Note
On the Grid Engine (legacy) cluster, to run VTK you will need to have connected to the Hoffman2 Cluster either via a Remote desktop or via terminal and SSH having followed directions to Opening GUI applications.
After requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
Set up your environment to use VTK by using the module command:
module load vtk
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.
Miscellaneous
cURL
cURL is a computer software project providing a library and command-line tool for transferring data using various network protocols. The name stands for “Client URL.” For more information, see the cURL website.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed); the Grid Engine cluster also has a newer version as a module (module av curl).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
you can use cURL, which is part of the operating system, so no module is needed. For example:
$ curl --version
$ curl -L -O https://www.example.com/path/to/file.tar.gz
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use cURL, use the module command:
module load curl
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.
Lynx
Lynx provides software frameworks, hypervisors, and RTOS technologies for mission critical platforms in aerospace & defense, industrial IoT, enterprise, and automotive markets. See the Lynx website for more information.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use Lynx, use the module command:
module load lynx
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.
MIGRATE-N
“Migrate estimates effective population sizes,past migration rates between n population assuming a migration matrix model with asymmetric migration rates and different subpopulation sizes, and population divergences or admixture. Migrate uses Bayesian inference to jointly estimate all parameters. It can use the following data: Sequence data with or without site rate variation, single nucleotide polymorphism data (sequence-like data input, HAPMAP-like data), Microsatellite data using brownian motion approximation to the stepwise mutation model (using the repeatlength input format or the fragment-length input), and also Electrophoretic data using an ‘infinite’ allele model. The output can contain: Tables of mode, average, median, and credibility intervals for all paramters, histograms approximating the marginal posterior probability density of each parameter. Marginal likelihoods of the model to allow comparison of different MIGRATE runs to select be best model.” –Migrate website
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, you can use any text editor to make the appropriate input files for migrate.
To run migrate interactively you must use qrsh to obtain an interactive session.
Start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for exmaple:
qrsh -l h_data=2G,h_rt=1:00:00
Then, enter:
module load migrate
migrate
On the Grid Engine (legacy) cluster, the easiest way to run Migrate in batch is to use the queue scripts. See Altair Grid Engine batch jobs with qsub for a discussion of the queue scripts and how they are used.
The following queue script is available for migrate:
migrate.q
Mirgrate runs in parallel.
See Altair Grid Engine batch jobs with qsub for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with the queue script listed above. After saving the command file, you can modify it if necessary. See Additional tools for a list of the most commonly used UGE commands.
References:
Problems with the instructions on this section? Please send comments here.
SVN subversion
Apache Subversion (often abbreviated SVN, after its command name svn) is a software versioning and revision control system distributed as open source under the Apache License. See the Subversion website for more information.
Note
Available on: the Grid Engine (legacy) cluster only. It is not yet available on the Slurm (production) cluster: if you need it there, please request it by opening a ticket.
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use Subversion, use the module command:
module load svn
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.
TeXLive
“TeX Live is intended to be a straightforward way to get up and running with the TeX document production system. It provides a comprehensive TeX system with binaries for most flavors of Unix, including GNU/Linux, macOS, and also Windows. It includes all the major TeX-related programs, macro packages, and fonts that are free software, including support for many languages around the world. Many operating systems provide it via their own distributions.” –The TeX Users Group (TUG) website
Note
Available on: the Slurm (production) cluster, as part of the operating system (TeX Live 2020, no module needed), and the Grid Engine (legacy) cluster. To see the installed versions on the Grid Engine cluster, use module av texlive.
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
you can use the TeX Live programs (pdflatex, latex, xelatex, lualatex, bibtex, etc.), which are part of the operating system, so no module is needed. For example:
$ pdflatex --version
$ cd $HOME/myproject
$ pdflatex mydocument.tex
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use TeXLive, use the module command:
module load texlive
See Environmental modules for further information.
To submit a batch job with TeX Live on the Slurm cluster, you can let job.q write the job script for you (see Building a job script with job.q). TeX Live is part of the operating system, so no software module is needed:
$ job.q -n mydocument.tex -c "pdflatex -interaction=nonstopmode mydocument.tex"
or create a job script similar to:
### texlive_submit.job START ###
#!/bin/bash
#SBATCH --job-name=texlive
# your Slurm account (see: h2 whoami):
#SBATCH --account=pi_gobruin
# Edit the lines below to request the runtime, cores and memory as needed:
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2G
# Standard output and error, in the directory you submit the job from:
#SBATCH --output=texlive.%j.out
# To be emailed when the job ends or fails, remove one "#" from the next
# two lines and replace joebruin with your user name:
##SBATCH --mail-user=joebruin@mail
##SBATCH --mail-type=END,FAIL
echo "Job $SLURM_JOB_ID started on $(hostname -s) at $(date)"
# TeX Live is part of the operating system (no module needed):
module purge
module list
# substitute the TeX Live command needed below
# (the PDF is written to the directory you submit the job from):
pdflatex -interaction=nonstopmode $HOME/myproject/mydocument.tex
echo "Job $SLURM_JOB_ID ended at $(date)"
### texlive_submit.job STOP ###
where you would replace the account, the resources requested and the TeX Live command as needed. Submit the job from a directory under $SCRATCH (see Where to write job output), after checking it, with:
$ h2 validate texlive_submit.job
$ sbatch texlive_submit.job
References:
Problems with the instructions on this section? Please send comments here.
tmux
tmux is a terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time. For more information, see the tmux github site.
Note
Available on: the Slurm (production) cluster and the Grid Engine (legacy) cluster, as part of the operating system (no module needed); the Grid Engine cluster also has it as a module (module av tmux).
On the Slurm cluster, after requesting an interactive session (remember to specify a runtime, memory, number of computational cores, etc. as needed), for example with:
$ srun --time=01:00:00 --mem=2G --pty bash -l
you can start tmux, which is part of the operating system, so no module is needed:
$ tmux
A tmux session started inside an interactive session ends when the interactive session ends (at the end of its runtime, or when you exit it).
On the Grid Engine (legacy) cluster, start by requesting an interactive session with the needed resources (e.g., run-time, memory, number of cores, etc.), for example with:
qrsh -l h_data=2G,h_rt=1:00:00
To set up your environment to use tmux, use the module command:
module load tmux
See Environmental modules for further information.
References:
Problems with the instructions on this section? Please send comments here.