How to run matlab file on HPC cluster?
Awaiting user inputIn Matlab, I use Gurobi to run an optimization and this works perfectly; however, when I try to run the Matlab file on the HPC cluster. It doesn't use Gurobi anymore.
I have successfully run the testfile of Gurobi using the following code:
export GUROBI_HOME="/home/nfs/rdoodeman/gurobi912/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="${GUROBI_HOME}/gurobi.lic"
cd $GUROBI_HOME
cat > gurobi.lic <<EOD
TOKENSERVER=flexserv-x1.tudelft.nl
PORT=27099
EOD
gurobi_cl $GUROBI_HOME/examples/data/coins.lp
Now when I try to run a batch script with my matlab script in it, it does not use Gurobi anymore. This is the batch script:
cat ->coolfile5 <<EOF
#!/bin/bash
#SBATCH --partition=general
#SBATCH --qos=short
#SBATCH --time=00:05:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem=2G
#SBATCH --output=coolbestand5.%j.out
#SBATCH -o qe-%j
module use /opt/insy/modulefiles
module load matlab/R2020b
matlab -nodisplay -nosplash -r test
EOF
I believe, the mistake is somewhere in the why I am trying to run the Matlab file. Could someone help me with this?
-
Hi Rogier,
Could you post the error you see? In the case that you don't see any errors, could you post the output you get and explain what you expect to see? Do you have a valid Gurobi license on the machine running the batch job?
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment