How to run multiple codes on a cluster using qsub through MCR

3 views (last 30 days)
Hi everybody! I use matlab in my research and currently I need to run lots of simulations. For these purposes I'm trying to run my codes on our institute cluster. We have very limited amount of licenses, so to overcome this issue I'm trying to use MCR. First I'm generating a programme which doesn't need matlab executable anymore by running this line:
$ /software/as/el6.5/matlab/R2014a/bin/mcc -o mattest -W main:MyFunc -T link:exe -d . -R nodisplay -v MyFunc.m.
This way I generate programme run_mattest.sh which calls function MyFunc.m (depends on one variable - path to the input file). Then if I run the run_mattest.sh on a server on my home node, it works well. The line for that is:
sh ~/Develop/Matlab/run_mattest.sh /software/as/el6.5/matlab/MCR_R2015a/v85 ~/modelling/space_scan/data__1.txt,
where ~/modelling/space_scan/data__1.txt - destination of input file, which my function calls. I get my desired output plus while running I get this message on a screen:
------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/software/as/el6.5/matlab/MCR_R2015a/v85/runtime/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/bin/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/sys/os/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/sys/opengl/lib/glnxa64
Now I'm trying to submit codes on cluster. I wrote simple execution file just for one input. Body looks this way:
#!/bin/bash
#$ -N execute_mito
#$ -cwd
#$ -l virtual_free=10G,disk=10G
qsub ~/Develop/Matlab/run_mattest.sh /software/as/el6.5/matlab/MCR_R2015a/v85 ~/modelling/space_scan/data__1.txt
#./test.sh
As a result I get next error message:
/usr/share/univage/soldierantcluster/spool/node-hp0506/job_scripts/7400568: line 30: /usr/share/univage/soldierantcluster/spool/node-hp0506/job_scripts/mattest: No such file or directory
And this output message:
------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/software/as/el6.5/matlab/MCR_R2015a/v85/runtime/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/bin/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/sys/os/glnxa64:/software/as/el6.5/matlab/MCR_R2015a/v85/sys/opengl/lib/glnxa64
As result, I dont get my desired output. I can't resolve it myself, and googling so far doesn't help. I would really appreciate any advice/idea!
Many thanks, Alsu
  1 Comment
Alsu
Alsu on 22 Aug 2016
In case that might be useful - here is a body of run_mattest.sh:
#!/bin/sh
# script for execution of deployed applications
#
# Sets up the MATLAB runtime environment for the current $ARCH and executes
# the specified command.
#
exe_name=$0
exe_dir=`dirname "$0"`
echo "------------------------------------------"
if [ "x$1" = "x" ]; then
echo Usage:
echo $0 \<deployedMCRroot\> args
else
echo Setting up environment variables
MCRROOT="$1"
echo ---
LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64;
export LD_LIBRARY_PATH;
echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
shift 1
args=
while [ $# -gt 0 ]; do
token=$1
args="${args} \"${token}\""
shift
done
eval "\"${exe_dir}/mattest\"" $args
fi
exit

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!