Skip Nav

Cray XC40 (Excalibur)
User Guide

Table of Contents

1. Introduction

1.1. Document Scope and Assumptions

This document provides an overview and introduction to the use of the Cray XC40 (Excalibur) located at the ARL DSRC, along with a description of the specific computing environment on Excalibur. The intent of this guide is to provide information that will enable the average user to perform computational tasks on the system. To receive the most benefit from the information provided here, you should be proficient in the following areas:

  • Use of the UNIX operating system
  • Use of an editor (e.g., vi or emacs)
  • Remote usage of computer systems via network or modem access
  • A selected programming language and its related tools and libraries

1.2. Policies to Review

Users are expected to be aware of the following policies for working on Excalibur.

1.2.1. Login Node Abuse Policy

Memory or CPU intensive programs running on the login nodes can significantly affect all users of the system. Therefore, only small applications requiring less than 10 minutes of runtime and less than 2 GBytes of memory are allowed on the login nodes. Any job running on the login nodes that exceeds these limits may be unilaterally terminated.

1.2.2. Workspace Purge Policy

The /work directory is subject to a 21-day purge policy. A system "scrubber" monitors scratch space utilization, and if available space becomes low, files not accessed within 21 days are subject to removal, although files may remain longer if the space permits. There are no exceptions to this policy.

Note! If it is determined as part of the normal purge cycle that files in your $WORKDIR directory must be deleted, you WILL NOT be notified prior to deletion. You are responsible to monitor your workspace to prevent data loss.

1.3. Obtaining an Account

The process of getting an account on the HPC systems at any of the DSRCs begins with getting an account on the HPCMP Portal to the Information Environment, commonly called a "pIE User Account." If you do not yet have a pIE User Account, please visit HPC Centers: Obtaining An Account and follow the instructions there. Once you have an active pIE User Account, visit the ARL accounts page for instructions on how to request accounts on the ARL DSRC HPC systems. If you need assistance with any part of this process, please contact the HPC Help Desk at

1.4. Requesting Assistance

The HPC Help Desk is available to help users with unclassified problems, issues, or questions. Analysts are on duty 8:00 a.m. - 8:00 p.m. Eastern, Monday - Friday (excluding Federal holidays).

You can contact the ARL DSRC directly in any of the following ways for support services not provided by the HPC Help Desk:

For more detailed contact information, please see our Contact Page.

2. System Configuration

2.1. System Summary

Excalibur is a Cray XC40. The login and compute nodes are populated with Intel Xeon E5-2698 v3 processors clocked at 2.3 GHz. Excalibur uses a dedicated Cray Aries high-speed network for MPI messages and I/O traffic. Excalibur uses Lustre to manage its parallel file system that targets arrays of SAS disk drives. Excalibur has 3,162 compute nodes that share memory only on the node; memory is not shared across nodes. Each compute node has two, sixteen-core processors that operate under a Cray Linux Environment (CLE) sharing 128 GBytes of DDR3 memory (126 GBytes user-accessible), with no user-accessible swap space. Excalibur is rated at 3.77 peak PFLOPS and has 4.6 PBytes (formatted) of parallel disk storage.

Excalibur is intended to be used as a batch-scheduled HPC system. Its login nodes are not to be used for large computational (e.g., memory, I/O, long executions) work. All executions that require large amounts of system resources must be sent to the compute nodes by batch job submission.

Node Configuration
Login Nodes Compute Nodes
Standard Memory Large Memory GPU
Total Nodes 16 3,098 32 32
Operating System SLES Cray Linux Environment
Cores/Node 32 32 + 1 GPU
(1 x 2,880 GPU cores)
Core Type Intel Xeon E5-2698 v3 Intel Xeon E5-2698 v3
+NVIDIA Tesla K40
Core Speed 2.3 GHz 2.5 GHz
Memory/Node 256 GBytes 128 GBytes 512 GBytes 256 GBytes
+12 GBytes
Accessible Memory/Node 2 GBytes 126 GBytes 508 GBytes 252 GBytes
Memory Model Shared on node. Shared on node.
Distributed across cluster.
Interconnect Type Ethernet / InfiniBand Cray Aries / Dragonfly Ethernet / InfiniBand
File Systems on Excalibur
Path Capacity Type
411 TBytesLustre
4.6 PBytesLustre
/p/work2122 TBytesLustre on
Solid State

2.2. Processor

Excalibur uses the Intel Haswell E5-2698 64-bit processors on its login and compute nodes. These processors are clocked at 2.3 GHz, have 16 cores per CPU, and have 16x32 KBytes of L1 instruction cache, 16x32 KBytes of L1 data cache, 4 MBytes of L2 cache, and access to a 40-MByte L3 cache that is shared among all 16 cores of the processor.

2.3. Memory

Excalibur uses both shared- and distributed-memory models. Memory is shared among all the cores on a node, but is not shared among the nodes across the cluster.

Each login node contains 256 GBytes of main memory. All memory and cores on the node are shared among all users who are logged in. Therefore, users should not use more than 8 GBytes of memory at any one time.

Each standard-memory compute node contains 128 GBytes of memory, of which 126 GBytes is user-accessible shared memory.

Each large-memory compute node contains 512 GBytes of memory, of which 508 GBytes is user-accessible shared memory.

Each GPU compute node contains 256 GBytes of memory, of which 252 GBytes is user-accessible shared memory.

2.4. Operating System

The operating system on Excalibur's login nodes is SUSE SLES 11 Linux. The compute nodes use a reduced functionality Linux kernel that is designed for computational computing. The combination of these two operating systems is known as the Cray Linux Environment (CLE). The compute nodes can provide access to dynamically shared objects and most of the typical Linux commands and basic functionality by including the Cluster Compatibility Mode (CCM) option in your PBS batch submission script or command. See section 6.5 for more information on using CCM.

2.5. File Systems

Excalibur has the following file systems available for user storage:

2.5.1. $HOME (/p/home/)

This file system is locally mounted from Excalibur's Lustre file system and has a formatted capacity of 678 TBytes. All users have a home directory located on this file system which can be referenced by the environment variable $HOME.

2.5.2. $WORKDIR (/p/work1/)

This file system is locally mounted from Excalibur's Lustre file system that is tuned for parallel I/O. It has a formatted capacity of 3.7 PBytes each. All users have a work directory which can be referenced by the environment variable $WORKDIR.

2.5.3. /p/work2/

This file system is locally mounted from Excalibur's Lustre file system that is tuned for parallel I/O with smaller I/O sizes and/or random I/O operations. It has a formatted capacity of 130 TBytes. Users need to request special access to make use of work2, given the constraints on number of overwrites of the solid state devices that comprise work2.

Raid/Striping Concerns for Large Files

The default stripe size for files in the work file systems is 1 MByte, and the default stripe count is four stripes. Increasing the stripe count is advisable when creating files that are larger than 40 GBytes.

2.5.4. $CENTER (/p/cwfs/)

This path is directed to the Center Wide File System (CWFS) which is meant for short-term storage (no longer than 120 days). All users have a directory defined in this file system. The environment variable for this is $CENTER. This is accessible from the HPC system login nodes. The CWFS has a formatted capacity of 3300 TBytes and is managed by IBM's Spectrum Scale (formerly GPFS).

2.6. Peak Performance

Excalibur is rated at 3.7 peak PFLOPS or 21.6 GFLOPS per core.

3. Accessing the System

3.1. Kerberos

A Kerberos client kit must be installed on your desktop to enable you to get a Kerberos ticket. Kerberos is a network authentication tool that provides secure communication by using secret cryptographic keys. Only users with a valid HPCMP Kerberos authentication can gain access to Excalibur. More information about installing Kerberos clients on your desktop can be found at HPC Centers: Kerberos & Authentication.

3.2. Logging In

The system host name for the Excalibur cluster is, which will redirect the user to one of thirteen login nodes. Hostnames and IP addresses to these nodes are available upon request from the HPC Help Desk.

The preferred way to login to Excalibur is via ssh, as follows:

% ssh

Kerberized rlogin is also allowed.

3.3. File Transfers

File transfers to DSRC systems (except transfers to the local archive system) must be performed using Kerberized versions of the following tools: ftp, scp, sftp, and mpscp. Before using any Kerberized tool, you must use a Kerberos client to obtain a Kerberos ticket. Information about installing and using a Kerberos client can be found at HPC Centers: Kerberos & Authentication.

