HyperStudy Child Processes

Rahul Sharma
Rahul Sharma Altair Community Member
edited August 13 in Community Q&A

Hi,

I am running EDEM through a python script in HyperStudy through the "Parameterized File" model. The python script runs the EDEM simulation through a bat file with the following command: "C:\Program Files\Altair\2023\EDEM\bin\edem.exe" -c -i Simulation.dem -r 10

The script finishes and the child process of edem.exe closes after 10 minutes as the main process is considered to be finished. 

I came across this link (https://2023.help.altair.com/2023/hwdesktop/hst/topics/design_exploration/hst_waiting_child_processes_r.htm) which gives examples of the command line solver arguments that may be given to continue running the child processes.

It is not exactly clear that where should the argument ° be added to facilitate the child process to keep running.

Can you please advise where should the argument be added to keep running the child processes ?

Regards.

Answers

  • Eric Veikle_22252
    Eric Veikle_22252
    Altair Employee
    edited August 8

    Hello Rahul,

    As an alternative to using a Parameterized file to run the EDEM simulations I would suggest installing the EDEM-HyperStudy Connector.  Once installed you will be able to add an EDEM model to the HyperStudy study.  If you choose this path to solve your problem you need not worry about the child process.

    You can find the EDEM HyperStudy Connector here: https://community.altair.com/community/en/edem-hyperstudy-connector-installers-and-user-guide?id=kb_article&sys_id=73d72edadbb68a10cfd5f6a4e296190e

    Kind Regards,

    Eric

  • Rahul Sharma
    Rahul Sharma Altair Community Member
    edited August 8

    Hi Eric,

    Thank you very much for the suggestion.

    I am using the "Parameterized File" model as I want to stop/kill the EDEM simulation after a specific target variable value is achieved.

    The .stop file is generated after the stop condition is met which stops the simulation, I then delete the .stop file through the script to restart the simulation, the EDEM simulation then restarts and stops after 10 min as it is considered a child process.

    If the child process keeps on running, it will help me to run the simulation till the end.

    Can you please advise where should the argument be added to keep running the child processes ?

    Regards.

  • Eric Veikle_22252
    Eric Veikle_22252
    Altair Employee
    edited August 9

    Hello Rahul,

    You can implement something similar to what was done in the attached script to run your EDEM simulation and conditionally stop it.  The HS_Focus_Hold script is called from HyperStudy.  In this script there is a file generated called EDEM_RUNNING and there is a loop at the end of the script that is used to check if the file exists in the directory.  As long as the file remains in the directory the focus of HyperStudy will be held on the current task.  Within the script a job is submitted to PBS called with the command qsub edem_job.txt 

    The edem_job.txt script is where the EDEM simulation is initiated and can be monitored to conditionally stop and restart the simulation.  Once the simulation has been run to completion the EDEM_RUNNING.sh file is removed from the directory, allowing HyperStudy to proceed to the next iteration.

    Note that these scripts were generated to be used on a Linux operating system.  However I believe the approach is valid for a Windows operating system as well the syntax may need some adjustments.  Also this approach is setup for using Altair PBS to queue the simulations.  If you are using a different job scheduler / a standalone computer then the script will need to be modified.

    Please let me know if this content was helpful, or if you have any further questions.

    Kind Regards,

    Eric

  • Rahul Sharma
    Rahul Sharma Altair Community Member
    edited August 13

    Hi Eric,

    Thank you very much for suggesting the solution.

    I added a condition in the script which checks the time from a csv file (written during the EDEM simulation) and only stops EDEM when the condition (appropriate run time) is met.

    Thanks again !

    Regards.