Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91248170
job_pipeline.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 9, 08:32
Size
1 KB
Mime Type
text/x-shellscript
Expires
Mon, Nov 11, 08:32 (2 d)
Engine
blob
Format
Raw Data
Handle
22229345
Attached To
rGYACOMO GYACOMO (OBSOLETE: LATEST VERSION ON gitlab.epfl.ch)
job_pipeline.sh
View Options
#! /bin/bash
#This script automatizes the launch of multiple job with chain dependency.
nu_
=
0.01
dnu
=
0.01
Tm_
=
2000
dTm
=
2000
# First submit
lastji
=
$(
sbatch submit_00.cmd
)
lastjid
=
${
lastji
##*
}
echo
$lastji
#echo $lastjid
for
i in
{
1..1
}
;
do
# Setup indices of job id (current and previous one)
im1
=
$(
awk
"BEGIN {print $i-1}"
)
idm1
=
$(
printf
'%02d'
$im1
)
id
=
$(
printf
'%02d'
$i
)
# Create new submit file from older one
awk -v
"ID=$id"
'{
if (NR == 8) print "#SBATCH --error=err_"ID".txt";
else if (NR == 9) print "#SBATCH --output=out_"ID".txt";
else if (NR == 12) print "srun --cpu-bind=cores ./gyacomo 2 24 1 "ID;
else print $0}'
submit_
$idm1
.cmd > submit_
$id
.cmd
# Create new fort file from older one
awk -v
"NU=$nu_"
-v
"TM=$Tm_"
-v
"J2L=$im1"
'{
if (NR == 04) print " tmax = "TM;
else if (NR == 40) print " job2load = "J2L;
else if (NR == 54) print " nu = "NU;
else print $0}'
fort_
$idm1
.90 > fort_
$id
.90
# Retrieve last jobid and launch next job with dep
lastji
=
$(
sbatch --dependency
=
afterok:
$lastjid
submit_0
$i
.cmd
)
lastjid
=
${
lastji
##*
}
echo
$lastjid
# Increment variables
nu_
=
$(
awk
"BEGIN {print $nu_+$dnu}"
)
Tm_
=
$(
awk
"BEGIN {print $Tm_+$dTm}"
)
done
Event Timeline
Log In to Comment