The command below uses secure copy (scp) to copy a single local file into a destination directory on an Excalibur login node. The mpscp command is similar to the scp command, but has a different underlying means of data transfer, and may enable greater transfer rate. The mpscp command has the same syntax as scp.

% /usr/brl/bin/scp local_file

Both scp and mpscp can be used to send multiple files. This command transfers all files with the .txt extension to the same destination directory.

% /usr/brl/bin/scp *.txt

The example below uses the secure file transfer protocol (sftp) to connect to Excalibur, then uses the sftp cd and put commands to change to the destination directory and copy a local file there. The sftp quit command ends the sftp session. Use the sftp help command to see a list of all sftp commands.

% sftp

sftp> cd target_dir
sftp> put local_file
sftp> quit

The Kerberized file transfer protocol (kftp) command differs from sftp in that your username is not specified on the command line, but given later when prompted. The kftp command may not be available in all environments.

% kftp

username> user
kftp> cd target_dir
kftp> put local_file
kftp> quit

Windows users may use a graphical file transfer protocol (ftp) client such as FileZilla.

4. User Environment

4.1. User Directories

The following user directories are provided for all users on Excalibur.

4.1.1. Home Directory

Each user is allocated a home directory (the current working directory immediately after login) with an initial disk quota of 100 GBytes of permanent storage that is backed up. Your home directory can be referenced locally with the $HOME environment variable from all nodes in the system.

You may submit a request to increase your disk space quota by contacting the HPC Help Desk. You must supply the following information for evaluation of the request by the system administrators and the ARL DSRC management:

  • Amount of system resource requested
  • Length of time requested for the increase
  • Special deadlines for the project
  • Explanation of the attempts to work within limits
4.1.2. Work Directory

Excalibur provides scratch file systems for the temporary storage of data files needed for executing programs. You may access your personal working directory by using the $WORKDIR environment variable, which is set for you upon login. Your $WORKDIR directory has no disk quotas, and files stored there do not affect your permanent file quota usage. Because of high usage, $WORKDIR tends to fill up frequently. Please review the Workspace Purge Policy and be mindful of your disk usage.

REMEMBER: $WORKDIR is a "scratch" area and is not backed up. You are responsible for managing files in your $WORKDIR by backing up files to the MSAS and deleting unneeded files when your jobs end. See the section below on Archive Usage for details.

All of your jobs should execute from your $WORKDIR directory, not $HOME. While not technically forbidden, jobs that are run from $HOME are subject to disk space quotas and have a much greater chance of failing if problems occur with that resource. Jobs that are run entirely from your $WORKDIR directory are more likely to complete, even if all other resources are temporarily unavailable.

If you use $WORKDIR in your batch scripts, you must be careful to avoid having one job accidentally contaminate the files of another job. See the example scripts in the Sample Code Repository for ways to avoid this problem. The $JOBDIR directory is not subject to the Workspace Purge Policy until the job exits the workload management system.

4.1.3. Center Directory

The Center-Wide File System (CWFS) provides file storage that is accessible from Excalibur's login nodes and from the HPC Portal. The CWFS allows file transfers and other file and directory operations from Excalibur using simple Linux commands. Each user has their own directory in the CWFS. The name of your CWFS directory may vary between machines and between centers, but the environment variable $CENTER will always refer to this directory.

The example below shows how to copy a file from your work directory on Excalibur to the CWFS ($CENTER).

While logged into Excalibur, copy your file from your Excalibur work directory to the CWFS.

% cp $WORKDIR/filename $CENTER

4.2. Shells

The following shells are available on Excalibur: csh, bash, ksh, tcsh, zsh, and sh. To change your default shell, please email a request to Your preferred shell will become your default shell on the Excalibur cluster within 1-2 working days.

4.3. Environment Variables

A number of environment variables are provided by default on all HPCMP HPC systems. We encourage you to use these variables in your scripts where possible. Doing so will help to simplify your scripts and reduce portability issues if you ever need to run those scripts on other systems.

4.3.1. Common Environment Variables

The following environment variables are common to both the login and batch environments:

Common Environment Variables
Variable Description
$ARCHIVE_HOME Your directory on the archive server.
$ARCHIVE_HOST The host name of the archive server.
$BC_HOST The generic (not node specific) name of the system.
$CC The currently selected C compiler. This variable is automatically updated when a new compiler environment is loaded.
$CENTER Your directory on the Center-Wide File System (CWFS).
$COST_HOME This variable contains the path to the base directory of the default installation of the Common Open Source Tools (COST) installed on a particular compute platform. (See BC policy FY13-01 for COST details.)
$CSI_HOME The directory containing the following list of heavily used application packages: ABAQUS, Accelrys, ANSYS, CFD++, Cobalt, EnSight, Fluent, GASP, Gaussian, LS-DYNA, MATLAB, and TotalView, formerly known as the Consolidated Software Initiative (CSI) list. Other application software may also be installed here by our staff.
$CXX The currently selected C++ compiler. This variable is automatically updated when a new compiler environment is loaded.
$DAAC_HOME The directory containing DAAC-supported visualization tools: ParaView, VisIt, and EnSight.
$F77 The currently selected Fortran 77 compiler. This variable is automatically updated when a new compiler environment is loaded.
$F90 The currently selected Fortran 90 compiler. This variable is automatically updated when a new compiler environment is loaded.
$HOME Your home directory on the system.
$JAVA_HOME The directory containing the default installation of JAVA.
$KRB5_HOME The directory containing the Kerberos utilities.
$PET_HOME The directory containing the tools formerly installed and maintained by the PET staff. This variable is deprecated and will be removed from the system in the future. Certain tools will be migrated to $COST_HOME, as appropriate.
$PROJECTS_HOME A common directory where group-owned and supported applications and codes may be maintained for use by members of a group. Any project may request a group directory under $PROJECTS_HOME.
$SAMPLES_HOME The Sample Code Repository. This is a collection of sample scripts and codes provided and maintained by our staff to help users learn to write their own scripts. There are a number of ready-to-use scripts for a variety of applications.
$WORKDIR Your work directory on the local temporary file system (i.e., local high-speed disk).
4.3.2. Batch-Only Environment Variables

In addition to the variables listed above, the following variables are automatically set only in your batch environment. That is, your batch scripts will be able to see them when they run. These variables are supplied for your convenience and are intended for use inside your batch scripts.

Batch-Only Environment Variables
Variable Description
$BC_CORES_PER_NODE The number of cores per node for the compute node on which a job is running.
$BC_MEM_PER_NODE The approximate maximum user-accessible memory per node (in integer MBytes) for the compute node on which a job is running.
$BC_MPI_TASKS_ALLOC The number of MPI tasks allocated for a job.
$BC_NODE_ALLOC The number of nodes allocated for a job.

4.4. Modules

Software modules are a convenient way to set needed environment variables and include necessary directories in your path so that commands for particular applications can be found. Excalibur uses "modules" to initialize your environment with COTS application software, system commands and libraries, compiler suites, environment variables, and PBS batch system commands.

A number of modules are loaded automatically as soon as you log in. To see the modules which are currently loaded, use the "module list" command. To see the entire list of available modules, use "module avail". You can modify the configuration of your environment by loading and unloading modules. For complete information on how to do this, see the Modules User Guide.

4.5. Archive Usage (/archive)

In addition to $HOME and $WORKDIR, each user is also given a directory on the /archive file system. This file system is visible to the login nodes (not the compute nodes) and is the preferred location for long-term file storage. All users have an area defined in /archive for their use. This area can be accessed using the $ARCHIVE_HOME environment variable. We recommend that you keep large computational files and more frequently accessed files in the $ARCHIVE_HOME directory. We also recommend that any important files located in $HOME should be copied into $ARCHIVE_HOME as well.

Because the compute nodes are unable to see $ARCHIVE_HOME, you will need to pre-stage your input files to your $WORKDIR from a login node before submitting jobs. After jobs complete, you will need to transfer output files from $WORKDIR to $ARCHIVE_HOME from a login node. This may be done manually or through the transfer queue, which executes serial jobs on login nodes.

4.5.1. Archive Command Synopsis

A synopsis of the main archival utilities is listed below. For information on additional capabilities, see the Archive User Guide or read the online man pages that are available on each system. These commands are non-Kerberized and can be used in batch submission scripts if desired.

  • Copy one or more files from /archive:
    archive get [-C path ] [-s] file1 [file2 ...]

  • List files and directory contents on /archive:
    archive ls [lsopts] [file/dir ...]

  • Create directories on /archive:
    archive mkdir [-C path] [-m mode] [-p] [-s] dir1 [dir2 ...]

  • Copy one or more files to /archive:
    archive put [-C path ] [-D] [-s] file1 [file2 ...]

4.6. Login Files

When an account is created on Excalibur, a default .cshrc, and/or .profile file is placed into your home directory. This file contains the default modules setup to configure modules, PBS and other system defaults. We suggest you customize the following: .cshrc.pers or .profile.pers for your shell with any paths, aliases, or libraries you may need to load. The files should be sourced at the end of your .cshrc and/or .profile file as necessary. For example:

if (-f $HOME/.cshrc.pers) then
source $HOME/.cshrc.pers

If you need to connect to other Kerberized systems within the program, you should use /usr/brl/bin/ssh. If you use Kerberized ssh often, you may want to add an alias in your .cshrc.pers or .profile.pers files in $HOME, as follows:

alias ssh /usr/brl/bin/ssh # .cshrc.pers - csh/tcsh
alias ssh=/usr/brl/bin/ssh # .profile.pers - sh/ksh/bash

Note: the commands krcp, krlogin, and krsh are officially deprecated and will be removed at some point in the future. Users are strongly advised to stop using these three commands as soon as possible.

5. Program Development

5.1. Programming Models

Excalibur supports five parallel programming models: Message Passing Interface (MPI), Shared-MEMory (SHMEM), Open Multi-Processing (OpenMP), and Partitioned Global Address Space (PGAS): Co-Array FORTRAN, and Unified Parallel C (UPC). A Hybrid MPI/OpenMP programming model is also supported. MPI and SHMEM are examples of the message- or data-passing models, while OpenMP uses only shared memory on a node by spawning threads. PGAS programming using Co-Array FORTRAN and Unified Parallel C shares partitioned address space, where variables and arrays can be directly addressed by any processing element.

5.1.1. Message Passing Interface (MPI)

This release of MPI-2 derives from Argonne National Laboratory MPICH-2 and implements the MPI-2.2 standard except for spawn support, as documented by the MPI Forum in "MPI: A Message Passing Interface Standard, Version 2.2."

The Message Passing Interface (MPI) is part of the software support for parallel programming across a network of computer systems through a technique known as message passing. MPI establishes a practical, portable, efficient, and flexible standard for message passing that makes use of the most attractive features of a number of existing message-passing systems, rather than selecting one of them and adopting it as the standard. See "man intro_mpi" for additional information.

When creating an MPI program on Excalibur, ensure the following:

  • That the default MPI module (cray-mpich) has been loaded. To check this, run the "module list" command. If cray-mpich is not listed and a different MPI module is listed, use the following command:

    module swap other_mpi_module cray-mpich

    If no MPI module is loaded, load the cray-mpich module.

    module load cray-mpich

  • That the source code includes one of the following lines:
    INCLUDE "mpif.h"        ## for Fortran, or
    #include <mpi.h>        ## for C/C++

To compile an MPI program, use the following examples:

ftn -o mpi_program mpi_program.f         ## for Fortran, or
cc -o mpi_program mpi_program.c          ## for C/C++

The program can then be launched using the aprun command, as follows:

aprun -n mpi_procs mpi_program [user_arguments]

where mpi_procs is the number of MPI processes being started. For example:

#### starts 64 mpi processes; 32 on each node, one per core
## request 2 nodes, each with 32 cores and 32 processes per node
#PBS -l select=2:ncpus=32:mpiprocs=32
aprun -n 64 ./a.out
Accessing More Memory Per MPI Process

By default, one MPI process is started on each core of a node. This means that on Excalibur, the available memory on the node is split 32 ways. A common concern for MPI users is the need for more memory for each process. To allow an individual process to use more of the node's memory, you need to allow some cores to remain idle, using the "-N" option, as follows:

aprun -n mpi_procs -N mpi_procs_per_node mpi_program [user_args]

where mpi_procs_per_node is the number of MPI processes to be started on each node. For example:

####   starts 32 mpi processes; only 16 on each node
## request 2 nodes, each with 32 cores and 16 processes per node
#PBS -l select=2:ncpus=32:mpiprocs=16
aprun -n 32 -N 16 ./a.out  ## (assigns only 16 processes per node)

For more information about aprun, see the aprun man page.

5.1.2. Shared Memory (SHMEM)

The logically shared, distributed-memory access (SHMEM) routines provide high-performance, high-bandwidth communication for use in highly parallelized scalable programs. The SHMEM data-passing library routines are similar to the MPI library routines: they pass data between cooperating parallel processes. The SHMEM data-passing routines can be used in programs that perform computations in separate address spaces and that explicitly pass data to and from different processes in the program.

The SHMEM routines minimize the overhead associated with data-passing requests, maximize bandwidth, and minimize data latency. Data latency is the length of time between a process initiating a transfer of data and that data becoming available for use at its destination.

SHMEM routines support remote data transfer through "put" operations that transfer data to a different process and "get" operations that transfer data from a different process. Other supported operations are work-shared broadcast and reduction, barrier synchronization, and atomic memory updates. An atomic memory operation is an atomic read and update operation, such as a fetch and increment, on a remote or local data object. The value read is guaranteed to be the value of the data object just prior to the update. See "man intro_shmem" for details on the SHMEM library after swapping to the cray-shmem module (covered below).

When creating a pure SHMEM program on Excalibur, ensure the following:

  • That the MPICH module is not loaded. To check this, run the "module list" command. If cray-mpich is listed, use the following command:

    module unload cray-mpich

  • That the logically shared distributed memory access routines (module cray-shmem) are loaded. To check this, run the "module list" command. If cray-shmem is not listed, use the following command:

    module load cray-shmem

  • That the source code includes one of the following lines:

    INCLUDE 'mpp/shmem.fh'  ## for Fortran, or
    #include <mpp/shmem.h>  ## for C/C++

To compile a SHMEM program, use the following examples:

ftn -o shmem_program shmem_program.f90   ## for Fortran, or
cc -o shmem_program shmem_program.c      ## for C/C++

The ftn and cc wrappers resolve all SHMEM routine calls automatically. Specific mention of the SHMEM library is not required on the compilation line.

The program can then be launched using the aprun command, as follows:

aprun -n N ./shmem_program [user_arguments]

where N is the number of processes being started, with each process utilizing one core. The aprun command launches executables across a set of compute nodes. When each member of the parallel application has exited, aprun exits. For more information about aprun, type "man aprun".

5.1.3. Open Multi-Processing (OpenMP)

OpenMP is a portable, scalable model that gives programmers a simple and flexible interface for developing parallel applications. It supports shared-memory multiprocessing programming in C, C++, and Fortran, and consists of a set of compiler directives, library routines, and environment variables that influence compilation and run-time behavior.

When creating an OpenMP program on Excalibur, ensure the following:

  • That the default MPI module (cray-mpich) has been loaded. To check this, run the "module list" command. If cray-mpich is not listed and a different MPI module is listed, use the following command:

    module swap other_mpi_module cray-mpich

    If no MPI module is loaded, load the cray-mpich module.

    module load cray-mpich

  • That if using OpenMP functions (for example, omp_get_wtime), the source code includes one of the following lines:

    INCLUDE 'omp.h'     ## for Fortran, or
    #include <omp.h>    ## for C/C++

    Or, if the code is written in Fortran 90 or later, the following line may be used instead:

    USE omp_lib

  • That the compile command includes an option to reference the OpenMP library. The PGI, Cray, Intel, and GNU compilers support OpenMP, and each one uses a different option.

To compile an OpenMP program, use the following examples:

For C/C++ codes:

cc -o OpenMP_program -mp=nonuma OpenMP_program.c  ## PGI 
cc -o OpenMP_program -h omp OpenMP_program.c      ## Cray 
cc -o OpenMP_program -openmp OpenMP_program.c     ## Intel
cc -o OpenMP_program -fopenmp OpenMP_program.c    ## GNU

