-
Notifications
You must be signed in to change notification settings - Fork 0
/
sub.bdw
54 lines (46 loc) · 1.64 KB
/
sub.bdw
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
50
51
52
53
54
#!/bin/bash
#SBATCH -A easybuild
#SBATCH -J EB-install
#SBATCH -t 6:00:00
#SBATCH -N 1
#SBATCH -n 4
#SBATCH --constraint=broadwell
ml purge > /dev/null 2>&1
ml eb_builder/${EB_BRANCH:-default}
if [ "x$EB_BRANCH" = "xdevelop" ]; then
if [ -z "$EBUSER" ]; then
echo "EBUSER MUST be set when using eb_builder/develop"
exit 1
fi
fi
# Should probably be used as
# env EB_INSTALL_PARAMS="--robot --rebuild" EB_INSTALL_PKG="pomkl-2018b.eb" sbatch ~easybuild/sub
# If EB_CMD is set it will run that instead of "eb", would normally be used to run real_eb instead.
# If EB_BRANCH is set it will change the eb_builder module version from "default", typically "develop"
#
export SBATCH_CONSTRAINT=broadwell
export SBATCH_ACCOUNT=$SLURM_JOB_ACCOUNT
p=`pwd`
#bp="--buildpath=$p/$SLURM_JOB_ID"
tl="--tmp-logdir=$p/tmplogs/$SLURM_JOB_ID"
#td="--tmpdir=$p/tmpdir/$SLURM_JOB_ID"
# Need to make sure that --from-pr and --job works well together
# --from-pr needs to put the .eb and any patches in a shared dir
# And since it is the invoking eb command that pulls the easyconfig/patches the tmpdir
# must be kept so the sub jobs can find them.
if [ $(expr match "$EB_INSTALL_PARAMS" '^.*--job') -ne 0 ]; then
if [ $(expr match "$EB_INSTALL_PKG" '^.*--from-pr') -ne 0 ]; then
td="--disable-cleanup-tmpdir --tmpdir=$p/tmpdir/$SLURM_JOB_ID"
export EASYBUILD_TMPDIR=$p/tmpdir/$SLURM_JOB_ID
fi
fi
if [ -z "$EB_CMD" ]; then
EB_CMD=eb
fi
if [ -z "$EB_INSTALL_PKG" ]; then
echo Forcing spider cache update
eb
else
echo $EB_CMD $EB_INSTALL_PKG $EB_INSTALL_PARAMS $bp $tl $td
$EB_CMD $EB_INSTALL_PKG $EB_INSTALL_PARAMS $bp $tl $td
fi