From f0215f250ff56751a58d4f6331ebf926cc77f746 Mon Sep 17 00:00:00 2001 From: Tim Aidan Graulich <63345846+tgraulich@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:04:55 +0100 Subject: [PATCH 1/4] Update documentation to make sure the correct cplex option file is used on the HPC. --- .../gh-pages/running_on_hpc/submitting_a_job.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md b/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md index c2fa54ed..4840d247 100644 --- a/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md +++ b/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md @@ -10,7 +10,10 @@ Remember to study the log report after your job finishes, so you can be more acc After having transferred our Balmorel model through WinSCP (see [previous page](access.md)), we need to submit a job. This means creating a job script that asks for the right amount of memory usage and time before completion. This is done through a job script, illustrated in the code snippet below. We refer to [this general guide](https://www.hpc.dtu.dk/?page_id=1416) by DTU Computing Center for the exact explanations of the different elements. Note that the paths in the `export` commands are specific to our setup at DTU's clusters. -The bottom commands assumes that the job script is submitted from inside your Balmorel folder, and that your Balmorel project contains a "scenario1" scenario - see [how to create new scenarios](../get_started/scenario_setup.md). The `--threads=$LSB_DJOB_NUMPROC` command makes sure that Balmorel does not use more cores than defined in your job script (four in this case, due to `#BSUB -n 4`) +The bottom commands assumes that the job script is submitted from inside your Balmorel folder, and that your Balmorel project contains a "scenario1" scenario - see [how to create new scenarios](../get_started/scenario_setup.md). The `threads=$LSB_DJOB_NUMPROC` command makes sure that Balmorel does not use more cores than defined in your job script (four in this case, due to `#BSUB -n 4`) +:::{warning} +Please make sure to switch to the solver options file `cplex.op2`, by going into the `balgams.opt` file and setting `$Setglobal USEOPTIONFILE 2`. Otherwise CPLEX will overwrite the number of chosen threads and will ue more resources than requested. +::: ```bash #!/bin/sh ### General options @@ -48,7 +51,7 @@ export LD_LIBRARY_PATH=/appl/gams/47.6.0:$LD_LIBRARY_PATH # Go to model folder of your scenario - this assumes that the job script is at the same level of the Balmorel folder cd scenario1/model # Run Balmorel -gams Balmorel --threads=$LSB_DJOB_NUMPROC +gams Balmorel threads=$LSB_DJOB_NUMPROC ``` ## Submitting the Job from PuTTY From ebfe36072b7062e40c773f0a9a2f1a5ca812394b Mon Sep 17 00:00:00 2001 From: Tim Aidan Graulich <63345846+tgraulich@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:05:15 +0100 Subject: [PATCH 2/4] Update submitting_a_job.md --- base/documentation/gh-pages/running_on_hpc/submitting_a_job.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md b/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md index 4840d247..71f219ea 100644 --- a/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md +++ b/base/documentation/gh-pages/running_on_hpc/submitting_a_job.md @@ -11,9 +11,11 @@ Remember to study the log report after your job finishes, so you can be more acc After having transferred our Balmorel model through WinSCP (see [previous page](access.md)), we need to submit a job. This means creating a job script that asks for the right amount of memory usage and time before completion. This is done through a job script, illustrated in the code snippet below. We refer to [this general guide](https://www.hpc.dtu.dk/?page_id=1416) by DTU Computing Center for the exact explanations of the different elements. Note that the paths in the `export` commands are specific to our setup at DTU's clusters. The bottom commands assumes that the job script is submitted from inside your Balmorel folder, and that your Balmorel project contains a "scenario1" scenario - see [how to create new scenarios](../get_started/scenario_setup.md). The `threads=$LSB_DJOB_NUMPROC` command makes sure that Balmorel does not use more cores than defined in your job script (four in this case, due to `#BSUB -n 4`) + :::{warning} Please make sure to switch to the solver options file `cplex.op2`, by going into the `balgams.opt` file and setting `$Setglobal USEOPTIONFILE 2`. Otherwise CPLEX will overwrite the number of chosen threads and will ue more resources than requested. ::: + ```bash #!/bin/sh ### General options From 47176f74fb2cc7c16e9945cb93863ad873597186 Mon Sep 17 00:00:00 2001 From: Tim Aidan Graulich <63345846+tgraulich@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:06:15 +0100 Subject: [PATCH 3/4] Adding new cplex options file for runs on the HPC --- base/model/cplex.op2 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 base/model/cplex.op2 diff --git a/base/model/cplex.op2 b/base/model/cplex.op2 new file mode 100644 index 00000000..c5d2ff6d --- /dev/null +++ b/base/model/cplex.op2 @@ -0,0 +1,11 @@ +* Option file 2 for CPLEX solver for HPC runs. For possible options, see the GAMS Solver Manual. +* To use with CPLEX, set '$Setglobal USEOPTIONFILE 2' in balgams.opt. +* Do not change this file, it is predefined. +* To use other options with CPLEX, make and/or use some other file, see USEOPTIONFILE in balgams.opt. +* "LPmethod 4": Barrier method +* If memory tight, set the Threads parameter to 1. +* advind is set to 0 by default since for large problems a better performance has been experienced. If 0, the optimization will not use the previous solution to try to find the next run faster. + +LPmethod 4 +advind 0 +predual -1 From c89cf7864103aba09ab926ec9337c05841782eec Mon Sep 17 00:00:00 2001 From: Tim Aidan Graulich <63345846+tgraulich@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:07:17 +0100 Subject: [PATCH 4/4] Adding option for new cplex option file in balgams.opt --- base/model/balgams.opt | 1 + 1 file changed, 1 insertion(+) diff --git a/base/model/balgams.opt b/base/model/balgams.opt index 9158cab3..1553e485 100644 --- a/base/model/balgams.opt +++ b/base/model/balgams.opt @@ -152,6 +152,7 @@ option intVarUp = 0 $Setglobal USEOPTIONFILE 4 *!option 0 No option file is used. Note that not setting anything will generate an error. *!option 1 Use option file SolverName.opt. +*!option 2 Predefined, don't change. Used with CPLEX it opens cplex.op2 and sets 'LPmethod 4' to run barrior method. Also does not set any Threads option to allow running on HPC. *!option 4 Predefined, don't change. Used with CPLEX it opens cplex.op4 and sets 'LPmethod 4' to run barrior method. *!option 6 Predefined, don't change. Used with CPLEX it opens cplex.op6 and sets 'LPmethod 6' to run multiple methods in parallel.