Skip to content

Commit 0567fe5

Browse files
committed
Add --inputfile to pre-stage extra files via JDL InputFile
1 parent 4aebb44 commit 0567fe5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎GRID/utils/grid_submit.sh‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ while [ $# -gt 0 ] ; do
219219
--wait-any) WAITFORALIENANY=ON; WAITFORALIEN=ON; shift 1 ;; #wait for any good==done alien jobs to return
220220
--outputspec) OUTPUTSPEC=$2; shift 2 ;; #provide comma separate list of JDL file specs to be put as part of JDL Output field (example '"*.log@disk=1","*.root@disk=2"')
221221
--split-on-collection) DATACOLLECTION=$2; shift 2 ;; # this will split the jobs on InputDataCollection and "file" mode
222+
--inputfile) INPUTFILES+=("$2"); shift 2 ;; # extra file to pre-stage via JDL InputFile (repeatable). Accepts a bare LFN or "LF:<lfn>". Staged by AliEn before the job starts, so it is NOT charged to job CPU/walltime (unlike an in-job 'alien.py cp').
222223
-h) Usage ; exit ;;
223224
--help) Usage ; exit ;;
224225
--fetch-output) FETCHOUTPUT=ON; shift 1 ;; # if to fetch all JOB output locally (to make this job as if it ran locally); only works when we block until all JOBS EXIT
@@ -366,12 +367,20 @@ if [[ "${IS_ALIEN_JOB_SUBMITTER}" ]]; then
366367
if [ "${DATACOLLECTION}" ]; then
367368
SPLITMODE="file"
368369
fi
370+
371+
# Assemble the JDL InputFile list: always the job script, plus any extra files
372+
# requested via --inputfile (each pre-staged by AliEn before the job starts).
373+
INPUTFILE_ENTRIES="${QUOT}LF:${MY_JOBWORKDIR}/alien_jobscript.sh${QUOT}"
374+
for _extra in "${INPUTFILES[@]}"; do
375+
[[ "${_extra}" == LF:* ]] || _extra="LF:${_extra}"
376+
INPUTFILE_ENTRIES="${INPUTFILE_ENTRIES}, ${QUOT}${_extra}${QUOT}"
377+
done
369378
# ---- Generate JDL ----------------
370379
# TODO: Make this configurable or read from a preamble section in the jobfile
371380
cat > "${MY_JOBNAMEDATE}.jdl" <<EOF
372381
Executable = "${MY_BINDIR}/${MY_JOBNAMEDATE}.sh";
373382
Arguments = "${CONTINUE_WORKDIR:+"-c ${CONTINUE_WORKDIR}"} --local ${O2TAG:+--o2tag ${O2TAG}} --ttl ${JOBTTL} --label ${JOBLABEL:-label} --prodsplit ${PRODSPLIT} ${MATTERMOSTHOOK:+--mattermost ${MATTERMOSTHOOK}} ${CONTROLSERVER:+--controlserver ${CONTROLSERVER}}";
374-
InputFile = "LF:${MY_JOBWORKDIR}/alien_jobscript.sh";
383+
InputFile = { ${INPUTFILE_ENTRIES} };
375384
${DATACOLLECTION:+InputDataList = ${QUOT}input.list${QUOT};}
376385
${DATACOLLECTION:+InputDataListFormat = ${QUOT}txt-list${QUOT};}
377386
${DATACOLLECTION:+InputDataCollection = ${QUOT}LF:${MY_JOBWORKDIR}/collection.xml,nodownload${QUOT};}

0 commit comments

Comments
 (0)