Python script to run a serie of simulations on EDEM
Hello,
I would like to know if someone has a script to run a series of simulations on EDEM. I can only run one simulation at a time, but it would be very helpful if I could set up a couple of simulations, and once one simulation is finished the next one on the list would automatically start.
It could be a draft of a script, I just need something as a base.
Thanks a lot.
Julia
Answers
-
Hi Julia,
There is a bat file and pdf document explaining the procedure to submit jobs in batch mode.
hope this helps.
Thanks,
Prasad A
0 -
Hello Prasad,
For some reason, I am not succeding in downloading your zip file. Where can I find this tutorial?
Thanks0 -
Julia Bonaldo said:
Hello Prasad,
For some reason, I am not succeding in downloading your zip file. Where can I find this tutorial?
ThanksHi Julia,
Please find the below link.
In this below link 3 tutorials please follow the instructions in 10.1 pdf document
Thanks,
Prasad A
0 -
Hi Julia,
You can find the tutorial here:
The first part covers running EDEM from command line and you can find further details on command flags in the EDEM documentation:
There is also an easy graphical way to run EDEM simulations with varying parameters using HyperStudy which you would have access to under your units:
I recommend using the HyperStudy workflow so check out the how-to videos in the above link.
Best regards,
Stefan
0 -
Thank you Stefan and Prasad for the answers.
I've created a simple script shell if you use a Linux machine on SSH mode to run EDEM simulations. I checked the EDEM documentation, but it uses a .bat file, so I believe it's more applied to a Windows machine if I am not mistaken.
As an example here I run 2 simulations in SSH, and once the first one is finished, the second one will start automatically:#!/bin/bash
dos2unix run_simulations.sh
# Define the simulation paths
simulation_path1="enter_your_simulation1_path"
simulation_path2="enter_your_simulation2_path"echo "Debug: Current directory is $(pwd)" # Print the current working directory
#to check if the path you entered is correct:
echo "Debug: simulation_path1 is $simulation_path1"
echo "Debug: simulation_path2 is $simulation_path2"# Run simulation 1 in the background
echo "Running simulation 1: $simulation_path1"
nohup edem -c -i "$simulation_path1/name_file.dem" -r 5 > simulation1.log 2>&1 &
echo "Simulation 1 started in the background."# Wait for simulation 1 to finish
wait# Run simulation 2 in the background
echo "Running simulation 2: $simulation_path2"
nohup edem -c -i "$simulation_path2/name_file.dem" -r 5 > simulation2.log 2>&1 &
echo "Simulation 2 started in the background."In this case, I've added the command nohup, so The simulation will happen in the background. It means that if I turn off MobaXterm for example my simulation will keep running in the Linux machine.
But I believe that if someone uses this script needs to be careful when killing a job as I am not sure if the last data will be saved.Please let me know if you have more suggestions to improve this shell.
Julia
0