Hi Julien,
I believe you can retrieve the job id (like David did) and then use the
'afterany' dependency with a fake 'true' command:
bash$ JID=`sbatch --array=1-1000 -o /dev/null test.sh | awk '{print $4}'`
bash$ srun -d "afterany:$JID" true
srun: job 788910 queued and waiting for resources
srun: job 788910 has been allocated resources
But, I don't think there is any easy way to get an aggregated return code
like with the Sun Grid Engine --sync option:
man qsub
If -sync y is used in conjunction with -t n[-m[:i]],
qsub will wait for all the job's tasks to complete
before exiting. If all the job's tasks complete suc-
cessfully, qsub's exit code will be that of the first
completed job tasks with a non-zero exit code, or 0 if
all job tasks exited with an exit code of 0
Regards
--
Nicolas Grandemange