hwo to run multiple instances on Linux

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

hwo to run multiple instances on Linux

douchewhite
I need to run multiple instances of Octave on a Linux OS clusters. I had a shell script that does the same job for Matlab. However I have zero experience writing shell scripts, can some one help me change it so it works for Octave? my file goes like:

#!/bin/sh -f

FILE=$1

LGFL=`echo $FILE | sed 's/.$//' | sed 's/.$//'`

echo "Running -> " $FILE
echo "Matlab Output -> " $LGFL".log"

nohup Matlab -nojvm -nodisplay < $FILE >& $LGFL".log" &

echo "Command Started"


Just want to mention my Octave directory is home/user/octave-3.2.4/run-octave.exe. The Octave under the root account is a much older version.
Thanks very much for helping me out!
                                                                                                               Guo Shi Li
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

Judd Storrs-2
On Wed, Jul 21, 2010 at 5:00 PM, douchewhite <[hidden email]> wrote:
> I need to run multiple instances of Octave on a Linux OS clusters. I had a
> shell script that does the same job for Matlab. However I have zero
> experience writing shell scripts, can some one help me change it so it works
> for Octave? my file goes like:

If the previous script worked for matlab, I think you only need to change:

> nohup Matlab -nojvm -nodisplay < $FILE >& $LGFL".log" &

to:

nohup octave -q $FILE >& $LGFL".log" &

> Just want to mention my Octave directory is
> home/user/octave-3.2.4/run-octave.exe

FYI: this file name suspiciously looks like the windows version of
octave instead of the linux version.


--judd
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

douchewhite
If I just run "octave" even under my account it opens the Octave 2.9.9 under root account. I have to like goes into octave-3.2.4 folder and ran "run-octave" to brings up Octave 3.2.4 will this affect how the script goes at all? Like should I try "nohup home/user/octave-3.2.4/run-octave -q $FILE >& $LGFL".log" &" ? Or how should I do it? Thanks for your help
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

Jordi Gutiérrez Hermoso
On 22 July 2010 02:19, douchewhite <[hidden email]> wrote:
>
> If I just run "octave" even under my account it opens the Octave 2.9.9 under
> root account.

This sounds like a huge security flaw and not how Octave is supposed
to work at all. You should investigate why this happens.

> Like should I try "nohup home/user/octave-3.2.4/run-octave -q $FILE >& $LGFL".log" &" ?

That should work. Make the path absolute, though "/home/user..." and
not "home/user..."
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

douchewhite
Thanks for all u r helps the script works now! So the reason mine runs run-octave, I think there were 2 unexpected errors when I do make-install. It says run-octave is just a test run. However so far run-octave has been able to run all the files I needed it to run. Is this a major problem? I can definitely use some help if the errors needs to be fixed.  
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

douchewhite
I found out that using this script after one loop is over, the script wouldn't generate the .log file again, like the matlab version of script did. So right now my file stops every time it finishes one loop. My script file right now looks like this.
#!/bin/sh -f

FILE=$1

LGFL=`echo $FILE | sed 's/.$//' | sed 's/.$//'`

echo "Running -> " $FILE
echo "Octave Output -> " $LGFL".log"

nohup /home/usr/run-octave -q $FILE >& $LGFL".log" &

echo "Command Started

Is this caused by the script? Any suggestions how to fix it?
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

Judd Storrs-2
On Tue, Aug 10, 2010 at 1:09 PM, douchewhite <[hidden email]> wrote:
I found out that using this script after one loop is over, the script
wouldn't generate the .log file again, like the matlab version of script
did.

I can't explain why Matlab would behave differently from what has been posted. I suspect the answer is going to depend on the details of how are you execute the script? How is the loop implemented? Is the script you posted executed by another script?


--judd

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: hwo to run multiple instances on Linux

douchewhite
I execute the script straight from the command window.
My file is long but basically something like

load a text file
for
for
...

save xxxxx.mat
endfor
endfor


will putting a continue command by the end of script of .m file help?