Submitting PhoenixFD Sim Job via Maxscript/Deadline

Hey Guys,

I want to use deadline to submit a PhoenixFD Simulation to the farm. So I have a little maxscript that starts the simulation while the job is sent as a maxscript job (Single Task, Workstation Mode, disable Progress Update timeout) Everything works like a charm, the sim starts - but then Max just closes. With a lot of trial and error I figured out that it works fine when I set the “Number of seconds between queries for new Tasks while the Slave is Rendering” (Repository Options, Slave Settings) to some large number. But that also affects all other jobs.

Is there any other way to set this just for the job?

I guess that your MAXScript job is returning TRUE too soon. You launch the simulation and immediately after that the script says “I am done!”. So the Max instance runs only until it gets checked and assumed to be finished, which causes Max to close and start another task…

I am not familiar enough with Phoenix, so I am not sure how you launch the simulation. If your MAXScript simply “presses the UI button” of Phoneix and then exits, obviously the job will be considered done. If your MAXScript could continue running after that, say, in a For loop that checks whether the simulation is done (for example based on what files are written to disk, or what the current time of the scene is and so on), and this For loop does NOT prevent the Phoenix Simulation from running, this would be your ticket to success. Unfortunately, since MAXScript runs in the Main Thread of 3ds Max, it is quite possible that it cannot run at the same time as a Phoenix Simulation.

This is only possible with MAXScript functions like render() where the Renderer is launched and MAXScript waits for it to return. It might require changes on the side of Phoenix to allow a MAXScript function to trigger simulation and wait for it to finish before continuing with the next MAXScript command…

So I suspect right now the code looks like (in pseudo-code):

-Initialize DeadlineUtils -Press Simulate button of Phoenix (the sim starts, MAXScript continues) -Return TRUE (the sim is still running)

But you need

-Initialize DeadlineUtils -Call a blocking simulatePhoenix() function (the sim starts, MAXScript waits for function's return) -Return TRUE or FALSE depending on the result of the previous line

Please talk to Chaos Group to determine whether there is a way to do the latter in MAXScript…

Cool. Thanks Bobo! I’ll get in touch with the Chaos guys!

Aaaaand it works. Had to use the A_wait function right after starting the sim. Thanks again for the pointer Bobo!

Hi,

I was just looking into doing Phoenix simulation on through Deadline and was wondering if you’d be willing to share your script to do it. I can try and work it out but seeing as you’ve already got it working…

Cheers

Nick