For Fortran codes:

ftn -o OpenMP_program -mp=nonuma OpenMP_program.f ## PGI 
ftn -o OpenMP_program -h omp OpenMP_program.f     ## Cray 
ftn -o OpenMP_program -openmp OpenMP_program.f    ## Intel
ftn -o OpenMP_program -fopenmp OpenMP_program.f   ## GNU

See section 5.2 for additional information on available compilers.

When running OpenMP applications, the $OMP_NUM_THREADS environment variable must be used to specify the number of threads. For example:

aprun -d 32 ./OpenMP_program [user_arguments]

In the example above, the application starts OpenMP_program on one node and spawns a total of 32 threads. Since Excalibur has 32 cores per compute node, this yields 1 thread per core.

5.1.4. Hybrid Processing (MPI/OpenMP)

An application built with the hybrid model of parallel programming can run on Excalibur using both OpenMP and Message Passing Interface (MPI). In hybrid applications, OpenMP threads can be spawned by MPI processes, but MPI calls should not be issued from OpenMP parallel regions or by an OpenMP thread.

When creating a hybrid (MPI/OpenMP) program on Excalibur, follow the instructions in the MPI and OpenMP sections above for creating your program. Then use the compilation instructions for OpenMP.

Use the aprun command and the $OMP_NUM_THREADS environment variable to run a hybrid program. You may need aprun options "-n", "-N", and "-d" to get the desired combination of MPI processes, nodes, and cores.

aprun -n mpi_procs -N mpi_procs_per_node -d threads_per_mpi_proc mpi_program

Note the product of mpi_procs_per_node and threads_per_mpi_proc (-N * -d) should not exceed 32, the number of cores on an Excalibur node.

In the following example, we want to run 8 MPI processes, and each MPI process needs about half the memory available on a node. We therefore request 4 nodes (96 cores). We also want each MPI process to launch 6 OpenMP threads, so we set the ompthreads select option accordingly and assign 6 threads per MPI process in the aprun command.

####  MPI/OpenMP on 4 nodes, 8 MPI processes total with 6 threads each
## request 4 nodes, each with 32 cores and 2 processes per node
#PBS -l select=4:ncpus=32:mpiprocs=2:ompthreads=6
## assign 8 MPI processes with 2 MPI processes per node 
aprun -n 8 -N 2 -d 6 ./xthi.x

In this example, each node gets two MPI processes, and all cores are assigned a thread. See the aprun man page for more detail on how MPI processes and threads are allocated on the nodes.

5.1.5. Partitioned Global Address Space (PGAS)

The Cray Fortran compiler supports Co-Array Fortran (CAF), and the Cray C compiler supports Unified Parallel C (UPC). These are PGAS extensions that enable the user to reference memory locations on any node, without the need for message-passing protocols. This can greatly simplify writing and debugging a parallel code. These compilers also allow the user to combine PGAS programming constructs with the flexibility of message-passing protocols. The PGAS extensions are not available for the PGI, Intel, or GNU compilers.

Cray Fortran and C reference manuals currently refer the reader to external sources for details on the CAF and UPC concepts and syntax. Users should follow the Cray document links in the Links to Vendor Documentation at the end of this guide to locate these reference manuals. The manuals will provide further links to the external sources.

Compilation of UPC and CAF codes is straightforward. Make sure to swap the programming environment module:

module swap PrgEnv-intel PrgEnv-cray

Then, simply use the standard Cray compilers with the following flags:

ftn -o myprog -h caf  myprog.f     ## for Fortran
cc -o myprog -h upc  myprog.c      ## for C/C++

Use the aprun command to execute the program as described above for MPI programs:

#PBS -l select=2:ncpus=32:mpiprocs=32
aprun -n 64 ./myprog

5.2. Available Compilers

Excalibur has four programming environment suites:

  • Portland Group (PGI)
  • Cray Fortran and C/C++
  • Intel
  • GNU

On Excalibur, different sets of compilers are used to compile codes for serial vs. parallel execution.

Compiling for the Compute Nodes

Codes compiled to run on the compute nodes may be serial or parallel. The x86-64 instruction set for Intel Haswell Xeon E5-2698 v3 processors has extensions for the Floating Point Unit (FPU) that require the module craype-haswell to be loaded. This module is loaded for you by default. To compile codes for execution on the compute nodes, the same compile commands are available in all programming environment suites as shown in the following table:

Compute Node Compiler Commands
Language PGI Cray Intel GNU Serial/Parallel
C cc cc cc cc Serial/Parallel
C++ CC CC CC CC Serial/Parallel
Fortran 77 f77 f77 f77 f77 Serial/Parallel
Fortran 90 ftn ftn ftn ftn Serial/Parallel
Compiling for the Login Nodes

Codes may be compiled to run on the login nodes in one of two ways. Either replace the craype-haswell module with the craype-target-native module and use the compiler commands from the table above, as follows:

module swap craype-haswell craype-target-native
cc myprog.c -o myprog.x

Note: If you use the above compiler commands with the craype-ivybridge module loaded, your executable will error with "illegal command".

Or, use the serial compiler commands from the table below.

Serial-Only Compiler Commands
Language PGI Cray Intel GNU Serial/Parallel
C pgcc cc icc gcc Serial
C++ pgCC CC icpc g++ Serial
Fortran 77 pgf77 ftn ifort gfortran Serial
Fortran 90 pgf90 ftn ifort gfortran Serial
Changing Compiler Suites

The Intel programming environment is loaded for you by default. To use a different suite, you will need to swap modules. See Relevant Modules (below) to learn how.

5.2.1. Portland Group (PGI) Compiler Suite

The PGI Programming Environment provides a large number of options that are the same for all compilers in the suite. The following table lists some of the more common options that you may use:

PGI Compiler Options
-c Generate intermediate object file but do not attempt to link.
-I directory Search in directory for include or module files.
-L directory Search in directory for libraries.
-o outfile Name executable "outfile" rather than the default "a.out".
-Olevel Set the optimization level. For more information on optimization, see the section on Profiling and Optimization.
-Mfree Process Fortran codes using free form.
-i8, -r8 Treat integer and real variables as 64-bit.
-Mbyteswapio Big-endian files; the default is for little-endian.
-g Generate symbolic debug information.
-Mbounds Add array bound checking.
-Minfo=all Reports detailed information about code optimizations to stdout as compile proceeds.
-Mlist Generate a file containing the compiler flags used and a line numbered listing of the source code.
-mp=nonuma Recognize OpenMP directives.
-Bdynamic Compiling using shared objects requires CCM mode for execution on compute nodes.
-Ktrap=* Trap errors such as floating point, overflow, and divide by zero (see man page).
-fPIC Generate position-independent code for shared libraries.

Detailed information about these and other compiler options is available in the PGI compiler (pgf95, pgcc, and pgCC) man pages on Excalibur.

5.2.2. Cray Compiler Environment

The Cray compiler has a long tradition of high performance compilers for excellent vectorization (it vectorizes more loops than other compilers) and cache optimization (automatic blocking and automatic management of what stays in cache).

The Partitioned address space (PGAS) languages such as Unified Parallel C (UPC) and Co-Array Fortran are supported on Excalibur via the Cray compiler.

The following table lists some of the more common options that you may use:

Cray Compiler Options
-c Generate intermediate object file but do not attempt to link.
-I directory Search in directory for include or module files.
-L directory Search in directory for libraries.
-o outfile Name executable "outfile" rather than the default "a.out".
-Olevel Set the optimization level. For more information on optimization, see the section on Profiling and Optimization.
-f free Process Fortran codes using free form.
-h byteswapio Big-endian files; the default is for little-endian.
-g Generate symbolic debug information.
-s integer64
-s real64
Treat integer and real variables as 64-bit.
-s default64 Pass -s integer64, -s real64 to compiler.
(set by default) Recognize OpenMP directives (disable "-h noomp").
-h upc ( only C) Recognize UPC.
-h caf Recognize Co-Array Fortran.
-h dynamic Compiling using shared objects requires CCM mode for execution on compute nodes.
-Ktrap=* Trap errors such as floating point, overflow, and divide by zero (see man page).
-fPIC Generate position-independent code for shared libraries.

Detailed information about these and other compiler options is available in the Cray compiler (ftn, cc, and CC) man pages on Excalibur.

5.2.3. Intel Compiler Environment

The following table lists some of the more common options that you may use:

Intel Compiler Options
-c Generate intermediate object file but do not attempt to link.
-I directory Search in directory for include or module files.
-L directory Search in directory for libraries.
-o outfile Name executable "outfile" rather than the default "a.out".
-Olevel Set the optimization level. For more information on optimization, see the section on Profiling and Optimization.
-free Process Fortran codes using free form.
-convert big_endian Big-endian files; the default is for little-endian.
-g Generate symbolic debug information.
-openmp Recognize OpenMP directives.
-Bdynamic Compiling using shared objects requires CCM mode for execution on compute nodes.
-fpe-all=0 Trap floating point, divide by zero, and overflow exceptions.
-fPIC Generate position-independent code for shared libraries.
-assume buffered_io Determines whether data is immediately read from or written to disk or accumulated in a buffer. The default for the Intel Fortran compiler is unbuffered I/O. This option can improved I/O performance and is also controlled by the FORT_BUFFERED, FORT_BUFFERCOUNT, and FORT_BLOCKSIZE variables.

Detailed information about these and other compiler options is available in the Intel compiler (ifort, icc, and icpc) man pages on Excalibur.

5.2.4. GNU Compiler Collection

The GNU Programming Environment provides a large number of options that are the same for all compilers in the suite. The following table lists some of the more common options that you may use:

GNU Compiler Options
-c Generate intermediate object file but do not attempt to link.
-I directory Search in directory for include or module files.
-L directory Search in directory for libraries.
-o outfile Name executable "outfile" rather than the default "a.out".
-Olevel Set the optimization level. For more information on optimization, see the section on Profiling and Optimization.
-g Generate symbolic debug information.
-fconvert=big-endian Big-endian files; the default is for little-endian.
Turns on increased error reporting.

Detailed information about these and other compiler options is available in the GNU compiler (gfortran, gcc, and g++) man pages on Excalibur.

5.3. Relevant Modules

By default, Excalibur loads the Intel programming environment for you. The PGI, Cray, and GNU environments are also available. To use either of these, the Intel module must be unloaded and replaced with the one you wish to use. To do this, use the "module swap" command as follows:

module swap PrgEnv-intel PrgEnv-pgi          ## To switch to PGI
module swap PrgEnv-intel PrgEnv-cray        ## To switch to Cray
module swap PrgEnv-intel PrgEnv-gnu          ## To switch to GNU

In addition to the compiler suites, all of these modules also load the MPICH2 and LibSci modules. The MPICH2 module initializes MPI. The LibSci module includes solvers and single-processor and parallel routines that have been tuned for optimal performance on Cray XC systems (BLAS, LAPACK, ScaLAPACK, etc.). For additional information on the MPICH2 and LibSci modules, see the intro_mpi and intro_libsci man pages on Excalibur.

The table below shows the naming convention for various programming environment modules.

Programming Environment Modules
Module Module Name
Cray CCEPrgEnv-cray

Under each programming environment, the compiler version can be changed. With the default Cray programming environment, for example, the compiler version can be changed from the default to version 8.3.5 with this command:

module swap cce cce/8.3.5

Use the "module avail" command to see all the available compiler versions for PGI, Cray CCE, Intel, and GNU.

A number of Cray-optimized libraries (e.g., FFTW, HDF5, NetCDF, and PETSc) are available on Excalibur with associated module files to set-up the necessary environment. As the environment depends on the active PrgEnv-* module, users should load library-related module files after changing the PrgEnv-* module.

When using SHMEM, load the cray-shmem module, as follows:

module load cray-shmem

For more information on using modules, see the Modules User Guide.

5.4. Libraries

Cray's LibSci and Intel's Math Kernel Libraries (Intel MKL) are both available on Excalibur. In addition, an extensive suite of math and science libraries are available in the $COST_HOME directory.

5.4.1. Cray LibSci

Excalibur provides Cray's LibSci library as part of the modules that are loaded by default. This library is a collection of single-processor and parallel numerical routines that have been tuned for optimal performance on Cray XC systems. The LibSci library contains optimized versions of many of the BLAS math routines as well as Cray versions of most of the ACML routines. Users can utilize the LibSci routines, instead of the public domain or user written versions, to optimize application performance on Excalibur.

The routines in LibSci are automatically included when using the ftn, cc, or CC commands. You do not need to use the "-l sci" flag in your compile command line.

Cray LibSci includes the following:

  • Basic Linear Algebra Subroutines (BLAS) - Levels 1, 2, and 3
  • Linear Algebra Package (LAPACK)
  • Scalable LAPACK (ScaLAPACK) (distributed-memory parallel set of LAPACK routines)
  • Basic Linear Algebra Communication Subprograms (BLACS)
  • Iterative Refinement Toolkit (IRT)
  • SuperLU (for large, sparse nonsymmetrical systems of linear equations)
5.4.2. Intel Math Kernel Library (Intel MKL)

Excalibur provides the Intel Math Kernel Library (Intel MKL), a set of numerical routines tuned specifically for Intel platform processors and optimized for math, scientific, and engineering applications. The routines, which are available via both FORTRAN and C interfaces, include:

  • LAPACK plus BLAS (Levels 1, 2, and 3)
  • ScaLAPACK plus PBLAS (Levels 1, 2, and 3)
  • Fast Fourier Transform (FFT) routines for single-precision, double-precision, single-precision complex, and double-precision complex data types
  • Discrete Fourier Transforms (DFTs)
  • Fast Math and Fast Vector Library
  • Vector Statistical Library Functions (VSL)
  • Vector Transcendental Math Functions (VML)

The MKL routines are part of the Intel Programming Environment as Intel's MKL is bundled with the Intel Compiler Suite.

Linking to the Intel Math Kernel Libraries can be complex and is beyond the scope of this introductory guide. Documentation explaining the full feature set along with instructions for linking can be found at the Intel Math Kernel Library documentation page.

Intel also makes a link advisor available to assist users with selecting proper linker and compiler options:

5.4.3. Additional Math Libraries

There is also an extensive set of Math libraries available in the $COST_HOME directory (/app/unsupported/COST) on Excalibur. The modules for accessing these libraries are also available in the default module path. Information about these libraries may be found on the Baseline Configuration website at BC policy FY13-01.

5.5. Debuggers

Excalibur provides the TotalView debugger and the DDT Debugger to assist users in debugging their code.

5.5.1. TotalView and DDT

TotalView is a debugger that supports threads, MPI, OpenMP, C/C++, and Fortran, mixed-language codes, advanced features like on-demand memory leak detection, other heap allocation debugging features, and the Standard Template Library Viewer (STLView). Unique features like dive, a wide variety of breakpoints, the Message Queue Graph/Visualizer, powerful data analysis, and control at the thread level are also available.

DDT is a debugger that supports threads, MPI, OpenMP, C/C++, and Fortran, Coarray Fortran, UPC, and CUDA. Memory debugging and data visualization are supported for large-scale parallel applications. The Parallel Stack Viewer is a unique way to see the program state of all processes and threads at a glance.


Follow the steps below to use TotalView on Excalibur via a UNIX X-Windows interface.

  1. Ensure that an X server is running on your local system. Linux users will likely have this by default, but MS Windows users will need to install a third party X Windows solution. There are various options available. Currently, we recommend VcXsrv or Xming.
  2. For Linux users, connect to Excalibur using "ssh -Y". Windows users will need to use PuTTY with X11 forwarding enabled (Connection->SSH->X11->Enable X11 forwarding).
  3. Compile your program on Excalibur with the "-g" option.
  4. Submit an interactive job:

    qsub -l select=1:ncpus=32:mpiprocs=32 -A Project_ID -l walltime=00:30:00 -q debug -X -I

    Once your job has been scheduled, you will be logged into an interactive batch session on a service node that is shared with other users.

  5. Load the TotalView module:

    module load totalview
  6. Start program execution:

    totalview aprun -a -n 4 ./my_mpi_prog.exe arg1 arg2 ...

  7. After a short delay, the TotalView windows will pop up. Click "GO" and then "Yes" to start program execution.

