@@ -230,7 +230,13 @@ export JOBLABEL
230230export MATTERMOSTHOOK
231231export CONTROLSERVER
232232
233- [[ $PRODSPLIT -gt 100 ]] && echo " Production split needs to be smaller than 100 for the moment" && exit 1
233+ # Validate the production split level and derive the zero-padding width used for the
234+ # per-subjob OutputDir counter (#alien_counter_<W>i#) and for local fetching. The width
235+ # adapts to PRODSPLIT (minimum 3, so existing 3-digit layouts are unchanged), which lifts
236+ # the former hard cap of 100 while keeping OutputDir naming consistent at any scale.
237+ [[ ! $PRODSPLIT =~ ^[0-9]+$ || $PRODSPLIT -lt 1 ]] && echo " Production split must be a positive integer (got '${PRODSPLIT} ')" && exit 1
238+ COUNTERWIDTH=${# PRODSPLIT}
239+ [[ $COUNTERWIDTH -lt 3 ]] && COUNTERWIDTH=3
234240
235241# check for presence of jq (needed in code path to fetch output files)
236242[[ " $FETCHOUTPUT " ]] && { which jq & > /dev/null || { echo " Could not find jq command. Please load or install" && exit 1; }; }
@@ -371,7 +377,7 @@ ${DATACOLLECTION:+InputDataListFormat = ${QUOT}txt-list${QUOT};}
371377${DATACOLLECTION: +InputDataCollection = ${QUOT} LF: ${MY_JOBWORKDIR} / collection.xml,nodownload${QUOT} ;}
372378${PRODSPLIT: +Split = ${QUOT}${SPLITMODE}${QUOT} ;}
373379${DATACOLLECTION: +SplitMaxInputFileNumber = 1;}
374- OutputDir = "${MY_JOBWORKDIR} /${PRODSPLIT: +# alien_counter_03i # } ";
380+ OutputDir = "${MY_JOBWORKDIR} /${PRODSPLIT: +# alien_counter_0 ${COUNTERWIDTH} i # } ";
375381Requirements = member(other.GridPartitions,"${GRIDPARTITION:- multicore_8} ");
376382CPUCores = "${CPUCORES} ";
377383MemorySize = "60GB";
504510 THIS_JOB=${SUBJOBIDS[jobindex]}
505511 echo " Fetching for job ${THIS_JOB} "
506512 if [ " ${THIS_STATUS} " == " DONE" ]; then
507- SPLITOUTDIR=$( printf " %03d " ${splitcounter} )
513+ SPLITOUTDIR=$( printf " %0 ${COUNTERWIDTH} d " ${splitcounter} )
508514 [ ! -f ${SPLITOUTDIR} ] && mkdir ${SPLITOUTDIR}
509515 echo " Fetching result files for subjob ${splitcounter} into ${PWD} "
510516 CPCMD=" alien.py cp ${MY_JOBWORKDIR} /${SPLITOUTDIR} /* file:./${SPLITOUTDIR} "
0 commit comments