titan

Up since 11/8/17 02:45 pm

eos

Up since 11/14/17 11:20 pm

rhea

Up since 10/17/17 05:40 pm

hpss

Up since 11/20/17 09:15 am

atlas1

Up since 11/15/17 07:25 am

atlas2

Up since 11/14/17 09:20 am
OLCF User Assistance Center

The center's normal support hours are 9 a.m. until 5 p.m. (Eastern time) Monday through Friday, exclusive of holidays. Outside of normal business hours, calls are directed to the ORNL Computer Operations staff. If you require immediate assistance outside of normal business hours, you may contact them at the phone number listed above. If your request is not urgent, you may send an email to help@nccs.gov, where it will be answered by a NCCS User Assistance member the next business day.

Eos User Guide

Eight Things to Know About Eos

1. Access

Users can access Eos via SSH at: eos.ccs.ornl.gov

All 2014 INCITE, ALCC, and NOAA project are given access to Eos. All 2013 INCITE projects were given access to Eos in October, 2013 and should have access through the end of the project allocation. Members of Director’s Discretionary accounts can request access to Eos by sending an email titled “Access to EOS” to help@olcf.ornl.gov that details why Eos is needed and gives an account of the size and purpose of the planned jobs.

2. Usage

Suitable uses of Eos include tools and application porting, software verification and optimization, software generation, and small-scale jobs that perform functions such as verifying input files, geometries, and physics parameterizations for the purpose of preparation of capability jobs on Titan.

3. Configuration

Eos is a Cray XC30 cluster with 736 nodes and total of 47.104 TB of memory. The processor is the Intel® Xeon® 5E-2670. Each XC30 CPU has (16) cores per node for a total of 11,776 traditional processor cores. Nodes are connected by Aries interconnect in a network topology called Dragonfly. Eos has no GPUs. For more information, see the Eos Overview page.

4. Hyper-Threading

The XC30 has Intel Hyper Threading that allows each physical core to function as two logical cores. The -j1 option to aprun disables Hyper Threading. For more information, see the Hyper Threading page.

5. Similar Software

Eos has the same selection of compilers, compiler wrappers, and much of the same software as Titan. The Intel programming environment and compiler are the default on Eos. For more information, see the Programming Environment pages.

6. Eos Billing and Allocations

(30) Eos core hours are charged per node. Eos allocations will be given separately from Titan allocations and therefore over-useage on one system will not impact queue priory on the other. For more information, see the Resource Accounting page and the Eos Scheduling Policy page.

7. Thread Affinity  Example

Click here for an Eos thread affinity example.

8. Eos has Remote Job Submission

Enhance your project’s data workflow by using the remote job submission feature, which allows you to submit batch scripts from one OLCF machine to another. For example, you could submit a script from Titan that actives a transfers to the hpss, and/or a data analysis application on Eos when the job on Titan has finished running.
For details and examples please click here.

Contents


1. Eos Overview

(Back to Top)

Overview
Starting March 3rd, 2014, the Eos system will be available to all OLCF projects and prioritized as a support resource for projects running or preparing to run production and leadership capability jobs on Titan. Suitable uses of Eos include tools and application porting, software verification and optimization, software generation, and small-scale jobs that perform functions such as verifying input files, geometries, and physics parameterizations for the purpose of preparation of capability jobs on Titan. Eos is a 736-node Cray XC30 cluster with a total of 47.104 TB of memory. The processor is the Intel® Xeon® E5-2670. Eos uses Cray’s Aries interconnect in a network topology called Dragonfly. Aires provides a higher bandwidth and lower latency interconnect than Gemini. Support for I/O on Eos is provided by (16) I/O service nodes. The system has (2) external login nodes.
Compute Partition
The compute nodes are organized in blades. Each blade contains (4) nodes connected to a single Aries interconnect. Every node has (64) GB of DDR3 SDRAM and (2) sockets with (8) physical cores each. In total, the Eos compute partition contains 11,776 traditional processor cores (23,552 logical cores with Intel Hyper-Threading enabled), and 47.104 TB of memory.
Hyper-threading
Intel's Hyper-threading (HT) technology allows each physical core to work as two logical cores so each node can functions as if it has (32) cores. Each of the two logical cores can store a program state, but they share most of their execution resources. Each application should be tested to see how HT impacts performance. The best candidates for a performance boost with HT are codes that are heavily memory-bound. The default setting on Eos is to execute with HT. Users may implicitly disable HT by launching fewer than 16 threads per node or explicitly disable HT by passing the -j1 option to aprun. More detailed information about HT is available on the Hyper Threading page.
File Systems
The OLCF's center-wide Lustre® file system, named Spider, is available on Titan for computational work. With over (32) PB of disk space, it is the largest-scale Lustre file system in the world. A separate, NFS-based filesystem provides $HOME storage areas, and an HPSS-based file system provides Titan users with archival spaces.
Access and Resource Accounting
The charging factor for usage is (30) core hours per node.
Programming Environment
The default compiler and programming environment are Intel. The following programming environment modules are available on Eos:
  • PrgEnv-pgi
  • PrgEnv-gnu
  • PrgEnv-cray
  • PrgEnv-intel
Most of the software and libraries provided on Titan for use with CPUs is also be provided on Eos. One notable difference is that Eos has the MKL rather than AMCL math libraries.


2. Access to Eos

(Back to Top)

All 2014 INCITE, ALCC, and NOAA project are given access to Eos. All 2013 INCITE projects were given access to Eos in October, 2013 and should have access through the end of the project allocation.

Members of Director's Discretionary accounts can request access to Eos by sending an email titled "Access to EOS" to help@olcf.ornl.gov.  Please list your project identifier and the name of the project PI. State why you need Eos and give a detailed account of the size and purpose of the jobs that you plan to run.

Suitable uses of Eos include tools and application porting, software verification and optimization, software generation, and small-scale jobs that perform functions such as verifying input files, geometries, and physics parameterizations for the purpose of preparation of capability jobs on Titan. Please see the Eos Scheduling Policy for queues and queue limits.


3. OLCF Help and Policies

(Back to Top)

The OLCF provides many tools to assist users, including direct hands-on assistance by trained consultants. Means of assistance at the OLCF include:

  • The OLCF User Assistance Center (UAC), where consultants answer your questions directly via email or phone.
  • Various OLCF communications, which provide status updates of relevance to end-users.
  • The My OLCF site, which provides a mechanism for viewing project allocation reports.
  • The OLCF Policy Guide, which details accepted use of our computational resources.
  • Upcoming and historical OLCF Training Events, both in-person and web-based, that cover topics of interest to end-users.


3.1. User Assistance Center

(Back to Top)

The OLCF User Assistance Center (UAC) provides direct support to users of our computational resources.

Hours
The center’s normal support hours are 9am EST to 5pm EST Monday through Friday, exclusive of holidays.
Contact Us
Email help@olcf.ornl.gov
Phone: 865-241-6536
Fax: 865-241-4011
Address: 1 Bethel Valley Road, Oak Ridge, TN 37831
The OLCF UAC is located at the Oak Ridge National Laboratory (ORNL) in Building 5600, Room C103.
After Hours
Outside of normal business hours, calls are directed to the ORNL Computer Operations staff. If you require immediate assistance, you may contact them at the phone number listed above. If your request is not urgent, you may send an email to help@olcf.ornl.gov, where it will be answered by a OLCF User Assistance member the next business day.
Ticket Submission Webform
In lieu of sending email, you can also use the Ticket Submission Web Form to submit a request directly to OLCF User Assistance.


3.2. Communications to Users

(Back to Top)

The OLCF provides users with several ways of staying informed.

OLCF Announcements Mailing Lists
These mailing lists provides users with email messages of general interest (system upgrades, long-term outages, etc.) Since the mailing frequency is low and the information sent is important to all users, users are automatically subscribed to these lists as applicable when an account is set up.
OLCF "Notice" Mailing Lists
The OLCF also utilizes high volume mail lists to automatically announce system state changes as well as other notable system events. Users who are actively using a system are automatically added to a system's mail list. When a system changes state (up to down or down to up), an automated email is sent to members of the system's notice list. We also send additional notable issues and time sensitive events to the list.
Available Lists
titan-notice rhea-notice eos-notice spider-notice
Users can request to be permanently added or removed from a list by contacting the OLCF User Assistance Center.
Weekly Update
Each week, typically on Friday afternoon, an email announcing the next week’s scheduled outages is sent to all users. This message also includes meeting announcements and other items of interest to all OLCF users. If you are an OLCF user but are not receiving this weekly message, please contact the OLCF User Assistance Center.
System Status Pages
The OLCF Main Support page shows the current up/down status of selected OLCF systems at the top.
Twitter
The OLCF posts messages of interest on the OLCF Twitter Feed. We also post tweets specific to system outages on the OLCF Status Twitter Feed.
Message of the Day
In addition to other methods of notification, the system "Message of the Day" (MOTD) that is echoed upon login shows recent system outages. Important announcements are also posted to the MOTD. Users are encouraged to take a look at the MOTD upon login to see if there are any important notices.


3.3. My OLCF Site

(Back to Top)

To assist users in managing project allocations, we provide end-users with My OLCF, a web application with valuable information about OLCF projects and allocations on a per user basis. Users must login to the site with their OLCF username and SecurID fob: https://users.nccs.gov Detailed metrics for users and projects can be found in each project's usage section:

  • YTD usage by system, subproject, and project member
  • Monthly usage by system, subproject, and project member
  • YTD usage by job size groupings for each system, subproject, and project member
  • Weekly usage by job size groupings for each system, and subproject
  • Batch system priorities by project and subproject
  • Project members


3.4. Special Requests and Policy Exemptions

(Back to Top)

Users can request policy exemptions by submitting the appropriate web form available on the OLCF Documents and Forms page. Special requests forms allow a user to:

  • Request Software installations
  • Request relaxed queue limits for a job
  • Request a system reservation
  • Request a disk quota increase
  • Request a User Work area purge exemption
Special requests are reviewed weekly and approved or denied by management via the OLCF Resource Utilization Council.


3.5. OLCF Acknowledgement

(Back to Top)

Users should acknowledge the OLCF in all publications and presentations that speak to work performed on OLCF resources:

This research used resources of the Oak Ridge Leadership Computing Facility at the Oak Ridge National Laboratory, which is supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC05-00OR22725.


4. Accessing OLCF Systems

(Back to Top)

This section covers the basic procedures for accessing OLCF computational resources. To avoid risks associated with using plain-text communication, the only supported remote client on OLCF systems is a secure shell (SSH) client, which encrypts the entire session between OLCF systems and the client system.

Note: To access OLCF systems, your SSH client must support SSH protocol version 2 (this is common) and allow keyboard-interactive authentication.
For UNIX-based SSH clients, the following line should be in either the default ssh_config file or your $HOME/.ssh/config file:
PreferredAuthentications keyboard-interactive,password
The line may also contain other authentication methods, but keyboard-interactive must be included. SSH clients are also available for Windows-based systems, such as SecureCRT published by Van Dyke Software. For recent SecureCRT versions, the preferred authentications change above can be made through the "connection properties" menu.


4.1. OLCF System Hostnames

(Back to Top)

Each OLCF system has a single, designated hostname for general user-initiated user connections. Sometimes this is a load-balancing mechanism that will send users to other hosts as needed. In any case, the designated OLCF host names for general user connections are as follows:

System Name Hostname RSA Key Fingerprint
Titan titan.ccs.ornl.gov 77:dd:c9:2c:65:2f:c3:89:d6:24:a6:57:26:b5:9b:b7
Rhea rhea.ccs.ornl.gov 9a:72:79:cf:9e:47:33:d1:91:dd:4d:4e:e4:de:25:33
Eos eos.ccs.ornl.gov e3:ae:eb:12:0d:b1:4c:0b:6e:53:40:5c:e7:8a:0d:19
Everest everest.ccs.ornl.gov cc:6e:ef:84:7e:7c:dc:72:71:7b:76:7f:f3:46:57:2b
Sith sith.ccs.ornl.gov 28:63:5e:41:32:39:c2:ec:9b:63:e0:86:16:2f:e4:bd
Data Transfer Nodes dtn.ccs.ornl.gov b3:31:ac:44:83:2b:ce:37:cc:23:f4:be:7a:40:83:85
Home (machine) home.ccs.ornl.gov ba:12:46:8d:23:e7:4d:37:92:39:94:82:91:ea:3d:e9
For example, to connect to Titan from a UNIX-based system, use the following:
$ ssh userid@titan.ccs.ornl.gov


