Gurobi: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
No edit summary
mNo edit summary
Line 76: Line 76:
This is an example job script for an optimization model written in the [https://www.gurobi.com/documentation/8.1/refman/lp_format.html LP format].
This is an example job script for an optimization model written in the [https://www.gurobi.com/documentation/8.1/refman/lp_format.html LP format].
{{File
{{File
   |name=gurobi_example.sh
   |name=script_coins.sh
   |lang="sh"
   |lang="sh"
   |contents=
   |contents=
#!/bin/bash
#!/bin/bash
#SBATCH --account=def-group  # some account
#SBATCH --account=def-group  # some account
#SBATCH --time=0:30           # time limit (D-HH:MM)
#SBATCH --time=1:00           # specify time limit (D-HH:MM)
#SBATCH --mem-per-cpu=1000M  # memory per CPU (in MB)
#SBATCH --mem=4G              # specify total memory
#SBATCH --cpus-per-task=4    # specify number threads


<!--T:75-->
<!--T:75-->
# use a version >= 9.0.3  
#module load StdEnv/2016      # for versions < 9.0.3  
module load StdEnv/2020
module load StdEnv/2020       # for versions > 9.0.2
module load gurobi/9.1.0


<!--T:77-->
module load gurobi/9.5.0
# Create environment file in current directory setting the number of threads:
echo "Threads ${SLURM_CPUS_ON_NODE:-1}" > gurobi.env


<!--T:79-->
<!--T:79-->
gurobi_cl ${GUROBI_HOME}/examples/data/coins.lp
gurobi_cl Threads=$SLURM_CPUS_ON_NODE LogFile=coins.log ResultFile=coins.sol ${GUROBI_HOME}/examples/data/coins.lp
}}
}}


cc_staff
1,857

edits

Navigation menu