You have two options for managing those dependencies, as I see it)
The first approach will get the jobs run soonest. The second approach is a bit of a hack, and it means that the dependent jobs don’t get submitted until the previous jobs have finished,
which isn’t ideal, but it does work, and it meets your requirement of having a single build process that works both with and without SLURM:
JOBSTARTER=srun -c 1 -t 00:05:00
SLEEP=60
all: jobC.out
clean:
rm -f job[ABC].out
jobA.out:
$(JOBSTARTER) sh -c "sleep $(SLEEP); echo done > $@"
jobB.out:
$(JOBSTARTER) sh -c "sleep $(SLEEP); echo done > $@"
jobC.out: jobA.out jobB.out
$(JOBSTARTER) sh -c "echo done > $@"
When you want to run it interactively, you set JOBSTARTER to be empty, otherwise you use some suitable srun command to run the tasks under SLURM, and the above makefile does this:
$ make -j
srun -c 1 -t 00:01:00 sh -c "sleep 60; echo done > jobA.out"
srun -c 1 -t 00:01:00 sh -c "sleep 60; echo done > jobB.out"
srun: job 13324201 queued and waiting for resources
srun: job 13324202 queued and waiting for resources
srun: job 13324201 has been allocated resources
srun: job 13324202 has been allocated resources
srun -c 1 -t 00:01:00 sh -c "echo done > jobC.out"
srun: job 13324220 queued and waiting for resources
srun: job 13324220 has been allocated resources
Regards,
Tim
--
Tim Cutts
Scientific Computing Platform Lead
AstraZeneca
Find out more about R&D IT Data, Analytics & AI and how we can support you by visiting our Service
Catalogue |
AstraZeneca UK Limited is a company incorporated in England and Wales with registered number:03674842 and its registered office at 1 Francis Crick Avenue, Cambridge Biomedical Campus, Cambridge, CB2 0AA.
This e-mail and its attachments are intended for the above named recipient only and may contain confidential and privileged information. If they have come to you in error, you must not copy or show them to anyone; instead, please reply to this e-mail, highlighting the error to the sender and then immediately delete the message. For information about how AstraZeneca UK Limited and its affiliates may process information, personal data and monitor communications, please see our privacy notice at www.astrazeneca.com