4.2. General-Purpose Systems

(Back to Top)

After a user account has been approved and created, the requesting user will be sent an email listing the system(s) to which the user requested and been given access. In addition to the system(s) listed in the email, all users also have access to the following general-purpose systems:

home.ccs.ornl.gov
Home is a general purpose system that can be used to log into other OLCF systems that are not directly accessible from outside the OLCF network. For example, running the screen or tmux utility is one common use of Home. Compiling, data transfer, or executing long-running or memory-intensive tasks should never be performed on Home. More information can be found on the The Home Login Host page.
dtn.ccs.ornl.gov
The Data Transfer Nodes are hosts specifically designed to provide optimized data transfer between OLCF systems and systems outside of the OLCF network. More information can be found on the Employing Data Transfer Nodes page.
HPSS
The High Performance Storage System (HPSS) provides tape storage for large amounts of data created on OLCF systems. The HPSS can be accessed from any OLCF system through the hsi utility. More information can be found on the HPSS page.


4.3. X11 Forwarding

(Back to Top)

Automatic forwarding of the X11 display to a remote computer is possible with the use of SSH and a local X server. To set up automatic X11 forwarding within SSH, you can do (1) of the following:

  • Invoke ssh on the command line with:
    $ ssh -X hostname
    Note that use of the -x option (lowercase) will disable X11 forwarding.
  • Edit (or create) your $HOME/.ssh/config file to include the following line:
    ForwardX11 yes
All X11 data will go through an encrypted channel. The $DISPLAY environment variable set by SSH will point to the remote machine with a port number greater than zero. This is normal, and happens because SSH creates a proxy X server on the remote machine for forwarding the connections over an encrypted channel. The connection to the real X server will be made from the local machine.
Warning: Users should not manually set the $DISPLAY environment variable for X11 forwarding; a non-encrypted channel may be used in this case.


4.4. RSA Key Fingerprints

(Back to Top)

Occasionally, you may receive an error message upon logging in to a system such as the following:

@@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
This can be a result of normal system maintenance that results in a changed RSA public key, or could be an actual security incident. If the RSA fingerprint displayed by your SSH client does not match the OLCF-authorized RSA fingerprint for the machine you are accessing, do not continue authentication; instead, contact help@olcf.ornl.gov.


4.5. Authenticating to OLCF Systems

(Back to Top)

All OLCF systems currently employ two-factor authentication only. To login to OLCF systems, an RSA SecurID® key fob is required. Image of an RSA SecudID fob

Activating a new SecurID® fob
  1. Initiate an SSH connection to username@home.ccs.ornl.gov.
  2. When prompted for a PASSCODE, enter the 6-digit code shown on the fob.
  3. You will be asked if you are ready to set your PIN. Answer with "Y".
  4. You will be prompted to enter a PIN. Enter a (4) to (6) digit number you can remember. You will then be prompted to re-enter your PIN.
  5. You will then be prompted to wait until the next code appears on your fob and to enter your PASSCODE. When the (6) digits on your fob change, enter your PIN digits followed immediately by the new (6) digits displayed on your fob. Note that any set of (6) digits on the fob can only be "used" once.
  6. Your PIN is now set, and your fob is activated and ready for use.
Using a SecurID® fob
When prompted for your PASSCODE, enter your PIN digits followed immediately by the (6) digits shown on your SecurID® fob. For example, if your pin is 1234 and the (6) digits on the fob are 000987, enter 1234000987 when you are prompted for a PASSCODE.
Warning: The 6-digit code displayed on the SecurID fob can only be used once. If prompted for multiple PASSCODE entries, always allow the 6-digit code to change between entries. Re-using the 6-digit code can cause your account to be automatically disabled.


5. Data Management

(Back to Top)

OLCF users have many options for data storage. Each user has a series of user-affiliated storage spaces, and each project has a series of project-affiliated storage spaces where data can be shared for collaboration. The storage areas are mounted across all OLCF systems, making your data available to you from multiple locations.

A Storage Area for Every Activity
The storage area to use in any given situation depends upon the activity you wish to carry out. Each User has a User Home area on a Network File System (NFS) and a User Archive area on the archival High Performance Storage System (HPSS). User storage areas are intended to house user-specific files. Individual Projects have a Project Home area on NFS, multiple Project Work areas on Lustre, and a Project Archive area on HPSS. Project storage areas are intended to house project-centric files.
Simple Guidelines
The following sections contain a description of all available storage areas and relevant details for each. If you're the impatient type, you can probably get right to work by adhering to the following simple guidelines:
If you need to store... then use... at path...
Long-term data for routine access that is unrelated to a project User Home $HOME
Long-term data for archival access that is unrelated to a project User Archive /home/$USER
Long-term project data for routine access that's shared with other project members Project Home /ccs/proj/[projid]
Short-term project data for fast, batch-job access that you don't want to share Member Work $MEMBERWORK/[projid]
Short-term project data for fast, batch-job access that's shared with other project members Project Work $PROJWORK/[projid]
Short-term project data for fast, batch-job access that's shared with those outside your project World Work $WORLDWORK/[projid]
Long-term project data for archival access that's shared with other project members Project Archive /proj/[projid]


5.1. User-Centric Data Storage

(Back to Top)

Users are provided with several storage areas, each of which serve different purposes. These areas are intended for storage of data for a particular user and not for storage of project data. The following table summarizes user-centric storage areas available on OLCF resources and lists relevant polices.

User-Centric Storage Areas
Area Path Type Permissions Quota Backups Purged Retention
User Home $HOME NFS User-controlled 10 GB Yes No 90 days
User Archive /home/$USER HPSS User-controlled 2 TB [1] No No 90 days
[1] In addition, there is a quota/limit of 2,000 files on this directory.


5.1.1. User Home Directories (NFS)

(Back to Top)

Each user is provided a home directory to store frequently used items such as source code, binaries, and scripts.

User Home Path
Home directories are located in a Network File Service (NFS) that is accessible from all OLCF resources as /ccs/home/$USER. The environment variable $HOME will always point to your current home directory. It is recommended, where possible, that you use this variable to reference your home directory. In cases in which using $HOME is not feasible, it is recommended that you use /ccs/home/$USER. Users should note that since this is an NFS-mounted filesystem, its performance will not be as high as other filesystems.
User Home Quotas
Quotas are enforced on user home directories. To request an increased quota, contact the OLCF User Assistance Center. To view your current quota and usage, use the quota command:
$ quota -Qs
Disk quotas for user usrid (uid 12345):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
nccsfiler1a.ccs.ornl.gov:/vol/home
                  4858M   5000M   5000M           29379   4295m   4295m
User Home Backups
If you accidentally delete files from your home directory, you may be able to retrieve them. Online backups are performed at regular intervals. Hourly backups for the past 24 hours, daily backups for the last 7 days, and 1 weekly backup are available. It is possible that the deleted files are available in one of those backups. The backup directories are named hourly.*, daily.* , and weekly.* where * is the date/time stamp of the backup. For example, hourly.2016-12-01-0905 is an hourly backup made on December 1, 2016 at 9:05 AM. The backups are accessed via the .snapshot subdirectory. Note that if you do an ls (even with the -a option) of any directory you won’t see a .snapshot subdirectory, but you’ll be able to do “ls .snapshot” nonetheless. This will show you the hourly/daily/weekly backups available. The .snapshot feature is available in any subdirectory of your home directory and will show the online backup of that subdirectory. In other words, you don’t have to start at /ccs/home/$USER and navigate the full directory structure; if you’re in a /ccs/home subdirectory several “levels” deep, an “ls .snapshot” will access the available backups of that subdirectory.
User Home Permissions
The default permissions for user home directories are 0750 (full access to the user, read and execute for the group). Users have the ability to change permissions on their home directories, although it is recommended that permissions be set to as restrictive as possible (without interfering with your work).
Special User Website Directory
User Home spaces may contain a directory named /www. If this directory exists, and if appropriate permissions exist, files in that directory will be accessible via the World Wide Web at http://users.nccs.gov/~user (where user is your userid).


5.1.2. User Archive Directories (HPSS)

(Back to Top)

Users are also provided with user-centric archival space on the High Performance Storage System (HPSS). User archive areas on HPSS are intended for storage of data not immediately needed in either User Home directories (NFS) or User Work directories (Lustre®). User Archive areas also serve as a location for users to store backup copies of user files. User Archive directories should not be used to store project-related data. Rather, Project Archive directories should be used for project data.

User Archive Path
User archive directories are located at /home/$USER.
User Archive Access
User archive directories may be accessed only via specialized tools called HSI and HTAR. For more information on using HSI or HTAR, see the HSI and HTAR page.
User Archive Accounting
Each file and directory on HPSS is associated with an HPSS storage allocation. For information on storage allocation, please visit the Understanding HPSS Storage Allocations page.


5.2. Project-Centric Data Storage

(Back to Top)

Projects are provided with several storage areas for the data they need. Project directories provide members of a project with a common place to store code, data files, documentation, and other files related to their project. While this information could be stored in one or more user directories, storing in a project directory provides a common location to gather all files. The following table summarizes project-centric storage areas available on OLCF resources and lists relevant policies.

Project-Centric Storage Areas
Area Path Type Permissions Quota Backups Purged Retention
Project Home /ccs/proj/[projid] NFS 770 50 GB Yes No 90 days
Member Work $MEMBERWORK/[projid] Lustre® 700 [1] 10 TB No 14 days 14 days
Project Work $PROJWORK/[projid] Lustre® 770 100 TB No 90 days 90 days
World Work $WORLDWORK/[projid] Lustre® 775 10 TB No 90 days 90 days
Project Archive /proj/[projid] HPSS 770 100 TB [2] No No 90 days
Important! Files within "Work" directories (i.e., Member Work, Project Work, World Work) are not backed up and are purged on a regular basis according to the timeframes listed above.

[1] Permissions on Member Work directories can be controlled to an extent by project members. By default, only the project member has any accesses, but accesses can be granted to other project members by setting group permissions accordingly on the Member Work directory. The parent directory of the Member Work directory prevents accesses by "UNIX-others" and cannot be changed (security measures).

[2] In addition, there is a quota/limit of 100,000 files on this directory.


5.2.1. Project Home Directories (NFS)

(Back to Top)

Projects are provided with a Project Home storage area in the Network File Service (NFS) mounted filesystem. This area is intended for storage of data, code, and other files that are of interest to all members of a project. Since Project Home is an NFS-mounted filesystem, its performance will not be as high as other filesystems.

Project Home Path
Project Home area is accessible at /ccs/proj/abc123 (where abc123 is your project ID).
Project Home Quotas
To check your project's current usage, run df -h /ccs/proj/abc123 (where abc123 is your project ID). Quotas are enforced on project home directories. The current limit is shown on the Storage Policy page. To request an increased quota, contact the User Assistance Center.
Project Home Backups
If you accidentally delete files from your project home directory, you may be able to retrieve them. Online backups are performed at regular intervals. Hourly backups for the past 24 hours, daily backups for the last 7 days, and 1 weekly backup are available. It is possible that the deleted files are available in one of those backups. The backup directories are named hourly.*, daily.* , and weekly.* where * is the date/time stamp of the backup. For example, hourly.2016-12-01-0905 is an hourly backup made on December 1, 2016 at 9:05 AM. The backups are accessed via the .snapshot subdirectory. Note that if you do an ls (even with the -a option) of any directory you won’t see a .snapshot subdirectory, but you’ll be able to do “ls .snapshot” nonetheless. This will show you the hourly/daily/weekly backups available. The .snapshot feature is available in any subdirectory of your project home directory and will show the online backup of that subdirectory. In other words, you don’t have to start at /ccs/proj/abc123 and navigate the full directory structure; if you’re in a /ccs/proj subdirectory several “levels” deep, an “ls .snapshot” will access the available backups of that subdirectory.
Project Home Permissions
The default permissions for project home directories are 0770 (full access to the user and group). The directory is owned by root and the group is the project's group. All members of a project should also be members of that group-specific project. For example, all members of project "ABC123" should be members of the "abc123" UNIX group.


5.2.2. Project-Centric Work Directories

(Back to Top)

To provide projects and project members with high-performance storage areas that are accessible to batch jobs, projects are given (3) distinct project-centric work (i.e., scratch) storage areas within Spider, the OLCF's center-wide Lustre® filesystem.

Three Project Work Areas to Facilitate Collaboration
To facilitate collaboration among researchers, the OLCF provides (3) distinct types of project-centric work storage areas: Member Work directories, Project Work directories, and World Work directories. Each directory should be used for storing files generated by computationally-intensive HPC jobs related to a project. The difference between the three lies in the accessibility of the data to project members and to researchers outside of the project. Member Work directories are accessible only by an individual project member by default. Project Work directories are accessible by all project members. World Work directories are readable by any user on the system.
Paths
Paths to the various project-centric work storage areas are simplified by the use of environment variables that point to the proper directory on a per-user basis:
  • Member Work Directory: $MEMBERWORK/[projid]
  • Project Work Directory: $PROJWORK/[projid]
  • World Work Directory: $WORLDWORK/[projid]
Environment variables provide operational staff (aka "us") flexibility in the exact implementation of underlying directory paths, and provide researchers (aka "you") with consistency over the long-term. For these reasons, we highly recommend the use of these environment variables for all scripted commands involving work directories.
Permissions
UNIX Permissions on each project-centric work storage area differ according to the area's intended collaborative use. Under this setup, the process of sharing data with other researchers amounts to simply ensuring that the data resides in the proper work directory.
  • Member Work Directory: 700
  • Project Work Directory: 770
  • World Work Directory: 775
For example, if you have data that must be restricted only to yourself, keep them in your Member Work directory for that project (and leave the default permissions unchanged). If you have data that you intend to share with researchers within your project, keep them in the project's Project Work directory. If you have data that you intend to share with researchers outside of a project, keep them in the project's World Work directory.
Quotas
Soft quotas are enforced on project-centric work directories. The current limit is shown on the Storage Policy page. To request an increased quota, contact the User Assistance Center.
Backups
Member Work, Project Work, and World Work directories are not backed up. Project members are responsible for backing up these files, either to Project Archive areas (HPSS) or to an off-site location.


5.2.3. Project Archive Directories (HPSS)

(Back to Top)

Projects are also allocated project-specific archival space on the High Performance Storage System (HPSS). The default quota is shown on the Storage Policy page. If a higher quota is needed, contact the User Assistance Center. The Project Archive space on HPSS is intended for storage of data not immediately needed in either Project Home (NFS) areas nor Project Work (Lustre®) areas, and to serve as a location to store backup copies of project-related files.

Project Archive Path

The project archive directories are located at /proj/pjt000 (where pjt000 is your Project ID).

Project Archive Access

Project Archive directories may only be accessed via utilities called HSI and HTAR. For more information on using HSI or HTAR, see the HSI and HTAR page.

Project Archive Accounting

Each file and directory on HPSS is associated with an HPSS storage allocation. For information on HPSS storage allocations, please visit the Understanding HPSS Storage Allocations page.


5.3. Enabling Workflows through Cross-System Batch Submission

(Back to Top)

The OLCF now supports submitting jobs between OLCF systems via batch scripts. This can be useful for automatically triggering analysis and storage of large data sets after a successful simulation job has ended, or for launching a simulation job automatically once the input deck has been retrieved from HPSS and pre-processed.

Cross-Submission allows jobs on one OLCF resource to submit new jobs to other OLCF resources.

Cross-Submission allows jobs on one OLCF resource to submit new jobs to other OLCF resources.

The key to remote job submission is the command qsub -q host script.pbs which will submit the file script.pbs to the batch queue on the specified host. This command can be inserted at the end of an existing batch script in order to automatically trigger work on another OLCF resource. This feature is supported on the following hosts:
Host Remote Submission Command
Rhea qsub -q rhea visualization.pbs
Eos qsub -q eos visualization.pbs
Titan qsub -q titan compute.pbs
Data Transfer Nodes (DTNs) qsub -q dtn retrieve_data.pbs
Example Workflow 1: Automatic Post-Processing
The simplest example of a remote submission workflow would be automatically triggering an analysis task on Rhea at the completion of a compute job on Titan. This workflow would require two batch scripts, one to be submitted on Titan, and a second to be submitted automatically to Rhea. Visually, this workflow may look something like the following:
Post-processing Workflow
The batch scripts for such a workflow could be implemented as follows: Batch-script-1.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Retrieve data from HPSS
cd $MEMBERWORK/prj123
htar -xf /proj/prj123/compute_data.htar compute_data/

# Submit compute job to Titan
qsub -q titan Batch-script-2.pbs
Batch-script-2.pbs
#PBS -l walltime=2:00:00
#PBS -l nodes=4096
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Launch exectuable
cd $MEMBERWORK/prj123
aprun -n 65536 ./analysis-task.exe

# Submit data archival job to DTNs
qsub -q dtn Batch-script-3.pbs
Batch-script-3.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Launch exectuable
cd $MEMBERWORK/prj123
htar -cf /proj/prj123/viz_output.htar viz_output/
htar -cf /proj/prj123/compute_data.htar compute_data/
The key to this workflow is the qsub -q batch@rhea-batch Batch-script-2.pbs command, which tells qsub to submit the file Batch-script-2.pbs to the batch queue on Rhea.
Initializing the Workflow
We can initialize this workflow in one of two ways:
  • Log into dtn.ccs.ornl.gov and run qsub Batch-script-1.pbs OR
  • From Titan or Rhea, run qsub -q dtn Batch-script-1.pbs
Example Workflow 2: Data Staging, Compute, and Archival
Now we give another example of a linear workflow. This example shows how to use the Data Transfer Nodes (DTNs) to retrieve data from HPSS and stage it to your project's scratch area before beginning. Once the computation is done, we will automatically archive the output.
Post-processing Workflow
Batch-script-1.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Retrieve Data from HPSS
cd $MEMBERWORK/prj123
htar -xf /proj/prj123/input_data.htar input_data/

# Launch compute job
qsub -q titan Batch-script-2.pbs
Batch-script-2.pbs
#PBS -l walltime=6:00:00
#PBS -l nodes=4096
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Launch exectuable
cd $MEMBERWORK/prj123
aprun -n 65536 ./analysis-task.exe

# Submit data archival job to DTNs
qsub -q dtn Batch-script-3.pbs
Batch-script-3.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Launch exectuable
cd $MEMBERWORK/prj123
htar -cf /proj/prj123/viz_output.htar viz_output/
htar -cf /proj/prj123/compute_data.htar compute_data/
Initializing the Workflow
We can initialize this workflow in one of two ways:
  • Log into dtn.ccs.ornl.gov and run qsub Batch-script-1.pbs OR
  • From Titan or Rhea, run qsub -q dtn Batch-script-1.pbs
Example Workflow 3: Data Staging, Compute, Visualization, and Archival
This is an example of a "branching" workflow. What we will do is first use Rhea to prepare a mesh for our simulation on Titan. We will then launch the compute task on Titan, and once this has completed, our workflow will branch into two separate paths: one to archive the simulation output data, and one to visualize it. After the visualizations have finished, we will transfer them to a remote institution.
Post-processing Workflow
Step-1.prepare-data.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=10
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Prepare Mesh for Simulation
mpirun -n 160 ./prepare-mesh.exe

# Launch compute job
qsub -q titan Step-2.compute.pbs
Step-2.compute.pbs
#PBS -l walltime=6:00:00
#PBS -l nodes=4096
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Launch exectuable
cd $MEMBERWORK/prj123
aprun -n 65536 ./analysis-task.exe

# Workflow branches at this stage, launching 2 separate jobs

# - Launch Archival task on DTNs
qsub -q dtn@dtn-batch Step-3.archive-compute-data.pbs

# - Launch Visualization task on Rhea
qsub -q rhea Step-4.visualize-compute-data.pbs
Step-3.archive-compute-data.pbs
#PBS -l walltime=0:30:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Archive compute data in HPSS
cd $MEMBERWORK/prj123
htar -cf /proj/prj123/compute_data.htar compute_data/
Step-4.visualize-compute-data.pbs
#PBS -l walltime=2:00:00
#PBS -l nodes=64
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Visualize Compute data
cd $MEMBERWORK/prj123
mpirun -n 768 ./visualization-task.py

# Launch transfer task
qsub -q dtn Step-5.transfer-visualizations-to-campus.pbs
Step-5.transfer-visualizations-to-campus.pbs
#PBS -l walltime=2:00:00
#PBS -l nodes=1
#PBS -A PRJ123
#PBS -l gres=atlas1%atlas2

# Transfer visualizations to storage area at home institution
cd $MEMBERWORK/prj123
SOURCE=gsiftp://dtn03.ccs.ornl.gov/$MEMBERWORK/visualization.mpg
DEST=gsiftp://dtn.university-name.edu/userid/visualization.mpg
globus-url-copy -tcp-bs 12M -bs 12M -p 4 $SOURCE $DEST
Initializing the Workflow
We can initialize this workflow in one of two ways:
  • Log into rhea.ccs.ornl.gov and run qsub Step-1.prepare-data.pbs OR
  • From Titan or the DTNs, run qsub -q rhea Step-1.prepare-data.pbs
Checking Job Status
Host Remote qstat Remote showq
Rhea qstat -a @rhea-batch showq --host=rhea-batch
Eos qstat -a @eos-batch showq --host=eos-batch
Titan qstat -a @titan-batch showq --host=titan-batch
Data Transfer Nodes (DTNs) qstat -a @dtn-batch showq --host=dtn-batch
Deleting Remote Jobs
In order to delete a job (say, job number 18688) from a remote queue, you can do the following
Host Remote qdel
Rhea qdel 18688@rhea-batch
Eos qdel 18688@eos-batch
Titan qdel 18688@titan-batch
Data Transfer Nodes (DTNs) qdel 18688@dtn-batch
Potential Pitfalls
The OLCF advises users to keep their remote submission workflows simple, short, and mostly linear. Workflows that contain many layers of branches, or that trigger many jobs at once, may prove difficult to maintain and debug. Workflows that contain loops or recursion (jobs that can submit themselves again) may inadvertently waste allocation hours if a suitable exit condition is not reached.
Recursive workflows which do not exit will drain your project's allocation. Refunds will not be granted. Please be extremely cautious when designing workflows that cause jobs to re-submit themselves.
Circular Workflow
As always, users on multiple projects are strongly advised to double check that the #PBS -A <PROJECTID> field is set to the correct project prior to submission. This will ensure that resource usage is associated with the intended project.


5.4. Data Management Policy Summary

(Back to Top)

Users must agree to the full Data Management Policy as part of their account application. The "Data Retention, Purge, & Quotas" section is useful and is summarized below.

Data Retention, Purge, & Quota Summary
User-Centric Storage Areas
Area Path Type Permissions Quota Backups Purged Retention
User Home $HOME NFS User-controlled 10 GB Yes No 90 days
User Archive /home/$USER HPSS User-controlled 2 TB [1] No No 90 days
Project-Centric Storage Areas
Area Path Type Permissions Quota Backups Purged Retention
Project Home /ccs/proj/[projid] NFS 770 50 GB Yes No 90 days
Member Work $MEMBERWORK/[projid] Lustre® 700 [2] 10 TB No 14 days 14 days
Project Work $PROJWORK/[projid] Lustre® 770 100 TB No 90 days 90 days
World Work $WORLDWORK/[projid] Lustre® 775 10 TB No 90 days 90 days
Project Archive /proj/[projid] HPSS 770 100 TB [3] No No 90 days
Area The general name of storage area.
Path The path (symlink) to the storage area's directory.
Type The underlying software technology supporting the storage area.
Permissions UNIX Permissions enforced on the storage area's top-level directory.
Quota The limits placed on total number of bytes and/or files in the storage area.
Backups States if the data is automatically duplicated for disaster recovery purposes.
Purged Period of time, post-file-creation, after which a file will be marked as eligible for permanent deletion.
Retention Period of time, post-account-deactivation or post-project-end, after which data will be marked as eligible for permanent deletion.
Important! Files within "Work" directories (i.e., Member Work, Project Work, World Work) are not backed up and are purged on a regular basis according to the timeframes listed above.

[1] In addition, there is a quota/limit of 2,000 files on this directory.

[2] Permissions on Member Work directories can be controlled to an extent by project members. By default, only the project member has any accesses, but accesses can be granted to other project members by setting group permissions accordingly on the Member Work directory. The parent directory of the Member Work directory prevents accesses by "UNIX-others" and cannot be changed (security measures).

[3] In addition, there is a quota/limit of 100,000 files on this directory.


6. Software and Shell Environments

(Back to Top)

The OLCF provides hundreds of pre-installed software packages and scientific libraries for your use, in addition to taking software requests. Due to the large number of software packages and versions on OLCF resources, environment management tools are needed to handle changes to your shell environment. This chapter discusses how to manage your shell and software environment on OLCF systems.


6.1. Default Shell

(Back to Top)

Users request their preferred shell on their initial user account request form. The default shell is enforced across all OLCF resources. The OLCF currently supports the following shells:

  • bash
  • tsch
  • csh
  • ksh
Please contact the OLCF User Assistance Center to request a different default shell.


6.2. Using Modules

(Back to Top)

The modules software package allows you to dynamically modify your user environment by using pre-written modulefiles.

Modules Overview
Each modulefile contains the information needed to configure the shell for an application. After the modules software package is initialized, the environment can be modified on a per-module basis using the module command, which interprets a modulefile. Typically, a modulefile instructs the module command to alter or set shell environment variables such as PATH or MANPATH. Modulefiles can be shared by many users on a system, and users can have their own personal collection to supplement and/or replace the shared modulefiles. As a user, you can add and remove modulefiles from your current shell environment. The environment changes performed by a modulefile can be viewed by using the module command as well. More information on modules can be found by running man module on OLCF systems.
Summary of Module Commands
Command Description
module list Lists modules currently loaded in a user’s environment
module avail Lists all available modules on a system in condensed format
module avail -l Lists all available modules on a system in long format
module display Shows environment changes that will be made by loading a given module
module load Loads a module
module unload Unloads a module
module help Shows help for a module
module swap Swaps a currently loaded module for an unloaded module
Re-initializing the Module Command
Modules software functionality is highly dependent upon the shell environment being used. Sometimes when switching between shells, modules must be re-initialized. For example, you might see an error such as the following:
$ module list
-bash: module: command not found
To fix this, just re-initialize your modules environment:
$ source $MODULESHOME/init/myshell
Where myshell is the name of the shell you are using and need to re-initialize.
Examples of Module Use
To show all available modules on a system:
$ module avail   
------------ /opt/cray/modulefiles ------------
atp/1.3.0                          netcdf/4.1.3                       tpsl/1.0.01
atp/1.4.0(default)                 netcdf-hdf5parallel/4.1.2(default) tpsl/1.1.01(default)
atp/1.4.1                          netcdf-hdf5parallel/4.1.3          trilinos/10.6.4.0(default)
...
To search for availability of a module by name:
$ module avail -l netcdf
- Package -----------------------------+- Versions -+- Last mod. ------
/opt/modulefiles:
netcdf/3.6.2                                         2009/09/29 16:38:25
/sw/xk6/modulefiles:
netcdf/3.6.2                                         2011/12/09 18:07:31
netcdf/4.1.3                              default    2011/12/12 20:43:37
...
To show the modulefiles currently in use (loaded) by the user:
$ module list
Currently Loaded Modulefiles:
  1) modules/3.2.6.6                           12) pmi/3.0.0-1.0000.8661.28.2807.gem
  2) xe-sysroot/4.0.30.securitypatch.20110928  13) ugni/2.3-1.0400.3912.4.29.gem
  3) xtpe-network-gemini                       14) udreg/2.3.1-1.0400.3911.5.6.gem
To show detailed help info on a modulefile:
$ module help netcdf/4.1.3 
------------ Module Specific Help for 'netcdf/4.1.3' ------------
Purpose:
  New version of hdf5 1.8.7 and netcdf 4.1.3
Product and OS Dependencies:
  hdf5_netcdf 2.1 requires SLES 11 systems and was tested on Cray XE and
...
To show what a modulefile will do to the shell environment if loaded:
$ module display netcdf/4.1.3
------------
/opt/cray/modulefiles/netcdf/4.1.3:
setenv           CRAY_NETCDF_VERSION 4.1.3 
prepend-path     PATH /opt/cray/netcdf/4.1.3/gnu/45/bin 
...
To load or unload a modulefile
$ module load netcdf/4.1.3
$ module unload netcdf/4.1.3
To unload a modulefile and load a different one:
$ module swap netcdf/4.1.3 netcdf/4.1.2 


6.3. Installed Software

(Back to Top)

The OLCF provides hundreds of pre-installed software packages and scientific libraries for your use, in addition to taking software installation requests. See the software section for complete details on existing installs. To request a new software install, use the software installation request form.


7. Compiling on EOS

(Back to Top)

Compiling code on Eos is very similar to compiling on other OLCF resources.

Available Compilers
The following compilers are available on Eos:
  • Intel, Intel Composer XE (default)
  • PGI, the Portland Group Compiler Suite
  • GCC, the GNU Compiler Collection
  • CCE, the Cray Compiling Environment


7.1. Controlling the Programming Environment on Eos

(Back to Top)

Upon login, the default versions of the Intel compiler and associated Message Passing Interface (MPI) libraries are added to each user's environment through a programming environment module. Users do not need to make any environment changes to use the default version of Intel  and MPI.

Changing Compilers
If a different compiler is required, it is important to use the correct environment for each compiler. To aid users in pairing the correct compiler and environment, programming environment modules are provided. The programming environment modules will load the correct pairing of compiler version, message passing libraries, and other items required to build and run. We highly recommend that the programming environment modules be used when changing compiler vendors. The following programming environment modules are available on Eos:
  • PrgEnv-intel
  • PrgEnv-pgi
  • PrgEnv-gnu
  • PrgEnv-cray
To change the default loaded Intel environment to the default GCC environment use:
$ module unload PrgEnv-intel 
$ module load PrgEnv-gnu
Or alternatively:
$ module swap PrgEnv-intel PrgEnv-gnu
Changing Versions of the Same Compiler
To use a specific compiler version, you must first ensure the compiler's PrgEnv module is loaded, and then swap to the correct compiler version. For example, the following will configure the environment to use the GCC compilers, then load a non-default GCC compiler version:
$ module swap PrgEnv-intel PrgEnv-gnu
$ module swap gcc gcc/4.6.1
General Programming Environment Guidelines
We recommend the following general guidelines for using the programming environment modules:
  • Do not purge all modules; rather, use the default module environment provided at the time of login, and modify it.
  • Do not swap or unload any of the Cray provided modules (those with names like xt-*, xe-*, xk-*, or cray-*).
  • Do not swap moab, torque, or MySQL modules after loading a programming environment modulefile.

7.2. Compiling Threaded Codes on Eos

(Back to Top)

When building threaded codes on Cray machines, you may need to take additional steps to ensure a proper build.

OpenMP
For Intel, use the -openmp option:
$ cc -openmp test.c -o test.x
$ setenv OMP_NUM_THREADS 2
$ aprun -n2 -d2 ./test.x
For PGI, add -mp to the build line:
$ module swap PrgEnv-intel PrgEnv-pgi
$ cc -mp test.c -o test.x
$ setenv OMP_NUM_THREADS 2
$ aprun -n2 -d2 ./test.x
For GNU, add -fopenmp to the build line:
$ module swap PrgEnv-intel PrgEnv-gnu
$ cc -fopenmp test.c -o test.x
$ setenv OMP_NUM_THREADS 2
$ aprun -n2 -d2 ./test.x
For Cray, no additional flags are required:
$ module swap PrgEnv-intel PrgEnv-cray
$ cc test.c -o test.x
$ setenv OMP_NUM_THREADS 2
$ aprun -n2 -d2 ./test.x
Running with OpenMP and PrgEnv-intel
An extra thread created by the Intel OpenMP runtime interacts with the CLE thread binding mechanism and causes poor performance. To work around this issue, CPU-binding should be turned off. This is only an issue for OpenMP with the Intel programming environment. How CPU-binding is shut off depends on how the job is placed on the node. In the following examples, we refer to the number of threads per MPI task as depth; this is controlled by the -d option to aprun. We refer to the number of MPI task or processing elements per socket as npes; this is controlled by the -n option to aprun. In the following examples replace depth with the value for number of threads per MPI task, and npes with the value for the number of MPI tasks (processing elements) per socket that you plan to use.  For the case of running when depth divides evenly into the number of processing elements on a socket (npes),
export OMP_NUM_THREADS="<=depth" 
aprun -n npes -d "depth" -cc numa_node a.out
For the case of running when depth does not divide evenly into the number of processing elements on a socket (npes),
export OMP_NUM_THREADS="<=depth" 
aprun -n npes -d “depth” -cc none a.out
In the future, a new feature should provide an aprun option to interface more smoothly with OpenMP codes using the Intel programing environment. This documentation will be updated at that time.

8. Running Jobs on Eos

(Back to Top)

In High Performance Computing (HPC), computational work is performed by jobs. Individual jobs produce data that lend relevant insight into grand challenges in science and engineering. As such, the timely, efficient execution of jobs is the primary concern in the operation of any HPC system. A job on Eos typically comprises a few different components:

  • A batch submission script.
  • A binary executable.
  • A set of input files for the executable.
  • A set of output files created by the executable.
And the process for running a job, in general, is to:
  1. Prepare executables and input files.
  2. Write a batch script.
  3. Submit the batch script to the batch scheduler.
  4. Optionally monitor the job before and during execution.
The following sections describe in detail how to create, submit, and manage jobs for execution on Eos.


8.1. Login vs. Compute Nodes

(Back to Top)

Cray Supercomputers are complex collections of different types of physical nodes/machines. For simplicity, we can think of Eos nodes as existing in two categories: login nodes or compute nodes.

Login Nodes
Login nodes are designed to facilitate ssh access into the overall system, and to handle simple tasks. When you first log in, you are placed on a login node. Login nodes are shared by all users of a system, and should only be used for basic tasks such as file editing, code compilation, data backup, and job submission. Login nodes should not be used for memory-intensive nor processing-intensive tasks. Users should also limit the number of simultaneous tasks performed on login nodes. For example, a user should not run ten simultaneous tar processes.
Warning: Processor-intensive, memory-intensive, or otherwise disruptive processes running on login nodes may be killed without warning.
Compute Nodes
On Cray machines, when the aprun command is issued within a job script (or on the command line within an interactive batch job), the binary passed to aprun is copied to and executed in parallel on a set of compute nodes. Compute nodes run a Linux microkernel for reduced overhead and improved performance.
Note: On Cray machines, the only way to access the compute nodes is via the aprun command.


8.2. Filesystems Available to Compute Nodes on EOS

(Back to Top)

The Eos compute nodes can only see the center-wide Lustre filesystems (Atlas) which includes the $MEMBERWORK, $PROJWORK, and $WORLDWORK storage areas. Other storage spaces (User Home, User Archive, Project Home, and Project Archive) are not mounted on compute nodes.

Warning: Only $MEMBERWORK, $PROJWORK, and $WORLDWORK areas are available to compute nodes on Eos.

As a result, job executable binaries and job input files must reside within a Lustre-backed work directory, e.g. $MEMBERWORK/[projid]. Job output must also be sent to a Lustre-backed work directory.

Batch jobs can be submitted from User Home or Project Home, but additional steps are required to ensure the job runs successfully. Jobs submitted from Home areas should cd into a Lustre-backed work directory prior to invoking aprun. An error like the following may be returned if this is not done:

aprun: [NID 94]Exec /lustre/atlas/scratch/userid/projid/a.out failed: chdir /autofs/na1_home/userid
No such file or directory


8.3. Writing Batch Scripts for Eos

(Back to Top)