An example of using TotalView can be found in $SAMPLES_HOME/Programming/Totalview_Example on Excalibur. For more information on using TotalView, see the TotalView Documentation page.


To use DDT on Excalibur, follow steps 1 through 4 as for TotalView above, but load and use the DDT debugger instead.

  1. Load the DDT module:

    module load ddt

  2. Start program execution:

    ddt -n 4 ./my_mpi_prog.exe arg1 arg2 ...

  3. The DDT window will pop up. Verify the application name and number of MPI processes. Click "Run".

An example of using DDT can be found in $SAMPLES_HOME/Programming/DDT_Example on Excalibur. For more information on using DDT, see the DDT User Guide.

5.6. Code Profiling and Optimization

Profiling is the process of analyzing the execution flow and characteristics of your program to identify sections of code that are likely candidates for optimization, which increases the performance of a program by modifying certain aspects for increased efficiency.

We provide CrayPat to assist you in the profiling process. In addition, a basic overview of optimization methods with information about how they may improve the performance of your code can be found in Performance Optimization Methods (below).

5.6.1. CrayPat

CrayPat is an optional performance analysis tool used to evaluate program behavior on Cray supercomputer systems. CrayPat consists of the following major components: pat_build, pat_report, and pat_help. The data produced by CrayPat also can be used with Cray Apprentice2, an analysis tool that is used to visualize and explore the performance data captured during program execution.

Man pages are available for pat_build, pat_report, pat_help, and Apprentice2. Additional information can be found in the document "Using Cray Performance Analysis Tools."

The following steps should get you started using CrayPat:

  1. Load the "perftools" module

    module load perftools

  2. Compile the code, creating object files.

    ftn mycode.f90 -c

  3. Link the object files into your executable.

    ftn *.o -o mycode.x

  4. Use the pat_build command to generate an instrumented executable.

    pat_build -g mpi -u mycode.x mycode.x+pat

    This generates an instrumented executable called mycode+pat. Here the "-g" option enables the "mpi" tracegroup. See "man pat_build" for available tracegroups.

  5. Run the instrumented executable with aprun via PBS.

    aprun -n 4 ./mycode+pat

    This generates an instrumented output file (e.g., mycode+pat+2007-12tdt.xf).

  6. Use pat_report to display the statistics from the output file

    pat_report mycode+pat+2007-12tdt.xf > mycode.pat_report

Additional profiling options are available. See "man pat_build" for additional instrumentation options.

5.6.2. Additional Profiling Tools

There is also a set of profiling tools available in the $COST_HOME directory on Excalibur. Information about these tools may be found on the Baseline Configuration Web site at BC policy FY13-01.

5.6.3. Program Development Reminders

If an application is not programmed for distributed memory, then only the cores on a single node can be used. This is limited to 32 cores on Excalibur.

Keep the system architecture in mind during code development. For instance, if your program requires more memory than is available on a single node, then you will need to parallelize your code so that it can function across multiple nodes.

5.6.4. Compiler Optimization Options

The "-Olevel" option enables code optimization when compiling. The level that you choose (0-4) will determine how aggressive the optimization will be. Increasing levels of optimization may increase performance significantly, but you should note that a loss of precision may also occur. There are also additional options that may enable further optimizations. The following table contains the most commonly used options.

Compiler Optimization Options
Option Description Compiler Suite
-O0 No Optimization. (default in GNU) All
-O1 Scheduling within extended basic blocks is performed. Some register allocation is performed. No global optimization. All
-O2 Level 1 plus traditional scalar optimizations such as induction recognition and loop invariant motion are performed by the global optimizer. Generally safe and beneficial. (default in PGI, Cray, & Intel) All
-O3 Levels 1 and 2 plus more aggressive code hoisting and scalar replacement optimizations that may or may not be profitable. Generally beneficial. All
-O4 Levels 1, 2, and 3 plus hoisting of guarded invariant floating point expressions is enabled. PGI
Chooses generally optimal flags for the target platform. Includes: -O2 -Munroll=c:1 -Mnoframe -Mlre -Mautoinline -Mvect=sse -Mscalarsse -Mcache_align -Mflushz. PGI
-Mipa=fast,inline Performs Interprocedural Analysis (IPA) with generally optimal IPA flags for the target platform, and inlining. IPA can be very time-consuming. Flag must be used in both compilation and linking steps. PGI
Minline=levels:n Number of levels of inlining (default: n = 1) PGI
-fipa-* The GNU compilers automatically enable IPA at various -O levels. To set these manually, see the options beginning with -fipa in the gcc man page. GNU
-O ipan Specifies various levels of inlining (n=0-5) Cray
-O vectorn Specifies various levels of vectorization (n = 0-3) Cray
-finline-functions Enables function inlining within a single file Intel
-ipon Enables interprocedural optimization between files and produces up to n object files Intel
-inline-level=n Number of levels of inlining (default: n=2) Intel
-ra Creates a listing file with optimization info Cray
-Mlist Creates a listing file with optimization info PGI
-Minfo Info about optimizations performed PGI
-Mneginfo Info on why certain optimizations are not performed PGI
-opt-reportn Generate optimization report with n levels of detail Intel
5.6.5. Performance Optimization Methods

Optimization generally increases compilation time and executable size, and may make debugging difficult. However, it usually produces code that runs significantly faster. The optimizations that you can use will vary depending on your code and the system on which you are running.

Note: Before considering optimization, you should always ensure that your code runs correctly and produces valid output.

In general, there are four main categories of optimization:

  • Global Optimization
  • Loop Optimization
  • Interprocedural Analysis and Optimization(IPA)
  • Function Inlining
Global Optimization

A technique that looks at the program as a whole and may perform any of the following actions:

  • Performed on code over all its basic blocks
  • Performs control-flow and data-flow analysis for an entire program
  • Detects all loops, including those formed by IF and GOTOs statements and performs general optimization.
  • Constant propagation
  • Copy propagation
  • Dead store elimination
  • Global register allocation
  • Invariant code motion
  • Induction variable elimination
Loop Optimization

A technique that focuses on loops (for, while, etc.,) in your code and looks for ways to reduce loop iterations or parallelize the loop operations. The following types of actions may be performed:

  • Vectorization - rewrites loops to improve memory access performance. Some compilers may also support automatic loop vectorization by converting loops to utilize low-level hardware instructions and registers if they meet certain criteria.
  • Loop unrolling - (also known as "unwinding") replicates the body of loops to reduce loop branching overhead and provide better opportunities for local optimization.
  • Parallelization - divides loop operations over multiple processors where possible.
Interprocedural Analysis and Optimization (IPA)

A technique that allows the use of information across function call boundaries to perform optimizations that would otherwise be unavailable.

Function Inlining

A technique that seeks to reduce function call and return overhead. It:

  • Is used with functions that are called numerous times from relatively few locations.
  • Allows a function call to be replaced by a copy of the body of that function.
  • May create opportunities for other types of optimization
  • May not be beneficial. Improper use may increase code size and actually result in less efficient code.

6. Batch Scheduling

6.1. Scheduler

The Portable Batch System (PBS) is currently running on Excalibur. It schedules jobs and manages resources and job queues, and can be accessed through the interactive batch environment or by submitting a batch request. PBS is able to manage both single-processor and multiprocessor jobs. The PBS module is automatically loaded for you when you log in.

6.2. Queue Information

The following table describes the PBS queues available on Excalibur:

Queue Descriptions and Limits
Priority Queue
Max Wall
Clock Time
Max Cores
Per Job
Highest urgent Urgent 168 Hours N/A Designated urgent jobs by DoD HPCMP
Down Arrow for decreasing priority high High 168 Hours N/A Designated high-priority jobs by service/agency
frontier Frontier 168 Hours N/A Frontier jobs only
standard-long Standard 200 Hours 512 Access available by request
debug Debug 1 Hour N/A User diagnostic jobs
standard Standard 168 Hours N/A Normal user jobs
transfer N/A 48 Hours 1 Data transfer jobs
Lowest background Background 24 Hours 15000 User jobs that will not be charged against the project allocation

6.3. Interactive Logins

