Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Running GenOpt in Linux Server

asked 2014-11-11 11:27:58 -0500

Mansi's avatar

updated 2014-11-11 11:31:20 -0500

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?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-11-11 16:58:02 -0500

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.

edit flag offensive delete link more


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

answered 2014-11-12 07:02:42 -0500

scottb's avatar

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.

edit flag offensive delete link more

answered 2014-11-17 04:54:09 -0500

Mansi's avatar

updated 2014-11-18 09:44:50 -0500

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:


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

cd (the path of matlab script)

echo "$INPUT" > script_log.out

echo "$NNNN" >> script_log.out

# time -o time.out 
matlab -nodisplay -nosplash -nodesktop -r $NNNN
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-11-11 11:27:58 -0500

Seen: 426 times

Last updated: Nov 18 '14