# INTEL CONFIDENTIAL
# Copyright 2009-2012  Intel Corporation All Rights Reserved.
# The source code contained or described herein and all documents related 
# to the source code ("Material") are owned by Intel Corporation or its
# suppliers or licensors. Title to the Material remains with Intel Corporation
# or its suppliers and licensors. The Material may contain trade secrets and
# proprietary and confidential information of Intel Corporation and its 
# suppliers and licensors, and is protected by worldwide copyright and trade
# secret laws and treaty provisions. No part of the Material may be used,
# copied, reproduced, modified, published, uploaded, posted, transmitted,
# distributed, or disclosed in any way without Intel's prior express 
# written permission. 
#
# No license under any patent, copyright, trade secret or other intellectual
# property right is granted to or conferred upon you by disclosure or delivery
# of the Materials, either expressly, by implication, inducement, estoppel or
# otherwise. Any license under such intellectual property rights must be
# express and approved by Intel in writing.
#
# Include any supplier copyright notices as supplier requires Intel to use.
# Include supplier trademarks or logos as supplier requires Intel to use, 
# preceded by an asterisk. An asterisked footnote can be added as follows: 
# *Third Party trademarks are the property of their respective owners.
# Unless otherwise agreed by Intel in writing, you may not remove or alter 
# this notice or any other notice embedded in Materials by Intel or Intel's 
# suppliers or licensors in any way..

# [ICS VERSION STRING: @(#) ./Moab/README 7_4_3_0_2 [01/26/18 09:02]

README for Moab scripts directory
---------------------------------

This directory contains:

* Three scripts for submitting Moab jobs, one each for OpenMPI, mvapich, and mvapich2
* A helper script that is used by the three previously mentioned scripts 
* This file



Virtual Fabric integration with Moab
------------------------------------

The sole intent of the Moab scripts is to act as templates for the administrator, on how to enable
Moab to take advantage of Virtual Fabric (vFabric) functionality.  In order to make these scripts
accessible to common users, the administrator must do the following:

   1. (Optional) If necessary, edit the scripts to meet the configuration and usage criteria
      requirements specific to your Moab environment.
   2. Copy the scripts to a shared file system service that provides the appropriate access rights
      for common users.

In order for Moab to take advantage of vFabric functionality, vFabric must be integrated with Moab.
There are several integration methods that could be used, these scripts use the method of Moab based
queues.  This method requires that the administrator perform the following steps (for detailed
information on vFabric, reference "Fabric Manager Users Guide"):

   1. For both Moab and the Resource Manager(s), create a queue for each vFabric defined within the
      FM configuration file (/etc/sysconfig/ifs_fm.xml).
   2. Configure each vFabric queue defined within Moab with the compute nodes assigned to it within
      the FM configuration file. 
   3. (Optional) Configure each vFabric queue defined within Moab with the priorities, policies, QoS,
      and attributes that are specific to the needs of the organization and fabric environment.

Note, depending on the queue support requirements of a Resource Manager, steps 2 and 3 may also have
      to be performed upon that Resource Manager (TORQUE does not require these two steps).



Moab Submit Scripts
-------------------

Moab submit scripts utilize the Moab primitive "msub", encapsulating the arguments and call structure
for ease-of-use. They query the SA for information regarding virtual fabrics, or in the case of PSM
with dist_sa, pass the appropriate arguments to PSM for SA lookup.

The submit scripts default the MPICH_PREFIX if it is not set in the environment. The openmpi, mvapich
and mvapich2 scripts default to the -qlc versions of MPI.

The submit scripts utilize a helper script called "moab.mpi.job.wrapper".  This helper script is used
to dynamically generate a hosts file required for MPI.  This host file is a list of hosts to run MPI
on.  The host file created is called ".mpi_hosts_file.<PID>" and is created in the work directory
on the primary node executing the job.  Note, the Moab scripts DO NOT delete the host file; therefore,
clean up of these temporary host files is the responsibility of the user.

   
Here are some examples of how to call the scripts and pass vFabric parameters (Note, these examples
utilize the proprietary MPI applications, which are located in the /opt/iba/src/mpi_apps/
directory.  These MPI applications were provided specifically for administrative use only):


Example 1:

	moab.submit.openmpi.job -p 2 -V vf_name -n Compute -d 3 osu2/osu_bibw

This submits a job with the openmpi-qlc subsystem, i.e. the run file osu_bibw is expected to have been
compiled with the openmpi-qlc compiler under gcc. The number of processes is given as 2, and the virtual
fabric to use is identified by name, and that name is "Compute".  Option 3 is given to denote a
dispersive routing option of static_dest.  

Example 2:

	moab.submit.openmpi.job -p 2 -V sid -s 0x0000000000000022 -d 1 osu2/osu_bibw

This submits a job with the openmpi-qlc subsystem, i.e. the run file osu_bibw is expected to have been
compiled with the openmpi-qlc compiler under gcc. The number of processes is given as 2, and the virtual
fabric to use is identified by service id, and that id is "0x0000000000000022".  Option 3 is given
to denote a dispersive routing option of adaptive.

Example 3:

        moab.submit.openmpi.job -p 2 -V sid_qlc -s 0x1000117500000000 -q night osu2/osu_bibw

This submits a job with the openmpi-qlc subsystem, i.e. the run file osu_bibw is expected to have been
compiled with the openmpi-qlc compiler under gcc. The number of processes is given as 2. The virtual fabric
to use is identified by service id, and that id is "0x1000117500000000"; it will be passed to the QIB driver
which will perform the vFabric lookup on behalf of the job.  No dispersive routing instructions are given.
The job is being requested for submission via the "night" Moab queue.



Moab Script Administration
--------------------------

The scripts are intended to be tailored by the Moab administrator in order to structure the msub
parameters appropriately. Any parameters, such as queue name, application profile, work directory, etc. may
be inserted into the script either using script options, accessing environment variables, or by hardcoding.

Additionally, the scripts use mpirun_rsh or mpirun to start MPI jobs. This method enables the vFabric
parameters to be passed to the MPI jobs so that the appropriate lower level actions can be taken based on
those settings (e.g. inserting Service Level information into data messages). Any MPI job command parameters
should be used on the script command line, and will be passed to the MPI run job.