When you log in to Excalibur, you will be running in an interactive shell on a login node. The login nodes provide login access for Excalibur and support such activities as compiling, editing, and general interactive use by all users. Please note the Login Node Abuse Policy. The preferred method to run resource-intensive executions is to use an interactive batch session.

6.4. Interactive Batch Sessions

To get an interactive batch session, you must first submit an interactive batch job through PBS. This is done by executing a qsub command with the "-I" option from within the interactive login environment. For example:

qsub -l select=N1:ncpus=32:mpiprocs=N2 -A Project_ID -q queue_name -l walltime=HHH:MM:SS -I

You must specify the number of nodes requested (N1), the number of processes per node (N2), the desired maximum walltime, your project ID, and a job queue. Valid values for N2 are between 1 and 32.

Your interactive batch sessions will be scheduled just as normal batch jobs are scheduled depending on the other queued batch jobs, so it may take quite a while. Once your interactive batch shell starts, it will be running on a service node that is shared by other users. At this point, you can launch parallel applications onto your assigned set of compute nodes by using the aprun command. You can also run interactive commands or scripts on this service node, but you should limit your memory and cpu usage. Use the Cluster Compatibility Mode for executing memory- and process-intensive commands such as tar and gzip/gunzip and certain serial applications directly on a dedicated compute node.

6.5. Cluster Compatibility Mode (CCM)

You can also request direct access to a compute node by including the "ccm" option in your PBS interactive batch job submission. For example:

qsub -l ccm=1 -l select=N1:ncpus=32:mpiprocs=N2 -A Project_ID -q queue_name -l walltime=HHH:MM:SS -I

You must specify the number of nodes requested (N1) and the number of processes per node (N2), the desired maximum walltime, your project ID, and a job queue.

Once scheduled by the PBS scheduler, you will again have an interactive shell session on a shared service node. Then, issue the ccmlogin command, and you will be logged onto the first compute node in the set of nodes to which you have been assigned. Your environment will react much the same as a normal shared service node. However, you will now have dedicated access to the entire compute node which will allow you to run serial applications as well as memory- and process-intensive commands such as tar and gzip/gunzip without affecting other users.

6.6. Batch Request Submission

PBS batch jobs are submitted via the qsub command. The format of this command is:

qsub [ options ] batch_script_file

qsub options may be specified on the command line or embedded in the batch script file by lines beginning with "#PBS".

For a more thorough discussion of PBS batch submission, see the Excalibur PBS Guide.

6.7. Batch Resource Directives

Batch resource directives allow you to specify to PBS how your batch jobs should be run and what resources your job requires. Although PBS has many directives, you only need to know a few to run most jobs.

The basic syntax of PBS directives is as follows:

#PBS option[[=]value]

where some options may require values to be included. For example, to start a 16-process job, you would request one node of 32 cores and specify that you will be running 16 processes per node:

#PBS -l select=1:ncpus=32:mpiprocs=16

The following directives are required for all jobs:

Required PBS Directives
Directive Value Description
-A Project_ID Name of the project
-q queue_name Name of the queue
-l select=N1:ncpus=32:mpiprocs=N2 N1 = Number of nodes
N2 = MPI processes per node
(N2 must be: 1, 2, 4, 8, 16, or 32)
-l walltime=HHH:MM:SS Maximum wall time

A more complete listing of batch resource directives is available in the Excalibur PBS Guide.

6.8. Launch Commands

On Excalibur the PBS batch scripts and the PBS interactive login session run on a service node, not a compute node. The only way to send your executable to the compute nodes is to use the aprun command. The following example command line could be used within your batch script or in a PBS interactive session, sending the executable ./a.out to 64 compute cores.

aprun -n 64 ./a.out

Common Options for Aprun
Option Description
-A # The total number of MPI processes.
-N # The number of MPI processes to place per node.
Useful for getting more memory per MPI process.
-d # The number of threads per node in OpenMP.
May also be used to processes on cores.
-B Directs aprun to get values for -n, -N, and -d from PBS directives
instead of from the aprun command line. Simplifies and saves time.
-S # The number of MPI processes to place per NUMA (8 cores with shared L3 cache).
Useful for getting more L3 cache per process.
-j 1 Run in single-stream mode, using only one core per core pair.
Useful for getting more L2 cache, memory, resources per MPI process.

For more in-depth discussion of the aprun options, consult the aprun man page and the Excalibur PBS Guide.

A serial executable can be sent to one compute node using aprun or ccmrun:

aprun -n 1 serial_executable ## OR
ccmrun serial_executable

It is also possible to run a script on one compute node using ccmrun when the Cluster Compatibility Mode has been envoked (-l ccm=1).

ccmrun script_to_run

Use aprun to launch MPI, SHMEM, OpenMP, Hybrid MPI/OpenMP, and PGAS executables. For examples of this, see MPI, SHMEM, OpenMP, Hybrid MPI/OpenMP, and PGAS (above) or look in the $SAMPLES_HOME directory on Excalibur. For more information about aprun, see the aprun man page.

6.9. Sample Script

While it is possible to include all PBS directives at the qsub command line, the preferred method is to embed the PBS directives within the batch request script using "#PBS". The following script is a basic example and contains all of the required directives, some frequently used optional directives, and common script components. It starts 64 processes on 2 nodes of 32 cores each, with one MPI process per core. More thorough examples are available in the Excalibur PBS Guide and in the Sample Code Repository ($SAMPLES_HOME) on Excalibur.

## The first line (above) specifies the shell to use for parsing the
## remaining lines of the batch script.

## Required PBS Directives --------------------------------------
#PBS -A Project_ID
#PBS -q standard
#PBS -l select=2:ncpus=32:mpiprocs=32
#PBS -l walltime=12:00:00

## Optional PBS Directives --------------------------------------
#PBS -N Test_Run_1
#PBS -j oe
#PBS -S /bin/bash
#PBS -l ccm=1
## ccm=1 option for Cluster Compatibility Mode, including using
## executables compiled with Dynamic Shared Libraries and access
## to the remote license server for licensed COTS codes.

## Execution Block ----------------------------------------------
# Environment Setup
# cd to your scratch directory
# $JOBDIR is a directory that is created when your job runs.
# Files within $JOBDIR are protected from our file scrubber 
# for the duration of the job, plus 21 days after it finishes.
# Files NOT within a $JOBDIR are susceptible to the normal
# 21 day file lifespan.
cd ${JOBDIR}

# copy the executable from $HOME
cp ${HOME}/my_prog.exe .

# Launching -----------------------------------------------------
aprun -n ${BC_MPI_TASKS_ALLOC} ./my_prog.exe > my_prog.out

# Clean up ------------------------------------------------------
# archive your results
# Using the "here document" syntax, create a job script
# for archiving your data.
rm -f archive_job
cat >archive_job <<END
#PBS -l walltime=12:00:00
#PBS -q transfer
#PBS -A Project_ID
#PBS -l select=1:ncpus=1
#PBS -j oe
#PBS -S /bin/bash

# Single files are easier and faster to retrieve from the
# archive than multiple files, so create a .tar file of your 
# results. 
tar cvf ${PBS_JOBID}.tar ${JOBDIR}

# Create a directory in $ARCHIVE_HOME named after this
# PBS job id and place your .tar file there.
archive mkdir -C ${ARCHIVE_HOME} ${PBS_JOBID}
archive put -C ${ARCHIVE_HOME}/${PBS_JOBID} ${PBS_JOBID}.tar
archive ls ${ARCHIVE_HOME}/${PBS_JOBID}

# Remove scratch directory from the file system.
rm -rf ${JOBDIR}

# Submit the archive job script.
qsub archive_job

Additional examples are available in the Excalibur PBS Guide and in the Sample Code Repository ($SAMPLES_HOME) on Excalibur.

6.10. PBS Commands

The following commands provide the basic functionality for using the PBS batch system:

qsub: Used to submit jobs for batch processing.
qsub [ options ] my_job_script

qstat: Used to check the status of submitted jobs.
qstat PBS_JOBID ## check one job
qstat -u my_user_name ## check all of user's jobs

qdel: Used to kill queued or running jobs.

A more complete list of PBS commands is available in the Excalibur PBS Guide.

6.11. Determining Time Remaining in a Batch Job

