Search code examples
sungridengineqsub

Receive email only when all the tasks are completed


I am launching a lot of jobs on a cluster as an array (similarly to what explained in http://www3.imperial.ac.uk/bioinfsupport/help/cluster_usage/submitting_array_jobs)
If I use $ -m ea I receive hundreds of emails, one for job.

How can I receive an email only when all the tasks are completed? Is it possible to receive when all the tasks are completed but also an email when any of the task is aborted?


Solution

  • According to my knowledge, this does not seem possible. Others may have more experience, so I defer final solution to those with more experience.

    However, what you can do is:

    1. Submit your job array without the -m option (or with -m a to track aborted tasks)
    2. submit a second single dummy job using -hold_jid_ad <job_id_of_job_array> and -m e option.

    This will send email when hold on on single job (step 2) is satisfied i.e. when all tasks in your job array complete (step 1).