forked from TACC/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparamrun_unity
executable file
·50 lines (41 loc) · 1.16 KB
/
paramrun_unity
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Goal: To be able to launch a job with the following code
#
# module load launcher
# export LAUNCHER_WORKDIR=Your-Working-Directory-Here
# export LAUNCHER_JOB_FILE=helloworld_multi_output
#
# $LAUNCHER_DIR/paramrun
# LAUNCHER_WAIT=0
LAUNCHER_CORES_PER_TASK=1
#LAUNCHER_MEM_PER_TASK=0
LAUNCHER_CORES_TOTAL=$SLURM_CPUS
if [[ -z $LAUNCHER_JOB_FILE ]]
then
echo "Error: LAUNCHER_JOB_FILE not set"
exit 1
else
if [[ -f $LAUNCHER_JOB_FILE ]]
then
export LAUNCHER_NJOBS=`wc -l $LAUNCHER_JOB_FILE | awk '{print $1}'`
if [[ $LAUNCHER_NJOBS -eq 0 ]]
then
echo "Error: LAUNCHER_JOB_FILE ($LAUNCHER_JOB_FILE) is empty"
exit 1
fi
else
echo "Error: LAUNCHER_JOB_FILE ($LAUNCHER_JOB_FILE) not found"
exit 1
fi
fi
echo "------------- SUMMARY ---------------"
echo " Working directory: $LAUNCHER_WORKDIR"
echo " Total processes: $LAUNCHER_CORES_TOTAL"
echo " Total jobs: $LAUNCHER_NJOBS"
echo
echo "-------------------------------------"
echo "Launcher: Starting parallel tasks..."
cd $LAUNCHER_WORKDIR
env $LAUNCHER_DIR/pass_env
# $LAUNCHER_DIR/init_launcher_unity
$LAUNCHER_DIR/launcher_unity $LAUNCHER_JOB_FILE