In batch jobs, knowing the time remaining before the workload management system will kill the job enables the user to write restart files or even prepare input for the next job submission. However, adding such capability to an existing source code requires knowledge to query the workload management system as well as parsing the resulting output to determine the amount of remaining time.

The DoD HPCMP allocated systems now have the library, WLM_TIME, as an easy way to provide the remaining time in the batch job to C, C++, and Fortran programs. The library can be added to your job using the following:

For C:

#include <wlm_time.h>
void wlm_time_left(long int *seconds_left)

For Fortran:

INTEGER seconds_left

For C++:

extern "C" {
#include <wlm_time.h>

For simplicity, wall-clock-time remaining is returned as an integer value of seconds.

To simplify usage, a module file defines the process environment, and a pkg-config metadata file defines the necessary compiler linker options:

For C:

module load wlm_time
$(CC) ctest.c `pkg-config --cflags --libs wlm_time`

For Fortran:

module load wlm_time
$(F90) test.f90 `pkg-config --cflags-only-I --libs wlm_time`

For C++:

module load wlm_time
$(CXX) Ctest.C `pkg-config --cflags --libs wlm_time`

WLM_TIME works currently with PBS. The developers expect that WLM_TIME will continue to provide a uniform interface encapsulating the underlying aspects of the workload management system.

6.12. Advance Reservations

A subset of Excalibur's nodes has been set aside for use as part of the Advance Reservation Service (ARS). The ARS allows users to reserve a user-designated number of nodes for a specified number of hours starting at a specific date/time. This service enables users to execute interactive or other time-critical jobs within the batch system environment. The ARS is accessible via most modern web browsers at Authenticated access is required. The ARS User Guide is available on HPC Centers.

7. Software Resources

7.1. Application Software

A complete listing with installed versions can be found on our software page. The general rule for all COTS software packages is that the two latest versions will be maintained on our systems. For convenience, modules are also available for most COTS software packages.

7.2. Useful Utilities

The following utilities are available on Excalibur:

Useful Utilities
archive Perform basic file-handling operations on the MSAS.
check_license Checks the status of HPCMP shared applications.
mpscp High-performance remote file copy.
node_use Display the amount of free and used memory for login nodes.
qpeek Display spooled stdout and stderr for an executing batch job.
qview Display information about batch jobs and queues.
show_queues Report current batch queue status, usage, and limits.
show_storage Display MSAS allocation and usage by subproject.
show_usage Display CPU allocation and usage by subproject.
dos2unix Strip DOS end-of-record control characters from a text file.
tail Display the last five lines of one or more files.

7.3. Sample Code Repository

The Sample Code Repository is a directory that contains examples for COTS batch scripts, building and using serial and parallel programs, data management, and accessing and using serial and parallel math libraries. The $SAMPLES_HOME environment variable contains the path to this area, and is automatically defined in your login environment.

Sample Code Repository on Excalibur
Application-specific examples; interactive job submit scripts; use of the application name resource; software license use.
abaqusBasic batch script and input deck for an Abaqus application.
ale3dBasic batch script and input deck for an ALE3D application.
amberBasic batch script for an AMBER9 application.
ansysBasic batch script for an ANSYS application.
castepBasic batch script and input deck for an CASTEP application.
cfd++Basic batch script and input deck for an CFD++ application.
cfxBasic batch script and input deck for an ANSYS CFX application.
cthBasic batch script and input deck for an CTH application.
dmol3Basic batch script and input deck for an DMOL3 application.
epicBasic batch script and input deck for an EPIC application.
espressoBasic batch script for an ESPRESSO application.
fluentBasic batch script and input deck for a FLUENT (now ACFD) application.
GAMESSauto_submit script and input deck for a GAMESS application.
gaussianInput deck for a GAUSSIAN application and automatic submission script for submitting a Gaussian job.
gromacsBasic batch script and input deck for a GROMACS application
gulpBasic batch script and input deck for a GULP application
lammpsBasic batch script and input deck for a LAMMPS application.
ls-dynaBasic batch script and input deck for a LS-DYNA application.
lsoptBasic batch script and input deck for using LSOPT to optimize an LS-DYNA application.
matlabBasic batch script and sample m file for a MATLAB application.
mesodynBasic batch script for a MESODYN application.
MOLPROBasic batch script and input deck for a MOLPRO application.
nwchemBasic batch script and input deck for a NWCHEM application.
picalcBasic PBS example batch script.
STARCCM+Basic batch script and input deck for a STARCCM+
XpatchBasic batch script and input deck for a Xpatch application.
Archiving and retrieving files; Lustre striping; file searching; $WORKDIR use.
MPSCP_ExampleDirectory containing a README file giving examples of how to use the mpscp command to transfer files between Excalibur and remote systems.
Transfer_ExampleSample batch script showing how to stage data out after a job executes using the transfer queue.
Transfer_Queue_with_Archive_CommandsSample directory containing sample batch scripts demonstrating how to use the transfer queue to retrieve input data for a job, chain a job that uses that data to run a parallel computation, then chain that job to another that uses the transfer queue to put the data back in archive for long term storage.
MPI, OpenMP, and hybrid examples; single-core jobs; large memory jobs; running multiple applications within a single batch job.
HybridSimple MPI/OpenMP hybrid example and batch script.
MPI_PBS_sampleSimple MPI examples and batch scripts for IntelMPI, OpenMPI and IBM/PE.
OpenMPSimple Open MP example and batch script.
Serial_runSimple batch script to run a single core job.
Basic code compilation; debugging; use of library files; static vs. dynamic linking; Makefiles; Endian conversion.
BLACS_ExampleSample ScaLAPACK Fortran program, compile sscript and PBS submission scripts.
CCM-DSL_ExampleSimple example for compiling and running a DSL (Dynamic Shared Library) executable using CCM (Cluster Compatibility Mode) mode on the compute nodes.
COMPILE_INFOProvides common options for Compiling and Configure
Core_FilesProvides Examples of three core file viewers.
DDT_ExampleUsing DDT to debug a small example code in an interactive batch job.
Endian_ConversionInstructions on how to manage data created on a machine with different Endian format.
GPU_ExamplesSeveral examples demonstrating use of system tools, compilation techniques, and PBS scripts to generate and execute code using the GPGPU accelerators on Excalibur.
Large_Memory_ExampleSimple example of how to run a job using Large-Memory nodes.
Memory_UsageSample build and script that shows how to determine the amount of memory being used by a process.
Open_Files_LimitsThis example discusses the maximum number of simultaneously open files an MPI process may have, and how to adjust the appropriate settings in a PBS job.
ScaLAPACK_ExampleSample ScaLAPACK Fortran program, compile sscript and PBS submission scripts.
SO_CompileSimple example of creating a SO (Shared Object) library and using it to compile and running against it on the compute nodes.
Timers_FortranSerial Timers using Fortran Intrinsics f77 and f90/95.
Totalview_ExampleInstructions on how to use the TotalView debugger to debug MPI code.
Use of modules; customizing the login environment.
Module_Swap_ExampleInstructions for using module swap command.
DocumenationContains Excalibur Users Guide.
Basic batch scripting; use of the transfer queue; job arrays; job dependencies; Secure Remote Desktop; job monitoring.
BatchScript_ExampleBasic PBS batch script example.
Core_Info_ExampleSample code for generating the MPI process/core or OpenMP thread/core associativity in compute jobs.
DocumentationMicrosoft Word version of the PBS User's Guide.
Hybrid_ExamplesSimple MPI/OpenMP hybrid example and batch script.
Interactive_ExampleInstructions on how to submit an interactive PBS job.
Job_Array_ExampleInstructions and example job script for using job arrays.
MPI_ExampleSample scripts for running MPI jobs under the C and Bash shells.
OpenMP_ExampleSample script for running OpenMP jobs.
Serial_ExampleSample script for running multiple sequential jobs.
Transfer_Queue_ExamplePBS batch script example for data transfer.

8. Links to Vendor Documentation

Cray Home:
XC Series Programming Environment User Guide (17.05) S-2529

Novell Home:
Novell SUSE Linux Enterprise Server:

GNU Home:
GNU Compiler:

Portland Group Resources Page:
Portland Group User's Guide:

Intel Documentation:
Intel Compiler List:

TotalView Documentation:
DDT Tutorials: