CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Running O-FOAM on a server

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Linse

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2013, 04:59
Default Running O-FOAM on a server
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
The point is that - after the weekend - I discovered the the simulation stopped after these lines:

Code:
cd 55Deg/
mapFields  -consistent -sourceTime 2 ../60Deg/
buoyantPimpleFoam
Why this happened? I am not sure if this happened either because I have switched my laptop off (but I thought that the launch.sh file would have run in background. Am I wrong?) or because I write cd ../50Deg instead of cd 50Deg since the launch.sh is in the directory case which contains all the other folders (e.g.50Deg, 45Deg and so on..), at the same level of 55Deg folder.

Thanks for help,

Samuele
samiam1000 is offline   Reply With Quote

Old   January 14, 2013, 05:19
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   January 14, 2013, 05:34
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
That's probably what I have missed.

I simply run sh launch.sh.

What should I do, then?
samiam1000 is offline   Reply With Quote

Old   January 14, 2013, 05:55
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   January 14, 2013, 05:57
Default
  #5
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   January 14, 2013, 06:04
Default
  #6
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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.
samiam1000 is offline   Reply With Quote

Old   January 14, 2013, 16:36
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Code:
nohup launch.sh > out.log &
Disclaimer: This is not a great idea if you are sharing the server with others.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   January 16, 2013, 05:09
Default
  #8
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
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. ;-)
samiam1000 likes this.
Linse is offline   Reply With Quote

Old   January 16, 2013, 08:02
Default
  #9
Senior Member
 
sail's Avatar
 
Vieri Abolaffio
Join Date: Jul 2010
Location: Always on the move.
Posts: 308
Rep Power: 16
sail is on a distinguished road
+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...
__________________
http://www.leadingedge.it/
Naval architecture and CFD consultancy
sail is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:42.