Batch scripts, or job submission scripts, are the mechanism by which a user submits and configures a job for eventual execution. A batch script is simply a shell script which contains:

  • Commands that can be interpreted by batch scheduling software (e.g. PBS)
  • Commands that can be interpreted by a shell
The batch script is submitted to the batch scheduler where it is parsed. Based on the parsed data, the batch scheduler places the script in the scheduler queue as a batch job. Once the batch job makes its way through the queue, the script will be executed on a service node within the set of allocated computational resources.
Sections of a Batch Script
Batch scripts are parsed into the following three sections:
  1. The Interpreter LineThe first line of a script can be used to specify the script’s interpreter. This line is optional. If not used, the submitter's default shell will be used. The line uses the "hash-bang-shell" syntax: #!/path/to/shell
  2. The Scheduler Options SectionThe batch scheduler options are preceded by #PBS, making them appear as comments to a shell. PBS will look for #PBS options in a batch script from the script’s first line through the first non-comment line. A comment line begins with #. #PBS options entered after the first non-comment line will not be read by PBS.
    Note: All batch scheduler options must appear at the beginning of the batch script.
  3. The Executable Commands SectionThe shell commands follow the last #PBS option and represent the main content of the batch job. If any #PBS lines follow executable statements, they will be ignored as comments.
The execution section of a script will be interpreted by a shell and can contain multiple lines of executable invocations, shell commands, and comments. When the job's queue wait time is finished, commands within this section will be executed on a service node (sometimes called a "head node") from the set of the job's allocated resources. Under normal circumstances, the batch job will exit the queue after the last line of the script is executed.
An Example Batch Script
 1: #!/bin/bash
 2: #    Begin PBS directives
 3: #PBS -A pjt000
 4: #PBS -N test
 5: #PBS -j oe
 6: #PBS -l walltime=1:00:00,nodes=373
 7: #    End PBS directives and begin shell commands
 8: cd $MEMBERWORK/pjt000
 9: date
10: aprun -n 5968 ./a.out
The lines of this batch script do the following:
Line Option Description
1 Optional Specifies that the script should be interpreted by the bash shell.
2 Optional Comments do nothing.
3 Required The job will be charged to the "pjt000" project.
4 Optional The job will be named "test".
5 Optional The job’s standard output and error will be combined.
6 Required The job will request 373 compute nodes for 1 hour.
7 Optional Comments do nothing.
8 -- This shell command will the change to the user's member work directory.
9 -- This shell command will run the date command.
10 -- This invocation will run 5968 MPI instances of the executable a.out on the compute nodes allocated by the batch system.
Note: For more batch script examples, please see the Batch Script Examples page.
Additional Example Batch Scripts
For more batch script examples, please see the Batch Script Examples page.
Batch Scheduler node Requests
A node’s cores cannot be allocated to multiple jobs. Because the OLCF charges based upon the computational resources a job makes unavailable to others, a job is charged for an entire node even if the job uses only one processor core. To simplify the process, users are required to request an entire node through PBS.
Note: Whole nodes must be requested at the time of job submission, and allocations are reduced by core-hour amounts corresponding to whole nodes, regardless of actual core utilization.


8.4. Submitting Batch Scripts

(Back to Top)

Once written, a batch script is submitted to the batch scheduler via the qsub command.

$ cd /path/to/batch/script
$ qsub ./script.pbs
If successfully submitted, a PBS job ID will be returned. This ID is needed to monitor the job's status with various job monitoring utilities. It is also necessary information when troubleshooting a failed job, or when asking the OLCF User Assistance Center for help.
Note: Always make a note of the returned job ID upon job submission, and include it in help requests to the OLCF User Assistance Center.
Options to the qsub command allow the specification of attributes which affect the behavior of the job. In general, options to qsub on the command line can also be placed in the batch scheduler options section of the batch script via #PBS. For more information on submitting batch jobs, see the Batch Script Examples page.


8.5. Interactive Batch Jobs

(Back to Top)

Batch scripts are useful for submitting a group of commands, allowing them to run through the queue, then viewing the results at a later time. However, it is sometimes necessary to run tasks within a job interactively. Users are not permitted to access compute nodes nor run aprun directly from login nodes. Instead, users must use an interactive batch job to allocate and gain access to compute resources interactively. This is done by using the -I option to qsub.

Interactive Batch Example
For interactive batch jobs, PBS options are passed through qsub on the command line.
$ qsub -I -A pjt000 -q debug -X -l nodes=3,walltime=30:00
This request will:
-I Start an interactive session
-A Charge to the "pjt000" project
-X Enables X11 forwarding. The DISPLAY environment variable must be set.
-q debug Run in the debug queue
-l nodes=3,walltime=30:00 Request 3 compute nodes for 30 minutes (you get all cores per node)
After running this command, you will have to wait until enough compute nodes are available, just as in any other batch job. However, once the job starts, you will be given an interactive prompt on the head node of your allocated resource. From here commands may be executed directly instead of through a batch script.
Debugging via Interactive Jobs
A common use of interactive batch is to aid in debugging efforts. Interactive access to compute resources allows the ability to run a process to the point of failure; however, unlike a batch job, the process can be restarted after brief changes are made without loosing the compute resource allocation. This may help speed the debugging effort because a user does not have to wait in the queue in between each run attempts.
Note: To tunnel a GUI from an interactive batch job, the -X PBS option should be used to enable X11 forwarding.
Choosing an Interactive Job's nodes Value
Because interactive jobs must sit in the queue until enough resources become available to allocate, to shorten the queue wait time, it is useful to base nodes selection on the number of unallocated nodes. The showbf command (i.e "show backfill") to see resource limits that would allow your job to be immediately back-filled (and thus started) by the scheduler. For example, the snapshot below shows that 802 nodes are currently free.
$ showbf
Partition   Tasks   Nodes   StartOffset    Duration       StartDate
---------   -----   -----   ------------   ------------   --------------
ALL         4744    802     INFINITY       00:00:00       HH:MM:SS_MM/DD
See showbf –help for additional options.


8.6. Common Batch Options to PBS

(Back to Top)

The following table summarizes frequently-used options to PBS:

Option Use Description
-A #PBS -A <account> Causes the job time to be charged to <account>. The account string, e.g. pjt000, is typically composed of three letters followed by three digits and optionally followed by a subproject identifier. The utility showproj can be used to list your valid assigned project ID(s). This option is required by all jobs.
-l #PBS -l nodes=<value> Maximum number of compute nodes. Jobs cannot request partial nodes.
#PBS -l walltime=<time> Maximum wall-clock time. <time> is in the format HH:MM:SS.
#PBS -l partition=<partition_name> Allocates resources on specified partition.
-o #PBS -o <filename> Writes standard output to <name> instead of <job script>.o$PBS_JOBID. $PBS_JOBID is an environment variable created by PBS that contains the PBS job identifier.
-e #PBS -e <filename> Writes standard error to <name> instead of <job script>.e$PBS_JOBID.
-j #PBS -j {oe,eo} Combines standard output and standard error into the standard error file (eo) or the standard out file (oe).
-m #PBS -m a Sends email to the submitter when the job aborts.
#PBS -m b Sends email to the submitter when the job begins.
#PBS -m e Sends email to the submitter when the job ends.
-M #PBS -M <address> Specifies email address to use for -m options.
-N #PBS -N <name> Sets the job name to <name> instead of the name of the job script.
-S #PBS -S <shell> Sets the shell to interpret the job script.
-q #PBS -q <queue> Directs the job to the specified queue.This option is not required to run in the default queue on any given system.
-V #PBS -V Exports all environment variables from the submitting shell into the batch job shell. Not Recommended Because the login nodes differ from the service nodes, using the '-V' option is not recommended. Users should create the needed environment within the batch job.
-X #PBS -X Enables X11 forwarding. The -X PBS option should be used to tunnel a GUI from an interactive batch job.
Note: Because the login nodes differ from the service nodes, using the '-V' option is not recommended. Users should create the needed environment within the batch job.
Further details and other PBS options may be found through the qsub man page.


8.7. Batch Environment Variables

(Back to Top)

PBS sets multiple environment variables at submission time. The following PBS variables are useful within batch scripts:

Variable Description
$PBS_O_WORKDIR The directory from which the batch job was submitted. By default, a new job starts in your home directory. You can get back to the directory of job submission with cd $PBS_O_WORKDIR. Note that this is not necessarily the same directory in which the batch script resides.
$PBS_JOBID The job’s full identifier. A common use for PBS_JOBID is to append the job’s ID to the standard output and error files.
$PBS_NUM_NODES The number of nodes requested.
$PBS_JOBNAME The job name supplied by the user.
$PBS_NODEFILE The name of the file containing the list of nodes assigned to the job. Used sometimes on non-Cray clusters.


8.8. Modifying Batch Jobs

(Back to Top)

The batch scheduler provides a number of utility commands for managing submitted jobs. See each utilities' man page for more information.

Removing and Holding Jobs
qdel
Jobs in the queue in any state can be stopped and removed from the queue using the command qdel.
$ qdel 1234
qhold
Jobs in the queue in a non-running state may be placed on hold using the qhold command. Jobs placed on hold will not be removed from the queue, but they will not be eligible for execution.
$ qhold 1234
qrls
Once on hold the job will not be eligible to run until it is released to return to a queued state. The qrls command can be used to remove a job from the held state.
$ qrls 1234
Modifying Job Attributes
qalter
Non-running jobs in the queue can be modified with the PBS qalter command. The qalter utility can be used to do the following (among others): Modify the job’s name:
$ qalter -N newname 130494
Modify the number of requested cores:
$ qalter -l nodes=12 130494
Modify the job’s walltime:
$ qalter -l walltime=01:00:00 130494
Note: Once a batch job moves into a running state, the job's walltime can not be increased.


8.9. Monitoring Batch Jobs

(Back to Top)

PBS and Moab provide multiple tools to view queue, system, and job status. Below are the most common and useful of these tools.

Job Monitoring Commands
showq
The Moab utility showq can be used to view a more detailed description of the queue. The utility will display the queue in the following states:
Active These jobs are currently running.
Eligible These jobs are currently queued awaiting resources. Eligible jobs are shown in the order in which the scheduler will consider them for allocation.
Blocked These jobs are currently queued but are not eligible to run. A job may be in this state because the user has more jobs that are "eligible to run" than the system's queue policy allows.
To see all jobs currently in the queue:
$ showq
To see all jobs owned by userA currently in the queue:
$ showq -u userA
To see all jobs submitted to partitionA:
$ showq -p partitionA
To see all completed jobs:
$ showq -c
Note: To increase response time, the MOAB utilities (showstart, checkjob) will display a cached result. The cache updates every 30 seconds. But, because the cached result is displayed, you may see the following message:
--------------------------------------------------------------------
NOTE: The following information has been cached by the remote server
      and may be slightly out of date.
--------------------------------------------------------------------
checkjob
The Moab utility checkjob can be used to view details of a job in the queue. For example, if job 736 is a job currently in the queue in a blocked state, the following can be used to view why the job is in a blocked state:
$ checkjob 736
The return may contain a line similar to the following:
BlockMsg: job 736 violates idle HARD MAXJOB limit of X for user (Req: 1 InUse: X)
This line indicates the job is in the blocked state because the owning user has reached the limit for jobs in the "eligible to run" state.
qstat
The PBS utility qstat will poll PBS (Torque) for job information. However, qstat does not know of Moab's blocked and eligible states. Because of this, the showq Moab utility (see above) will provide a more accurate batch queue state. To show show all queued jobs:
$ qstat -a
To show details about job 1234:
$ qstat -f 1234
To show all currently queued jobs owned by userA:
$ qstat -u userA


8.10. Eos Scheduling Policy

(Back to Top)

Queue Policy
Queues are used by the batch scheduler to aid in the organization of jobs. Users typically have access to multiple queues, and each queue may allow different job limits and have different priorities. Unless otherwise notified, users have access to the following queues on Eos:
Name Usage Description
batch No explicit request required Default; most Eos work runs in this queue. 700 nodes available. See limits in the batch Queue section table below.
debug #PBS -q debug Quick-turnaround; short jobs for software generation, verification, and debugging. 36 nodes available. Users are limited to 1 job in any state for this queue.
The batch Queue
The batch queue is the default queue for work on Eos and has 700 nodes available. Most work on Eos is handled through this queue. The job time-limit is based based on job size as follows:
Size in Nodes Wall Clock Limit
1 to 175 nodes 24 hours
176 to 350 12 hours
351 to 700 4 hours
The batch queue enforces the following policies:
  • Unlimited running jobs
  • Limit of (2) eligible-to-run jobs per user.
  • Jobs in excess of the per user limit above will be placed into a held state, but will change to eligible-to-run at the appropriate time.
