Submit dependency jobs from Deadline Command

Dear all.

When submitting multiple jobs that need dependencies on each other at the same time via Deadline Command, I’m curious if I am doing it right and if there is a better way without having to call getJobIdsFilter repeatedly?

  • submit job #1, using a timestamp as comment
  • getJobIdsFilter comment=timestamp to get ID of job #1
  • submit job #2 with JobDependencies=ID and timestamp2 as comment
  • get ID from job #2 using timestamp2, pass that to job #3
  • repeat

If there is a better way to do this please let me know, thank you.

I think deadline command returns the ID(s) of previous submission.

For example Houdini submitter returns ID’s from Deadline command
in SubmitHoudiniToDeadlineFunctions.py’s SubmitRenderJob() function

jobResult = CallDeadlineCommand( arguments )
jobId = ""
resultArray = jobResult.split()
for line in resultArray:
	if line.startswith( "JobID=" ):
		jobId = line.replace( "JobID=","" )
		break
1 Like

Yup, grabbing the returned ID is how we do it.

If the chain is linear, there’s also SubmitMultipleJobs from DeadlineCommand:

SubmitMultipleJobs
  Submits multiple jobs at once.
    [dependent]              This flag makes each job in the list of jobs
                             specified dependent on the previous job. This is
                             shorthand for specifying -dependsonprevious for
                             each job being submitted
    [notify]                 This flag displays a notification window after
                             the jobs have been submitted
    [job <Job Files>]        This flag must precede each list of files for
                             each individual job being submitted. You can
                             also add the -dependsonprevious flag to make a
                             single job dependent on the previous job

There’s an example over here

Thank you! That [dependent] flag sounds wonderful, I will give that a try.

About deadlinecommand returning the ID, how do I catch that? stderr=subprocess.PIPE ?

I would think it comes in

 stdout=subprocess.PIPE

for working example I’d check “\\YOUR_REPOSITORY\submission\Houdini\Client\CallDeadlineCommand.py”

edit:
or if you’re working in maya and mel then “\\YOUR_REPOSITORY\submission\Maya\Client\DeadlineMayaClient.mel

1 Like