@@ -13,6 +13,7 @@ Department of Physics, University of Notre Dame
1313+ 01/01/18 (pjf): Update for installation with ` pip ` .
1414+ 02/06/18 (pjf): Update MCSCRIPT_SOURCE file path.
1515+ 02/09/18 (mac): Overhaul configuration instructions.
16+ + 07/10/23 (pjf): Update for ` MCSCRIPT_CONFIG ` variable.
1617
1718----------------------------------------------------------------
1819
@@ -43,77 +44,74 @@ Department of Physics, University of Notre Dame
4344 Set up the package in your ` PYTHONPATH ` by running ` pip ` :
4445
4546 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46- % python3 -m pip install --user --editable .
47+ % python3 -m pip install --user .
4748 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4849
4950 Note that the ` . ` here means to install the Python package defined by the code
50- in the current directory.
51+ in the current directory. If you are actively developing ` mcscript ` itself,
52+ you may want to pass the ` --editable ` flag to ` pip ` . However, beware that
53+ this may result in a fragile installation, e.g., the wrong version of ` qsubm `
54+ may be executed if you upgrade.
5155
5256 a. Subsequently updating source:
5357
5458 ~~~~~~~~~~~~~~~~
5559 % git pull
56- % python3 -m pip install --user --editable .
60+ % python3 -m pip install --user .
5761 ~~~~~~~~~~~~~~~~
5862
59- This subsequent ` pip install ` , when updating the source code, is a precaution
60- in case, e.g., the package dependencies have changed.
61-
6263# 2. Local configuration
6364
64- The local configuration file provides functions which construct the batch
65+ The local configuration module provides functions which construct the batch
6566 submission (qsub, sbatch, etc.) command lines and and serial/parallel
6667 execution launch (mpiexec, srun, etc.) invocations appropriate to your
67- cluster and running needs. You need to create a symbolic link ` config.py ` to
68- point to the correct configuration file for the system or cluster you are
69- running on.
68+ cluster and running needs. You must define the ` MCSCRIPT_CONFIG ` environment
69+ variable to specify the correct configuration module for the system or
70+ cluster you are running on.
7071
7172 If you are only doing * local* runs (i.e., no batch job submission) on your
72- laptop/workstation, and if you are using with OpenMPI as your MPI
73- implementation, you can use the generic configuration file config-ompi.py in
74- mcscript/ config:
73+ laptop/workstation, and if you are using with OpenMPI as your MPI
74+ implementation, you can use the generic configuration module
75+ ` mcscript. config.ompi ` :
7576
7677 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77- % ln -s config/config-ompi.py config.py
78+ % export MCSCRIPT_CONFIG="mcscript. config.ompi"
7879 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7980
80- Example local configuration files for Univa Grid Engine at the Notre
81- Dame Center for Research Computing and SLURM at NERSC are included
82- in the mcscript/config directory.
81+ Local configuration modules for several clusters are provided as part of the
82+ ` mcscript ` distribution:
8383
84- > #### @NDCRC : ####
85- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86- % ln -s config/config-uge-ndcrc.py config.py
87- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88-
89- > #### @NERSC : ####
90- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91- % ln -s config/config-slurm-nersc.py config.py
92- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+ - ` mcscript.config.uge_ndcrc ` - Univa Grid Engine at CRC (Notre Dame)
85+ - ` mcscript.config.slurm_nersc ` - Slurm at NERSC (LBNL)
86+ - ` mcscript.config.torque_oak ` - Torque at UBC ARC (TRIUMF)
9387
9488 Otherwise, whenever you move to a new cluster, you will have to
95- write such a file , to take into account the pecularities of the
89+ write such a module , to take into account the pecularities of the
9690 batch submission software and queue structure of that cluster.
97- You can use the above example files as models to define your own configuration
98- file appropriate to your own cluster and your own running needs.
91+ You can use the above example modules (distributed in ` mcscript/config ` ) as
92+ models to define your own configuration module(s) appropriate to your own
93+ cluster(s) and your own running needs. In such a case, you can set
94+ ` MCSCRIPT_CONFIG ` to the full path of the configuration module file:
95+
96+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97+ % export MCSCRIPT_CONFIG="/home/alice/code/gadget_acme.py"
98+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
99100
100101# 3. Environment variables
101102
102- You will also need to add the ` mcscript\tools ` directory to your command path.
103- Furthermore, the mcscript job submission utility "qsubm" expects certain
104- environment variables to be defined at submission time:
103+ The ` mcscript ` package expects certain environment variables to be defined
104+ at both submission and run time:
105105
106- > MCSCRIPT_DIR specifies the directory in which the mcscript package is
107- > installed, i.e., the directory where the file qsubm.py is found. (Note
108- > that qsubm uses this information to locate certain auxiliary script files
109- > used as part of the job submission process.)
106+ > ` MCSCRIPT_CONFIG ` (described above) specifies the cluster configuration
107+ > module.
110108
111- > MCSCRIPT_INSTALL_HOME specifies the directory in which executables are
109+ > ` MCSCRIPT_INSTALL_HOME ` specifies the directory in which executables are
112110 > found.
113111
114- > MCSCRIPT_RUN_HOME specifies the directory in which job files are found.
112+ > ` MCSCRIPT_RUN_HOME ` specifies the directory in which job files are found.
115113
116- > MCSCRIPT_WORK_HOME specifies the parent directory in which run scratch
114+ > ` MCSCRIPT_WORK_HOME ` specifies the parent directory in which run scratch
117115 > directories should be made. This will normally be on a fast scratch
118116 > filesystem.
119117
@@ -126,23 +124,21 @@ Department of Physics, University of Notre Dame
126124
127125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128126 # mcscript
129- setenv MCSCRIPT_DIR ${HOME}/code/ mcscript
127+ setenv MCSCRIPT_CONFIG mcscript.config.ompi
130128 setenv MCSCRIPT_INSTALL_HOME ${HOME}/code/install
131129 setenv MCSCRIPT_RUN_HOME ${HOME}/runs
132130 setenv MCSCRIPT_WORK_HOME ${SCRATCH}/runs
133- setenv PATH ${MCSCRIPT_DIR}/tools:${PATH}
134131 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135132
136133 Alternatively, if you are a bash user, you would add something like the
137134 following to your .bashrc file:
138135
139136 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140137 # mcscript
141- export MCSCRIPT_DIR=${HOME}/code/ mcscript
138+ export MCSCRIPT_CONFIG= mcscript.config.ompi
142139 export MCSCRIPT_INSTALL_HOME=${HOME}/code/install
143140 export MCSCRIPT_RUN_HOME=${HOME}/runs
144141 export MCSCRIPT_WORK_HOME=${SCRATCH}/runs
145- export PATH=${MCSCRIPT_DIR}/tools:${PATH}
146142 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147143
148144 You may also need to set environment variables expected by the scripting for
@@ -152,7 +148,7 @@ Department of Physics, University of Notre Dame
152148 To tell mcscript about this file, make sure you set MCSCRIPT_SOURCE
153149 at the time you submit the job, i.e., before calling qsubm:
154150
155- > MCSCRIPT_SOURCE (optional) should give the full qualified
151+ > ` MCSCRIPT_SOURCE ` (optional) should give the full qualified
156152 > filename (i.e., including path) to any shell code which should
157153 > be "sourced" at the beginning of the batch job. This should be
158154 > sh/bash-compatible code.
0 commit comments