The debug Queue
The debug queue is intended to provide faster turnaround times for the code verification and debugging cycle. For example, interactive parallel work is an ideal use for the debug queue. 36 nodes are set aside for only debug use; although, a debug job can request more nodes and use nodes in the compute partition. The debug queue has a walltime of 2 hours and a limit of 1 job per user in any state.
Queue Priority
INCITE, ALCC, NOAA and Director's Discretionary projects enter the queue system with equal priory by default on Eos. The basic priority-setting mechanism for jobs waiting in the queue is the time a job has been waiting relative to other jobs in the queue. However, several factors are applied by the batch system to modify the apparent time a job has been waiting. These factors include:
      • The number of nodes requested by the job.
      • The queue to which the job is submitted.
      • The 8-week history of usage for the project associated with the job.
      • The 8-week history of usage for the user associated with the job.
If your jobs require resources outside these queue policies, please complete the relevant request form on the Special Requests page. If you have any questions or comments on the queue policies below, please direct them to the User Assistance Center.
Allocation Overuse Policy
Projects that overrun their allocation are still allowed to run on OLCF systems, although at a reduced priority. This is an adjustment to the apparent submit time of the job. However, this adjustment has the effect of making jobs appear much younger than jobs submitted under projects that have not exceeded their allocation. In addition to the priority change, these jobs are also limited in the amount of wall time that can be used. For example, consider that job1 is submitted at the same time as job2. The project associated with job1 is over its allocation, while the project for job2 is not. The batch system will consider job2 to have been waiting for a longer time than job1. The adjustment to the apparent submit time depends upon the percentage that the project is over its allocation, as shown in the table below:
% Of Allocation Used Priority Reduction
< 100% 0 days
100% to 125% 30 days
> 125% 365 days
Impact of Overuse on Separately Allocated Resources
Running in excess of the allocated time on one resource will not impact the priority on separately allocated resources. Eos allocations are given separately from Titan allocations; Overuse of a project's allocation on Titan will not impact that project's priority on Eos if there is time remaining in the project's Eos allocation.
FairShare Scheduling Policy
FairShare, as its name suggests, tries to push each user and project towards their fair share of the system's utilization: in this case, 5% of the system's utilization per user and 10% of the system's utilization per project. To do this, the job scheduler adds (30) minutes priority aging per user and (1) hour of priority aging per project for every (1) percent the user or project is under its fair share value for the prior (8) weeks. Similarly, the job scheduler subtracts priority in the same way for users or projects that are over their fair share. For instance, a user who has personally used 0.0% of the system's utilization over the past (8) weeks who is on a project that has also used 0.0% of the system's utilization will get a (12.5) hour bonus (5 * 30 min for the user + 10 * 1 hour for the project). In contrast, a user who has personally used 0.0% of the system's utilization on a project that has used 12.5% of the system's utilization would get no bonus (5 * 30 min for the user - 2.5 * 1 hour for the project).

8.11. Eos Job Resource Accounting

(Back to Top)

Charging Factor

To match the charge factor for Titan, the usage factor for Eos will be set at 30 times nodes requested. The actual number of cores per nodes is 16 without Intel Hyper Threading (default) or 32 with Intel Hyper Threading enabled (-j2 aprun option). If you use showq to check your job's allocation, it will show the number of cores requested in multiples of 32 regardless of  the chosen Hyper Threading options or utilized number of cores. This is because the scheduler must be set to allocate the potential maximum number of cores per node to enable all the possible ways of utilizing the node. This does not effect the aprun options you have chosen and will not change the 30 times per node usage factor. 

Note: Whole nodes must be requested at the time of job submission regardless of actual CPU or GPU core utilization.
Viewing Allocation Utilization

Projects are allocated time on Eos in units of "Eos core-hours". Other OLCF systems are allocated in units of "core-hours". This page describes how such units are calculated, and how users can access more detailed information on their relevant allocations.

Eos Core-Hour Calculation

The Eos core-hour charge for each batch job will be calculated as follows:

Eos core-hours = nodes requested * 30 * ( batch job endtime - batch job starttime )
Where batch job starttime is the time the job moves into a running state, and batch job endtime is the time the job exits a running state.

A batch job's usage is calculated solely on requested nodes and the batch job's start and end time. The number of cores actually used within any particular node within the batch job is not used in the calculation. For example, if a job requests 64 nodes through the batch script, runs for an hour, uses only 2 CPU cores per node, the job will still be charged for 64 * 30 * 1 = 1,920 Eos core-hours.

Viewing Usage

Utilization is calculated daily using batch jobs which complete between 00:00 and 23:59 of the previous day. For example, if a job moves into a run state on Tuesday and completes Wednesday, the job's utilization will be recorded Thursday. Only batch jobs which write an end record are used to calculate utilization. Batch jobs which do not write end records due to system failure or other reasons are not used when calculating utilization.

Each user may view usage for projects on which they are members from the command line tool showusage and the My OLCF site.

On the Command Line via showusage
The showusage utility can be used to view your usage from January 01 through midnight of the previous day. For example:
$ showusage
Usage on Eos:
                                  Project Totals          <userid>
 Project      Allocation        Usage    Remaining          Usage
_________________________|___________________________|_____________
 <YourProj>    2000000   |   123456.78   1876543.22  |     1560.80
The -h option will list more usage details.
On the Web via My OLCF
More detailed metrics may be found on each project's usage section of the My OLCF site. The following information is available for each project:
  • YTD usage by system, subproject, and project member
  • Monthly usage by system, subproject, and project member
  • YTD usage by job size groupings for each system, subproject, and project member
  • Weekly usage by job size groupings for each system, and subproject
  • Batch system priorities by project and subproject
  • Project members

The My OLCF site is provided to aid in the utilization and management of OLCF allocations. If you have any questions or have a request for additional data, please contact the OLCF User Assistance Center.

8.12. Job Execution on Eos

(Back to Top)

Running jobs on Eos is similar Titan, except for some important differences:

  • The compute nodes have 16 physical cores and no GPUs are present.
  • Intel's Hyper-threading (HT) technology, allows each physical core to appear as two logical cores so each node can functions as if it has 32 cores.
  • The default option on Eos is to run with Hyper Threading. You need to use the -j1 option with the aprun command to explicitly disable HT.
  • Each code should be tested to see how HT impacts its performance before HT is used.
Once resources have been allocated through the batch system, users can:
  • Run commands in serial on the resource pool's primary service node
  • Run executables in parallel across compute nodes in the resource pool
Serial Execution

The executable portion of a batch script is interpreted by the shell specified on the first line of the script. If a shell is not specified, the submitting user’s default shell will be used. This portion of the script may contain comments, shell commands, executable scripts, and compiled executables. These can be used in combination to, for example, navigate file systems, set up job execution, run executables, and even submit other batch jobs.

Parallel Execution

By default, commands in the job submission script will be executed on the job’s primary service node. The aprun command is used to execute a binary on one or more compute nodes within a job's allocated resource pool.

Note: On Eos, the only way access a compute node is via the aprun command within a batch job.


8.12.1. Using the aprun command

(Back to Top)

The aprun command is used to run a compiled application program across one or more compute nodes. You use the aprun command to specify application resource requirements, request application placement, and initiate application launch. The machine's physical node layout plays an important role in how aprun works. Each Titan compute node contains (2) 8-core NUMA nodes on a single socket (a total of 16 cores).

Note: The aprun command is the only mechanism for running an executable in parallel on compute nodes. To run jobs as efficiently as possible, a thorough understanding of how to use aprun and its various options is paramount.
OLCF uses a version of aprun with two extensions. One is used to identify which libraries are used by an executable to allow us to better track third party software that is being actively used on the system. The other analyzes the command line to identify cases where users might be able to optimize their application's performance by using slightly different job layout options. We highly recommend using both of these features; however, if there is a reason you wish to disable one or the other please contact the User Assistance Center for information on how to do that.
Shell Resource Limits
By default, aprun will not forward shell limits set by ulimit for sh/ksh/bash or by limit for csh/tcsh. To pass these settings to your batch job, you should set the environment variable APRUN_XFER_LIMITS to 1 via export APRUN_XFER_LIMITS=1 for sh/ksh/bash or setenv APRUN_XFER_LIMITS 1 for csh/tcsh.
Simultaneous aprun Limit
All aprun processes are launched from a small number of shared service nodes. Because large numbers of aprun processes can cause other users' apruns to fail, users are asked to limit the number of simultaneous apruns executed within a batch script. Users are limited to 50 aprun processes per batch job; attempts to launch apruns over the limit will result in the following error:
apsched: no more claims allowed for this reservation (max 50)
Warning: Users are limited to 50 aprun processes per batch job.
Single-aprun Process Ensembles with wraprun
In some situations, the simultaneous aprun limit can be overcome by using the utility wraprun. Wraprun has the capacity to run an arbitrary number and combination of qualified MPI or serial applications under a single aprun call.
Note: MPI executables launched under wraprun must dynamically linked. Non-MPI applications must be launched using a serial wrapper included with wraprun.
Warning: Tasks bundled with wraprun should each consume approximately the same walltime to avoid wasting allocation hours.
Complete information and examples on using wraprun can be found the wraprun documentation.
Common aprun Options
The following table lists commonly-used options to aprun. For a more detailed description of aprun options, see the aprun man page.
Option Description
-D Debug; shows the layout aprun will use
-n Number of total MPI tasks (aka 'processing elements') for the executable. If you do not specify the number of tasks to aprun, the system will default to 1.
-N Number of MPI tasks (aka 'processing elements') per physical node.
Warning: Because each node contains multiple processors/NUMA nodes, the -S option is likely a better option than -N to control layout within a node.
-m Memory required per MPI task. There is a maximum of 2GB per core, i.e. requesting 2.1GB will allocate two cores minimum per MPI task
-d Number of threads per MPI task.
Warning: The default value for -d is 1. If you specify OMP_NUM_THREADS but do not give a -d option, aprun will allocate your threads to a single core. Use OMP_NUM_THREADS to specify to your code the number of threads per MPI task; use -d to tell aprun how to place those threads.
-j
For Titan: Number of CPUs to use per paired-core compute unit. The -j parameter specifies the number of CPUs to be allocated per paired-core compute unit. The valid values for -j are 0 (use the system default), 1 (use one integer core), and 2 (use both integer cores; this is the system default).
For Eos: The -j parameter controls Hyper Threading. The valid values for -j are 0 (use the system default), 1 (turn Hyper Threading off), and 2 (turn Hyper Threading on; this is the system default).
-cc This is the cpu_list option. It binds MPI tasks or threads to the specified CPUs. The list is given as a set of comma-separated numbers (0 though 15) which each specify a compute unit (core) on the node. The list can also be given as hyphen-separated rages of numbers which each specify a range of compute units (cores) on the node. See man aprun.
-S Number of MPI tasks (aka 'processing elements') per NUMA node. Can be 1, 2, 3, 4, 5, 6, 7, or 8.
-ss Strict memory containment per NUMA node. The default is to allow remote NUMA node memory access. This option prevents memory access of the remote NUMA node.
-r Assign system services associated with your application to a compute core. If you use less than 16 cores, you can request all of the system services to be placed on an unused core. This will reduce "jitter" (i.e. application variability) because the daemons will not cause the application to context switch unexpectedly. Should use -r 1 ensuring -N is less than 16 or -S is less than 8.


8.12.2. XC30 CPU Description

(Back to Top)

The compute blade architecture of the XC30 is similar to the CPU blades of Titan with a few important differences.

Each node has two sockets with 8 physical cores each. Each core has its own level 1 (L1) and level2 (L2) caches.  The eight cores on each socket share a 20 MB L3 cache and 32 GB of SDRAM connected by a 4 channel DDR3 pipeline. As shown in the diagram below, each unit of 8 cores with its associated memory and caches can be thought of as a Non-uniform memory access (NUMA) Domaine.

 Slide1

