|
[Sponsors] |
January 26, 2011, 05:07 |
Automatically starting a run
|
#1 |
New Member
Join Date: May 2010
Posts: 9
Rep Power: 16 |
Hi everybody,
let’s say I have a set-up which takes 1hour to run. So in theory, when I leave work at 5pm and come back next morning at 8am, the system could have ran a dozen of simulations. So is there a possibility to start the next simulation once the previous one is done (something like a “batch-run”)??? Regards, Dora |
|
January 26, 2011, 07:23 |
|
#2 |
Member
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 17 |
You can run Star-CCM+ in batch mode ( -batch file.java).
Imagine a file called run.java containing something like: // STAR-CCM+ macro: run.java package macro; import java.util.*; import java.io.*; import javax.swing.*; import star.common.*; import star.base.neo.*; import star.vis.*; import star.base.report.*; import star.flow.*; public class run extends StarMacro { public void execute() { execute0(); } private void execute0() { try { Simulation simulation_0 = getActiveSimulation(); simulation_0.getSimulationIterator().run(); simulation_0.saveState(simulation_0.getSessionPath ()); } catch (Exception e) { JOptionPane.showMessageDialog( null, e.toString() ); } } } then you could run starccm+ -batch run.java file.sim. You could add some of these command lines in a batch script. Have fun Oliver |
|
January 26, 2011, 08:15 |
|
#3 |
New Member
Join Date: May 2010
Posts: 9
Rep Power: 16 |
Hi Oliver,
thanks for your reply. Somehow Im a bit confused as Im not comfortable with this macro stuff. Let's say the files I have are: Version_01.sim Version_02.sim Version_03.sim Do I than to open Version_01.sim, click the marco file button to generate a java file and put the text below?? // STAR-CCM+ macro: run.java package macro; import java.util.*; import java.io.*; import javax.swing.*; import star.common.*; import star.base.neo.*; import star.vis.*; import star.base.report.*; import star.flow.*; public class run extends StarMacro { public void execute() { execute0(); } private void execute0() { try { Simulation simulation_0 = getActiveSimulation(); simulation_0.getSimulationIterator().run(); simulation_0.saveState(simulation_0.getSessionPath ()); } catch (Exception e) { JOptionPane.showMessageDialog( null, e.toString() ); } } } But were would the connection to the Version_02.sim and Version_03.sim be? Im confused. Please advise. Thank you!! again |
|
January 26, 2011, 09:00 |
|
#4 |
Member
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 17 |
You create a file run.java containing the posted text with an editor of your choice.
Then you prepare all your simulation cases in a way that they only need to be started and save them. At last you create a batch file where you write something like starccm+ -batch run.java Version_01.sim starccm+ -batch run.java Version_02.sim starccm+ -batch run.java Version_03.sim The details for this batch file depend on the OS you use. Usually you can see in the GUI how CCM+ is started on your machine. run.java automatically finds out path and name of the simulation, runs it and saves the results with the same name. |
|
January 26, 2011, 10:05 |
|
#5 |
Senior Member
Ryne Whitehill
Join Date: Aug 2009
Posts: 312
Rep Power: 19 |
Alternatively you can look into a queuing system, which is external to STAR-CCM+.
e.g. : http://www.platform.com/workload-man...ance-computing I am sure you can find some free/open source project to do the same thing. |
|
January 27, 2011, 13:00 |
|
#6 | |
New Member
Join Date: Jun 2010
Posts: 3
Rep Power: 16 |
Quote:
|
||
July 13, 2022, 12:09 |
|
#7 |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
Hello, any update on that? does this still works on 2022.1 or similar versions?
I cannot manage to make it run. I can execute the program but does not open the window and then I cannot manage to make it run the simulation. I'm on windows 10 if that helps Thanks |
|
July 14, 2022, 01:18 |
|
#8 |
Senior Member
|
Previously to do a batch run we have to set up a micro. We can still get batch run macro from Star-CCM+ support. But now Star-CCM+ have added node under "Tools" called "Simulation Operations". With simulation operations you can design your own algorithm from set of commands like meshing, running physics, setting different parameter value, clear solution etc. Try exploring this option.
|
|
July 14, 2022, 03:20 |
|
#9 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
Quote:
What I would like to do is to prepare like 3-4 *.sim files and execute them one after the other automatically. I only have 1 power license and this way would allow me to run various 3-4h simulations overnight |
||
July 17, 2022, 23:00 |
|
#10 |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 437
Rep Power: 18 |
The simpliest way I can see - is to use the command line.
|
|
July 18, 2022, 04:38 |
|
#11 | |||
Senior Member
Join Date: Apr 2009
Posts: 159
Rep Power: 17 |
Quote:
1) Make sure your sims have batch autosave enabled (in File>Autosave). 2) Place all your sims and macros in the same folder. 3) Create a text file that contains the following text, and rename its extension from .txt to .bat If you have macros you'd like to run for each sim, use: Quote:
Quote:
4) Change 17.02.008 to your version (if different), installation directory (if different), the number after -np for the number of cores you want to use (note: these are all on local host), and obviously the names of macros and sims. 5) Open command prompt and change directory to your folder. This is easiest done by opening the folder, clicking in the address bar, typing cmd, and hitting enter. 6) Run batch file by typing its name and hitting enter. 7) If you want to terminate current sim or whole batch job, press Ctrl+C. If you want to view current sim, open Star-CCM+, right-click on your sim in Servers window and connect (then disconnect when done). |
||||
July 18, 2022, 04:52 |
|
#12 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
Quote:
To be fair, I managed to execute it and I saw starccm was running on the task manager but I didn't know what it was doing... the connect to the server I did not know and that all now makes sense. |
||
July 18, 2022, 06:10 |
|
#13 |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 437
Rep Power: 18 |
||
July 18, 2022, 10:08 |
|
#14 |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
||
October 21, 2022, 18:13 |
|
#15 | |
New Member
Join Date: Oct 2022
Posts: 1
Rep Power: 0 |
Quote:
Code:
"C:\Program Files\Siemens\17.02.008-R8\STAR-CCM+17.02.008-R8\star\lib\win64\intel20.1vc14.2-r8\lib\starccm+.exe" starccm+ -server -power -podkey MYPODKEY -licpath 1999@flex.cd-adapco.com -np 2 -batch run Star.sim I always get this error message: Code:
Unable to start Simcenter STAR-CCM+. Invalid file type. Check arguments and their order. Usage: starccm+ [-server] [<options> ...] [<simfile>] |
||
October 22, 2022, 20:12 |
|
#16 | |||
Senior Member
Join Date: Apr 2009
Posts: 159
Rep Power: 17 |
Quote:
Before: Quote:
Quote:
|
||||
November 17, 2022, 04:54 |
|
#17 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
Quote:
Also, can I add a "Simulation Operation" that calls a Macro? this way I can control when each macro is executed. Thanks |
||
November 17, 2022, 16:41 |
|
#18 | |
Senior Member
Join Date: Apr 2009
Posts: 159
Rep Power: 17 |
Quote:
The batch macro is called when launching the simulation. Whatever you do in the macro is what's done to the simulation. The batch process (in this case) does not automatically run, mesh, or save; so, the macro must do this (except saving, you can also do this automatically via a tick mark in File>Autosave). The macro you pass to the batch process can call other macros & execute sim ops (which themselves can call macros). It's macros all the way down, yo. So, in your case, just have the batch macro execute your sim op. There's also a "run" batch command; however, it's equivalent to hitting run, and I don't think it executes sim ops (never tried it). |
||
November 18, 2022, 08:05 |
|
#19 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 65
Rep Power: 4 |
Quote:
|
||
November 18, 2022, 15:21 |
|
#20 | |
Senior Member
Join Date: Apr 2009
Posts: 159
Rep Power: 17 |
Quote:
So, you must have been asking whether you can call macros within the batch macro itself? If so, then the answer is yes (as previously stated). |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to run OF in parallel on a multiple-node cluster | quartzian | OpenFOAM | 3 | November 24, 2009 14:37 |
serial run fine, but parallel run diverged | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | October 6, 2009 09:33 |
How to run InterFoam in steay state | waynezw0618 | OpenFOAM Running, Solving & CFD | 0 | November 10, 2008 08:08 |
Windows 64-bit, Distributed Parallel Run Issues... | Erich | CFX | 3 | March 28, 2006 17:36 |
Restatring run | Tim | CFX | 2 | March 3, 2006 12:54 |