Sim: 1-200, one task
Render (dependent on sim): 1-200, split into 25 frame tasks
How do I make Render frame dependent on the sim? I’m finding even with Frame Dependencies enabled, it doesn’t start until the whole job is done. I think it works when both jobs share the same task size.
To my knowledge there isn’t anything in DL that supports this. It’s implementable, but afaik will be a hack. If I had to implement this, I’d submit 3 jobs to the queue: the sim (1-200 all in one batch), then a follower job that’s got 200 frames, and then the render job with the 25 frames-per-task. The trick is the middle job, whose purpose is to reveal when the sim frames are done.
I’m thinking you would submit the job as suspended and then queue the frames as the sim completes each frame. But how to do that? You could modify houdini_dl.py to release each frame as the sim completes it, but for that you’d have to pass a lot of stuff into houdini_dl.py to manage the workflow.
The other approach for the middle job is that only the first frame is queued, the rest are on hold (or you force a 1 cpu maximum). It’s a script job that sifts through the stdout of the sim job. If it detects that the first frame is done, it sets the next frame’s status (frame 2) to queued and then exits successfully. Frame 2 now picks up a cpu and watches the output of the sim job, and queues frame 3 when sim frame 2 is done, and exits.
The renders will after-frame correctly even if frames-per-task is greater than 1. The disadvantage of the above approach is that it uses up a cpu somewhere whose sole job is to sit there and watch the stdout of the sim job. But you could probably make multiple purpose-specific workers all on a single machine to act as sim-to-render middlemen, so not that big an impact.
RequiredAssets=<assetPath,assetPath,assetPath> : Specifies what asset files must exist before this job will resume (default = blank). These asset paths must be identified using full paths, and multiple paths can be separated with commas. If using frame dependencies, you can replace padding in a sequence with the ‘#’ characters, and a task for the job will only be resumed when the required assets for the task’s frame exist.
This of course assumes that you know what the output of the sim will be named, which is likely the case. So you need to modify the render job submission to include the RequiredAssets= entry using frame padding for the sim files, and when the necessary 25 first files have been simmed, the first Task of 25 frames will render…
A script dependency can release tasks based on any custom Python logic, including checking for the output files of the sim job. It means that you don’t need to modify the job parameters at submission time, but add the script dependency to the job at any time later using the Job Dependency View. And of course you can code your heart out to add extra logic beyond “file exists” tests - the script could call Shotgun to check if the sim was approved before releasing tasks, check the time of the day and only render if it is after 8pm, and whatnot