8.12.3. Hyper Threading

(Back to Top)

   

Hyper Threading Overview
Eos includes Intel processors with Intel's Hyper-Threading technology. With Hyper-Threading enabled, the operating system recognizes each physical core as two logical cores. Two independent processes or threads can run simultaneously on the same physical core, but because the two logical cores are sharing the same execution resources, the two streams may run at roughly half the speed of a single stream. If a process in a stream running on one of the logical cores stalls, the second stream on that core can use the stalled stream's execution resources and possibly recoup cycles that would have been idle if the streams has been run with only one per physical core. Hyper Threading on Eos is supported by each of the available compilers — Intel, PGI, Cray and GNU.
Note: Hyper-Threading is enabled on Eos by default. The -j1 option to aprun explicitly disables Hyper Threading on Eos.
Hyper Threading for MPI Applications
For MPI applications, Hyper Threading can be utilized in a few different ways. One way is by running on half the nodes that you would typically need to allocate without Hyper Threading. The example below shows the code to do so and the resulting task layout on a node.
Code Example 1: (32) MPI tasks, (1) task per "core", with Hyper Threading
# Request 1 node. #PBS -l nodes=1# Tell aprun to use hyper threading. # Implicitly using HT (default) aprun -n 32 ./a.out # Explicitly using HT aprun -n 32 -j2 ./a.out
Compute Node 0
NUMA 0 NUMA 1
C0 C1 C2 C3 C4 C5 C6 C7 C0 C1 C2 C3 C4 C5 C6 C7
0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23
C8 C9 C10 C11 C12 C13 C14 C15 C8 C9 C10 C11 C12 C13 C14 C15
8 9 10 11 12 13 14 15 24 25 26 27 28 29 30 31
[1] 'C[n]' indicates 'Core [n]' for the NUMA node.
In contrast, the same example without Hyper Threading is shown below along with the resulting task layout on a node.
Code Example 2: (32) MPI tasks without Hyper Threading
# Request 2 nodes. #PBS -l nodes=2# No aprun hyper threading. aprun -n 32 -j1 ./a.out
Compute Node 0
NUMA 0 NUMA 1
C0 C1 C2 C3 C4 C5 C6 C7 C0 C1 C2 C3 C4 C5 C6 C7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Compute Node 1
NUMA 0 NUMA 1
C0 C1 C2 C3 C4 C5 C6 C7 C0 C1 C2 C3 C4 C5 C6 C7
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
[1] 'C[n]' indicates 'Core [n]' for the NUMA node.
Hyper Threading for Threaded Codes
For threaded codes, Hyper Theading can allow you to run with double the number of threads per MPI task for a fixed number of nodes and tasks. For example, an MPI/OpenMP code designed to run with (2) MPI tasks and (8) threads per task without hyper threading via:
 aprun -n2 -d8 -j1
Could be run with (16) threads per task with Hyper Threading:
 aprun -n2 -d16


8.12.4. Controlling MPI Task Layout Within an Eos Node

(Back to Top)

Users have (2) ways to control MPI task layout:

  1. Within a physical node
  2. Across physical nodes
This article focuses on how to control MPI task layout within a physical node.
Understanding NUMA Nodes

Each physical node is organized into (2) 8-core NUMA nodes. NUMA is an acronym for "Non-Uniform Memory Access". You can think of a NUMA node as a division of a physical node that contains a subset of processor cores and their high-affinity memory.

Applications may use resources from one or both NUMA nodes. The default MPI task layout is SMP-style. This means MPI will sequentially allocate all cores on one NUMA node before allocating tasks to another NUMA node.

Note: A brief description of how a physical XC30 node is organized can be found on the XC30 node description page.
Spreading MPI Tasks Across NUMA Nodes

Each physical node contains (2) NUMA nodes. Users can control MPI task layout using the aprun NUMA node flags. For jobs that do not utilize all cores on a node, it may be beneficial to spread a physical node's MPI task load over the (2) available NUMA nodes via the -S option to aprun.

Note: Jobs that do not utilize all of a physical node's processor cores may see performance improvements by spreading MPI tasks across NUMA nodes within a physical node.
Example 1: Default NUMA Placement
Job requests (2) processor cores without a NUMA flag. Both tasks are placed on the first NUMA node.
$ aprun -n2 ./a.out
Rank 0, Node 0, NUMA 0, Core 0
Rank 1, Node 0, NUMA 0, Core 1
Example 2: Specific NUMA Placement
Job requests (2) processor cores with aprun -S. A task is placed on each of the (2) NUMA nodes:
$ aprun -n2 -S1 ./a.out
Rank 0, Node 0, NUMA 0, Core 0
Rank 1, Node 0, NUMA 1, Core 0
The following table summarizes common NUMA node options to aprun:
Option Description
-S Processing elements (essentially a processor core) per NUMA node. Specifies the number of PEs to allocate per NUMA node. Can be 1, 2, 3, 4, 5, 6, 7, or 8.
-ss Strict memory containment per NUMA node. The default is to allow remote NUMA node memory access. This option prevents memory access of the remote NUMA node.
Advanced NUMA Node Placement
Example 1: Grouping MPI Tasks on a Single NUMA Node
Run a.out on (8) cores. Place (8) MPI tasks on (1) NUMA node. In this case the aprun -S option is optional:
$ aprun -n8 -S8 ./a.out
Compute Node
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 1 2 3 4 5 6 7
Example 2: Spreading MPI tasks across NUMA nodes
Run a.out on (8) cores. Place (4) MPI tasks on each of (2) NUMA nodes via aprun -S.
$ aprun -n8 -S4 ./a.out
Compute Node
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 1 2 3 4 5 6 7
Example 3: Spreading Out MPI Tasks Across Numa Nodes with Hyper Threading

Hyper Threading is enabled by default and can be explicitly enabled with the -j2 aprun option. With Hyper Threading, the NUMA nodes behave as if each has 16 logical cores.

Run a.out on (18) cores. Place (9) MPI tasks on each of (2) NUMA nodes via aprun -S.
aprun -n 18 -S9 ./a.out
Compute Node 0
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 1 2 3 4 5 6 7 9 10 11 12 13 14 15 16
Core 8 Core 9 Core 10 Core 11 Core 12 Core 13 Core 14 Core 15 Core 8 Core 9 Core 10 Core 11 Core 12 Core 13 Core 14 Core 15
8 17
To see MPI rank placement information on the nodes set the PMI_DEBUG environment variable to 1 For cshell:
$ setenv PMI_DEBUG 1
For bash:
$ export PMI_DEBUG=1


8.12.5. Controlling MPI Task Layout Across Many Physical Nodes

(Back to Top)

Users have (2) ways to control MPI task layout:

  1. Within a physical node
  2. Across physical nodes
This article focuses on how to control MPI task layout across physical nodes nodes. The default MPI task layout is SMP-style. This means MPI will sequentially allocate all virtual cores on one physical node before allocating tasks to another physical node.
Viewing Multi-Node Layout Order
Task layout can be seen by setting MPICH_RANK_REORDER_DISPLAY to 1.
Changing Multi-Node Layout Order
For multi-node jobs, layout order can be changed using the environment variable MPICH_RANK_REORDER_METHOD. See man intro_mpi for more information.
Multi-Node Layout Order Examples
Example 1: Default Layout
The following will run a.out across (32) cores. This requires (2) physical compute nodes.
# On Titan
$ aprun -n 32 ./a.out

# On Eos, Hyper-threading must be disabled:
$ aprun -n 32 -j1 ./a.out
Compute Node 0
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Compute Node 1
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Example 2: Round-Robin Layout
The following will place tasks in a round robin fashion. This requires (2) physical compute nodes.
$ setenv MPICH_RANK_REORDER_METHOD 0
# On Titan
$ aprun -n 32 ./a.out

# On Eos, Hyper-threading must be disabled:
$ aprun -n 32 -j1 ./a.out
Compute Node 0
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
Compute Node 1
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Example 3: Combining Inter-Node and Intra-Node Options
The following combines MPICH_RANK_REORDER_METHOD and -S to place tasks on three cores per processor within a node and in a round robin fashion across nodes.
$ setenv MPICH_RANK_REORDER_METHOD 0
$ aprun -n12 -S3 ./a.out
Compute Node 0
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
0 2 4 6 8 10
Compute Node 1
NUMA 0 NUMA 1
Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7 Core 0 Core 1 Core 2 Core 3 Core 4 Core 5 Core 6 Core 7
1 3 5 7 9 11


8.12.6. Eos Controlling Thread Layout Within a Physical Node

(Back to Top)

Eos supports threaded programming within a compute node. Threads may span across both processors within a single compute node, but cannot span compute nodes. With Intel's Hyper Threading enabled, each node with 16 physical cores has the ability to behave as if it has 32 logical cores. Hyper Threading is enabled by default, so users must pass the -j1 aprun option to explicitly turn it off. For threaded codes hyper threading allow the user to run twice as many threads per physical core. Users have a great deal of flexibility in thread placement. Several examples are shown below.

Note: Threaded codes must use the -d (depth) option to aprun.
The -d option to aprun specifies the number of threads per MPI task. Under previous CNL versions this option was not required. Under the current CNL version, the number of cores used is calculated by multiplying the value of -d by the value of -n.
Warning: Without the -d option, all threads will be started on the same processor core. This can lead to performance degradation for threaded codes.
Thread Layout Examples
The following examples are written for the bash shell. If using csh/tcsh, you should change export OMP_NUM_THREADS=x to setenv OMP_NUM_THREADS x wherever it appears.
Example 1: (2) MPI tasks, (16) Threads Each
This example will launch (2) MPI tasks, each with (16) threads running on their own dedicated physical core. This requests (2) compute nodes and requires a node request of (2):
$ export OMP_NUM_THREADS=16
$ aprun -n2 -d16 -j1 a.out

Rank 0, Thread 0, Node 0, NUMA 0, Core 0 <-- MASTER
Rank 0, Thread 1, Node 0, NUMA 0, Core 1 <-- slave
Rank 0, Thread 2, Node 0, NUMA 0, Core 2 <-- slave
Rank 0, Thread 3, Node 0, NUMA 0, Core 3 <-- slave
Rank 0, Thread 4, Node 0, NUMA 0, Core 4 <-- slave
Rank 0, Thread 5, Node 0, NUMA 0, Core 5 <-- slave
Rank 0, Thread 6, Node 0, NUMA 0, Core 6 <-- slave
Rank 0, Thread 7, Node 0, NUMA 0, Core 7 <-- slave
Rank 0, Thread 8, Node 0, NUMA 1, Core 0 <-- slave
Rank 0, Thread 9, Node 0, NUMA 1, Core 1 <-- slave
Rank 0, Thread 10,Node 0, NUMA 1, Core 2 <-- slave
Rank 0, Thread 11,Node 0, NUMA 1, Core 3 <-- slave
Rank 0, Thread 12,Node 0, NUMA 1, Core 4 <-- slave
Rank 0, Thread 13,Node 0, NUMA 1, Core 5 <-- slave
Rank 0, Thread 14,Node 0, NUMA 1, Core 6 <-- slave
Rank 0, Thread 15,Node 0, NUMA 1, Core 7 <-- slave
Rank 1, Thread 0, Node 1, NUMA 0, Core 0 <-- MASTER
Rank 1, Thread 1, Node 1, NUMA 0, Core 1 <-- slave
Rank 1, Thread 2, Node 1, NUMA 0, Core 2 <-- slave
Rank 1, Thread 3, Node 1, NUMA 0, Core 3 <-- slave
Rank 1, Thread 4, Node 1, NUMA 0, Core 4 <-- slave
Rank 1, Thread 5, Node 1, NUMA 0, Core 5 <-- slave
Rank 1, Thread 6, Node 1, NUMA 0, Core 6 <-- slave
Rank 1, Thread 7, Node 1, NUMA 0, Core 7 <-- slave
Rank 1, Thread 8, Node 1, NUMA 1, Core 0 <-- slave
Rank 1, Thread 9, Node 1, NUMA 1, Core 1 <-- slave
Rank 1, Thread 10,Node 1, NUMA 1, Core 2 <-- slave
Rank 1, Thread 11,Node 1, NUMA 1, Core 3 <-- slave
Rank 1, Thread 12,Node 1, NUMA 1, Core 4 <-- slave
Rank 1, Thread 13,Node 1, NUMA 1, Core 5 <-- slave
Rank 1, Thread 14,Node 1, NUMA 1, Core 6 <-- slave
Rank 1, Thread 15,Node 1, NUMA 1, Core 7 <-- slave

