CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   script for running star (https://www.cfd-online.com/Forums/siemens/54215-script-running-star.html)

Celia November 29, 2004 14:49

script for running star
 
Hi all,

does anyone know if I can write a script file to run ./star so that I can run it with nohup. My broadband connection often closes down and this results in termination of the running job.

I have almost no idea about scripts, so if you can let me know how I can do this I would be very grateful.

Celia


4xF November 30, 2004 04:10

Re: script for running star
 
Something like that should do:

#!/bin/sh WORKDIR=`pwd` ${WORKDIR} star.exe <<EOD star y EOD exit 0

Have fun...

Jamie November 30, 2004 08:23

Re: script for running star
 
batch scripts can be automaticaly created.

With v3150A, starlink with options (to see options, "starlink -h"):

starlink -snfc casename -e star.exe

(s = single precision, n = no subroutines, f = overwrite existing executable of same name, c = casename, followed by actual casename, e = executable name)

This creates a file called star.batch. If using standard v3150A, you'll have to edit the file and change "timex" to "time" unless the timex command exists on your machine. To start the analysis

nohup ./star.batch &

standard output will automatically be sent to star.log.

If you're using v3.2, execute star with the -batch option, i.e.

star -batch (single precision. for double use star -dp -batch)

This creates a file called batch.sh. Simply starting this will *not* send standard output to a file. I start it like this:

nohup ./batch.sh >& star.log &

Then standard output goes to star.log.

Hope this helps.

Celia November 30, 2004 19:12

Re: script for running star
 
Thanks guyes, I will give this a go :)

Celia December 1, 2004 21:56

Re: script for running star
 
I tried both... does'nt work :(

4XF... I wrote a file with your commands, used touch +x filename to create an executable.. when try to run it complains..."bash ./filename: /bin/sh: bad interpreter: Premission denied

Jamie... it does'nt seem to creat any batch file using the command.. I am using v3150A...

Jörn Beilke December 2, 2004 03:27

Re: script for running star
 
if you type "starlink -help" you see the options. assume that your casename is "case" (case.mdl) type

starlink -c case

and the file star.batch is created. If you are on a linux box you have to edit the file and remove the timex command.

Jörn Beilke December 2, 2004 03:29

Re: script for running star
 
if you type "starlink -help" you see the options.
assume that your casename is "case" (case.mdl) type

starlink -c case

and the file star.batch is created. If you are on a linux box you have to edit the file and remove the timex command.

The script should look like:


#!/bin/sh
./star > star.log 2>&1 <<EOD
case
EOD

Guillaume December 2, 2004 09:16

Re: script for running star
 
If your aim is only to start a star run and close your connection you do not need any script. Simply type in the following order:

star > toto case ^Z bg

Usually a job is killed when the output window is destroyed by closing a connection. The first line flushes the output in a file and no more on the window (standard output).

The second line answer the star question ``case name" (but now this question is displayed in the file toto and not on the window).

The third line (ctrl Z) freezes the simulation in order to be able to switch to background (fourth line).

Wait few seconds and open the toto file, you should see the simulation continuing. You can log-off.

NB Do not try to directly type ``star > toto &" as you cannot enter the case.

Celia December 2, 2004 22:46

Re: script for running star
 
Thanks guyes... its working :D


All times are GMT -4. The time now is 09:44.