1

Running GenOpt in Linux Server

Hi Again,

I would like to run GenOpt in our server. The simulator is Matlab. I can run it without any problem in PC with the command line in the configuration file like below:

Command = "cmd /c \"\"C:\\Program Files\\MATLAB\\R2012a\\bin\\\"matlab -wait -nodisplay -nosplash -nodesktop  -r \"addpath('C:\\Users\\jesmanim\\Documents\\genopt\\example\\quad\\5_spot_1producer');decoder_5spot %Simulation.Files.Log.Path1%;exit\"\"";

However, when I run it in the server with the command line:

Command ="matlab -nodisplay -nosplash -nodesktop -r \"addpath('/home/jesmanim/ code/genopt/example/quad/5spot');decoder5spot(%Simulation.Files.Log.Path1);exi t;\"";

It seems GenOpt is waiting for Matlab and nothing works there. Is there any idea?

Mansi's avatar
61
Mansi
asked 2014-11-11 11:27:58 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2014-11-11 11:31:20 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

3 Answers

3

I don't know what causes this as GenOpt just spawns a new process with the string specified by Command. This process runs in a subdirectory of the current directory so that output files between parallel processes don't overwrite each other. If your decoder_5spot file reads from files, this may be the issue as it executes from a subdirectory below the directory from which you started GenOpt.

I suggest you remove the -nodesktop and -nodisplay options to see whether this opens a Matlab GUI, and then you should see whether Matlab encounters any error.

Michael Wetter's avatar
1.7k
Michael Wetter
answered 2014-11-11 16:58:02 -0500
edit flag offensive 0 remove flag delete link

Comments

One more question: how to run genopt on multiple cores in a cluster with torque scheduler (i.e. using the qsub command)? Thanks for your help.

Mansi's avatar Mansi (2014-11-18 03:24:27 -0500) edit
add a comment see more comments
2

matlab -nojvm -nodisplay -r 'run(FILENAME)'

Make sure your Matlab code is wrapped in a function

Running GenOpt on linux servers (no GUI): java -classpath ${GENOPT}/genopt.jar genopt.GenOpt optLinux.ini

Where $GENOPT is the path to your GenOpt directory.

If you want a GUI run: java -jar ${GENOPT}/genopt.jar optLinux.ini

Scott B.

scottb's avatar
542
scottb
answered 2014-11-12 07:02:42 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
1

The problem solved. I wrote a job script and run Matlab from that. The issue was transferring the path to Matlab.
The job script is like this:

#!/bin/sh

#rm -r tmp-runtimes
#mkdir tmp-runtimes

cd (the path of matlab script)

INPUT=$1
echo "$INPUT" > script_log.out

NNNN="decoder_5spot('"${INPUT}"');exit;"
echo "$NNNN" >> script_log.out

# time -o time.out 
matlab -nodisplay -nosplash -nodesktop -r $NNNN
Mansi's avatar
61
Mansi
answered 2014-11-17 04:54:09 -0500
Neal Kruis's avatar
4.7k
Neal Kruis
updated 2014-11-18 09:44:50 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments