|
[Sponsors] |
January 14, 2013, 04:59 |
Running O-FOAM on a server
|
#1 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18 |
Dear All,
I am running O-FOAM on a server and I need to launch a series of commands. Hence I created a file called launch.sh which should have allowed me to run all the commands. The file looks like this: Code:
#!/bin/bash te about the ad-hoc solver and workaround cd 55Deg/ mapFields -consistent -sourceTime 2 ../60Deg/ buoyantPimpleFoam cd ../50Deg mapFields -consistent -sourceTime 0.08 ../55Deg/ buoyantPimpleFoam cd ../45Deg mapFields -consistent -sourceTime 0.08 ../50Deg/ buoyantPimpleFoam cd ../40Deg mapFields -consistent -sourceTime 0.08 ../45Deg/ buoyantPimpleFoam cd ../35Deg mapFields -consistent -sourceTime 0.08 ../40Deg/ buoyantPimpleFoam cd ../30Deg mapFields -consistent -sourceTime 0.08 ../35Deg/ buoyantPimpleFoam cd 25Deg mapFields -consistent -sourceTime 0.08 ../30Deg/ buoyantPimpleFoam cd ../20Deg mapFields -consistent -sourceTime 0.08 ../25Deg/ buoyantPimpleFoam cd ../15Deg mapFields -consistent -sourceTime 0.08 ../20Deg/ buoyantPimpleFoam cd ../10Deg mapFields -consistent -sourceTime 0.08 ../15Deg/ buoyantPimpleFoam cd ../5Deg mapFields -consistent -sourceTime 0.08 ../10Deg/ buoyantPimpleFoam cd ../0Deg mapFields -consistent -sourceTime 0.08 ../5Deg/ buoyantPimpleFoam Code:
cd 55Deg/ mapFields -consistent -sourceTime 2 ../60Deg/ buoyantPimpleFoam Thanks for help, Samuele |
|
January 14, 2013, 05:19 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
How did you run the script? If you didn't explicitly set it to run in the background without hang-up, it will terminate when you disconnect.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
January 14, 2013, 05:34 |
|
#3 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18 |
That's probably what I have missed.
I simply run sh launch.sh. What should I do, then? |
|
January 14, 2013, 05:55 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
See:
http://www.cfd-online.com/Forums/ope...e-machine.html http://www.cfd-online.com/Forums/mai...s-running.html
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
January 14, 2013, 05:57 |
|
#5 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Ironically, I also found an old post of yours with the question and later the answer:
http://www.cfd-online.com/Forums/ope...tml#post375590
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
January 14, 2013, 06:04 |
|
#6 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18 |
Yeah, you're right.
But that thread didn't offer me the solution. I can't und what I am missing. Probabily it's better to start from the / folder, when I give the cd command in the launch.sh file. |
|
January 14, 2013, 16:36 |
|
#7 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Code:
nohup launch.sh > out.log &
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
January 16, 2013, 05:09 |
|
#8 |
Senior Member
|
You could try running via the "screen" command. If you are on the server, just execute "screen". This will open a new session on the server. After starting the job, you can "detach" the screen with a command to be looked up ;-) and afterwards reattach via "screen -r".
After having detached from the screen you can logout from the server without shutting down that run. When returning to the server, reattach as described. Important: If the server has several nodes, most probably you will have to login to the same node again for "screen -r" to work properly! So note down the server number (and the screen number) before leaving for the night/lunch/coffee/etc. ;-) |
|
January 16, 2013, 08:02 |
|
#9 |
Senior Member
Vieri Abolaffio
Join Date: Jul 2010
Location: Always on the move.
Posts: 308
Rep Power: 16 |
+1 to screen.
Or you can set up a scheduler like SGE and launch different jobs, one for each case. this will avoid the need to create a custom script every time and will automatically set lauch the job when the previous one is completed. but on a single machine i'm not shure how much it is worth the hassle, it is usually used on clusers... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 12:40 |
Running Fluent on remote Unix server | msth | FLUENT | 2 | April 13, 2010 16:26 |
gmsh2ToFoam | sarajags_89 | OpenFOAM | 0 | November 24, 2009 22:50 |
Statically Compiling OpenFOAM Issues | herzfeldd | OpenFOAM Installation | 21 | January 6, 2009 09:38 |
CFD Online Server Load | Jonas Larsson | Main CFD Forum | 0 | March 13, 2001 14:29 |