This can also be accomplished on one node with Hyper Threading.

This requests (1) compute nodes and requires a node request of (1)
$ export OMP_NUM_THREADS=16
$ aprun -n2 -d16 a.out

Rank 0, Thread 0, Node 0, NUMA 0, Core 0 <-- MASTER
Rank 0, Thread 1, Node 0, NUMA 0, Core 1 <-- slave
Rank 0, Thread 2, Node 0, NUMA 0, Core 2 <-- slave
Rank 0, Thread 3, Node 0, NUMA 0, Core 3 <-- slave
Rank 0, Thread 4, Node 0, NUMA 0, Core 4 <-- slave
Rank 0, Thread 5, Node 0, NUMA 0, Core 5 <-- slave
Rank 0, Thread 6, Node 0, NUMA 0, Core 6 <-- slave
Rank 0, Thread 7, Node 0, NUMA 0, Core 7 <-- slave
Rank 0, Thread 8, Node 0, NUMA 0, Core 8 <-- slave
Rank 0, Thread 9, Node 0, NUMA 0, Core 9 <-- slave
Rank 0, Thread 10,Node 0, NUMA 0, Core 10 <-- slave
Rank 0, Thread 11,Node 0, NUMA 0, Core 11<-- slave
Rank 0, Thread 12,Node 0, NUMA 0, Core 12<-- slave
Rank 0, Thread 13,Node 0, NUMA 0, Core 13<-- slave
Rank 0, Thread 14,Node 0, NUMA 0, Core 14<-- slave
Rank 0, Thread 15,Node 0, NUMA 0, Core 15 <-- slave
Rank 1, Thread 0, Node 0, NUMA 1, Core 0 <-- MASTER
Rank 1, Thread 1, Node 0, NUMA 1, Core 1 <-- slave
Rank 1, Thread 2, Node 0, NUMA 1, Core 2 <-- slave
Rank 1, Thread 3, Node 0, NUMA 1, Core 3 <-- slave
Rank 1, Thread 4, Node 0, NUMA 1, Core 4 <-- slave
Rank 1, Thread 5, Node 0, NUMA 1, Core 5 <-- slave
Rank 1, Thread 6, Node 0, NUMA 1, Core 6 <-- slave
Rank 1, Thread 7, Node 0, NUMA 1, Core 7 <-- slave
Rank 1, Thread 8, Node 0, NUMA 1, Core 8 <-- slave
Rank 1, Thread 9, Node 0, NUMA 1, Core 9 <-- slave
Rank 1, Thread 10,Node 0, NUMA 1, Core 10 <-- slave
Rank 1, Thread 11,Node 0, NUMA 1, Core 11<-- slave
Rank 1, Thread 12,Node 0, NUMA 1, Core 12<-- slave
Rank 1, Thread 13,Node 0, NUMA 1, Core 13<-- slave
Rank 1, Thread 14,Node 0, NUMA 1, Core 14<-- slave
Rank 1, Thread 15,Node 0, NUMA 1, Core 15<-- slave
Example 2: (2) MPI tasks, (6) Threads Each
This example will launch (2) MPI tasks, each with (6) threads. Place (1) MPI task per NUMA node. This requests (1) physical compute nodes and requires a nodes request of (1):
$ export OMP_NUM_THREADS=6
$ aprun -n2 -d6 -S1 a.out
Compute Node
NUMA 0 NUMA 1
Core0 Core1 Core2 Core3 Core4 Core5 Core6 Core7 Core0 Core1 Core2 Core3 Core4 Core5 Core6 Core7
Rank0 Thread0 Rank0 Thread1 Rank0 Thread2 Rank0 Thread3 Rank0 Thread4 Rank0 Thread5 Rank1 Thread0 Rank1 Thread1 Rank1 Thread2 Rank1 Thread3 Rank1 Thread4 Rank1 Thread5
Example 3: (4) MPI tasks, (2) Threads Each
This example will launch (4) MPI tasks, each with (2) threads. Place only (1) MPI task [and its (2) threads] on each NUMA node. This requests (2) physical compute nodes and requires a nodes request of (2), even though only (8) cores are actually being used:
$ export OMP_NUM_THREADS=2
$ aprun -n4 -d2 -S1 a.out

Rank 0, Thread 0, Node 0, NUMA 0, Core 0 <-- MASTER
Rank 0, Thread 1, Node 0, NUMA 0, Core 1 <-- slave
Rank 1, Thread 0, Node 0, NUMA 1, Core 0 <-- MASTER
Rank 1, Thread 1, Node 0, NUMA 1, Core 1 <-- slave
Rank 2, Thread 0, Node 1, NUMA 0, Core 0 <-- MASTER
Rank 2, Thread 1, Node 1, NUMA 0, Core 1 <-- slave
Rank 3, Thread 0, Node 1, NUMA 1, Core 0 <-- MASTER
Rank 3, Thread 1, Node 1, NUMA 1, Core 1 <-- slave


9. Eos Thread Affinity Example

(Back to Top)

The example application is a Cray test code, cray-mpi-ex.c, that shows you how your MPI tasks are placed on the “cores” within in Eos’s compute nodes. This application may be useful to you if you are trying to figure out how your application’s MPI task will be distributed. The cray-mpi-ex.c test code is given at the bottom of this example if you want to view it or copy it for your own use.

Compile
The compiler wrappers on Eos function like the compiler wrappers on Titan. The main functional difference is that the Intel compiler and programing environment is default on Eos and the PGI equivalents are default on Titan. I will use the Intel environment below. To compile:
eos%  cc cray-mpi-ex.c
Batch Script
Here is the example batch script cray-mpi.pbs:
#!/bin/bash
#    Begin PBS directives
#PBS -A STF007
#PBS -N cray-mpi
#PBS -j oe
#PBS -l walltime=1:00:00,nodes=2
#    End PBS directives and begin shell commands
cd $MEMBERWORK/stf007
aprun -n 32 -j1 ./a.out
To submit this from $MEMBERWORK/[projid]:
eos% qsub cray-mpi.pbs
The output will be in $MEMBERWORK/[projid] in a file called cray-mpi.ojob_number. I used two nodes and I did not use Hyper Threading. In the output below notice that two nodes, 708 and 709 have been used, and two sets of cores, 0-14, are listed for 32 ranks.
Rank 9, Node 00708, Core 9
Rank 8, Node 00708, Core 8
Rank 15, Node 00708, Core 15
Rank 7, Node 00708, Core 7
Rank 5, Node 00708, Core 5
Rank 3, Node 00708, Core 3
Rank 2, Node 00708, Core 2
Rank 1, Node 00708, Core 1
Rank 4, Node 00708, Core 4
Rank 6, Node 00708, Core 6
Rank 12, Node 00708, Core 12
Rank 14, Node 00708, Core 14
Rank 10, Node 00708, Core 10
Rank 13, Node 00708, Core 13
Rank 0, Node 00708, Core 0
Rank 11, Node 00708, Core 11
Rank 25, Node 00709, Core 9
Rank 20, Node 00709, Core 4
Rank 16, Node 00709, Core 0
Rank 30, Node 00709, Core 14
Rank 21, Node 00709, Core 5
Rank 22, Node 00709, Core 6
Rank 19, Node 00709, Core 3
Rank 23, Node 00709, Core 7
Rank 18, Node 00709, Core 2
Rank 26, Node 00709, Core 10
Rank 31, Node 00709, Core 15
Rank 28, Node 00709, Core 12
Rank 24, Node 00709, Core 8
Rank 27, Node 00709, Core 11
Rank 29, Node 00709, Core 13
Rank 17, Node 00709, Core 1
Application 19374 resources: utime ~4s, stime ~20s, Rss ~4736, inblocks ~10667, outblocks ~24358
If I wanted to use Hyper Threading, I could omit the -j1 aprun option and half as many nodes. Here the modified batch script:
#!/bin/bash
#    Begin PBS directives
#PBS -A STF007
#PBS -N cray-mpi
#PBS -j oe
#PBS -l walltime=1:00:00,nodes=1
#    End PBS directives and begin shell commands
cd $MEMBERWORK/stf007
aprun -n 32 ./a.out
Below is the output with Hyper Threading. Notice that only one node, 708, was used and this time cores 0-32 were used for 32 ranks. Hyper threading makes each physical core behave as two logical cores. Each logical core stores a complete program state, but it must split the resources of the physical core.
Rank 0, Node 00708, Core 0
Rank 1, Node 00708, Core 16
Rank 29, Node 00708, Core 30
Rank 28, Node 00708, Core 14
Rank 2, Node 00708, Core 1
Rank 3, Node 00708, Core 17
Rank 12, Node 00708, Core 6
Rank 13, Node 00708, Core 22
Rank 9, Node 00708, Core 20
Rank 8, Node 00708, Core 4
Rank 22, Node 00708, Core 11
Rank 23, Node 00708, Core 27
Rank 17, Node 00708, Core 24
Rank 30, Node 00708, Core 15
Rank 19, Node 00708, Core 25
Rank 31, Node 00708, Core 31
Rank 18, Node 00708, Core 9
Rank 5, Node 00708, Core 18
Rank 4, Node 00708, Core 2
Rank 21, Node 00708, Core 26
Rank 20, Node 00708, Core 10
Rank 26, Node 00708, Core 13
Rank 27, Node 00708, Core 29
Rank 14, Node 00708, Core 7
Rank 15, Node 00708, Core 23
Rank 10, Node 00708, Core 5
Rank 11, Node 00708, Core 21
Rank 25, Node 00708, Core 28
Rank 24, Node 00708, Core 12
Rank 16, Node 00708, Core 8
Rank 7, Node 00708, Core 19
Rank 6, Node 00708, Core 3
Application 19376 resources: utime ~1s, stime ~1s, Rss ~3484, inblocks ~5226, outblocks ~12180
The Test Application cray-mpi-ex.c
Here is the example program if you wish to view or copy it.
#define _GNU_SOURCE 
#include <stdio.h>
#include <sched.h>
#include <string.h>
#include "mpi.h"
/* Borrowed from util-linux-2.13-pre7/schedutils/taskset.c */
static char *cpuset_to_cstr(cpu_set_t *mask, char *str)
{
char *ptr = str;
int i, j, entry_made = 0;
for (i = 0; i < CPU_SETSIZE; i++) {
if (CPU_ISSET(i, mask)) {
int run = 0;
entry_made = 1;
for (j = i + 1; j < CPU_SETSIZE; j++) {
if (CPU_ISSET(j, mask)) run++;
else break;
 }
if (!run)
sprintf(ptr, "%d,", i);
else if (run == 1) {
sprintf(ptr, "%d,%d,", i, i + 1);
i++;
} else {
sprintf(ptr, "%d-%d,", i, i + run);
i += run;
}
while (*ptr != 0) ptr++;
}
}
ptr -= entry_made;
*ptr = 0;
return(str);
}
int main(int argc, char *argv[])
{
int rank, thread, i;
cpu_set_t coremask;
char clbuf[7 * CPU_SETSIZE], hnbuf[64], node[64];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
memset(clbuf, 0, sizeof(clbuf));
memset(hnbuf, 0, sizeof(hnbuf));
(void)gethostname(hnbuf, sizeof(hnbuf));

        /*Remove nid from node name*/
  for (i=3; hnbuf[i] != '\0'; i++)
  {
    node[i-3] = hnbuf[i];
  }

{
(void)sched_getaffinity(0, sizeof(coremask), &coremask);
cpuset_to_cstr(&coremask, clbuf);
printf("Rank %d, Node %s, Core %s\n", rank, node, clbuf);
}
MPI_Finalize();
return(0);
}
If you have any questions about this example, please contact user support or your scientific computing liaison.