Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
software:gurobi:caviness [2020-04-16 19:07] – [MPI Python Environment] anita | software:gurobi:caviness [2021-03-12 14:04] – anita | ||
---|---|---|---|
Line 131: | Line 131: | ||
The below steps are based on copying a template job script and modifying '' | The below steps are based on copying a template job script and modifying '' | ||
- | <note tip>It is a good idea to periodically check in ''/ | + | <note tip>It is a good idea to periodically check in ''/ |
To start, use VALET to load Gurobi and Anaconda. Once those two packages are loaded, the Gurobi Anaconda environment will need to be activated. After the Gurobi Anaconda environment is activated, then the python script that uses Gurobi can be called and ran. After the python script has completed, then the Gurobi Anaconda environment will be need to be deactivated. | To start, use VALET to load Gurobi and Anaconda. Once those two packages are loaded, the Gurobi Anaconda environment will need to be activated. After the Gurobi Anaconda environment is activated, then the python script that uses Gurobi can be called and ran. After the python script has completed, then the Gurobi Anaconda environment will be need to be deactivated. | ||
Line 152: | Line 152: | ||
source activate ~${USER}/ | source activate ~${USER}/ | ||
- | python | + | python3 |
source deactivate | source deactivate | ||
Line 171: | Line 171: | ||
source activate ~${USER}/ | source activate ~${USER}/ | ||
- | python | + | python3 |
source deactivate | source deactivate | ||
Line 256: | Line 256: | ||
</ | </ | ||
- | Now, create a VALET package to handle the environment setup/ | + | Now, create a VALET package to handle the environment setup/ |
<code bash> | <code bash> | ||
Line 278: | Line 278: | ||
</ | </ | ||
- | <note important> | + | <note important> |
Check if the '' | Check if the '' | ||
Line 296: | Line 296: | ||
</ | </ | ||
- | Thereafter, here is a simple test using VALET to load the environment | + | Thereafter, here is a simple test using VALET to load the environment, test we have the correct version of python3, loading python3 and importing the packages gurobipy and mpi4py, exiting python3, and deactivating the environment: |
<code bash> | <code bash> | ||
- | [(it_css: | + | [(it_css: |
Adding dependency `libfabric/ | Adding dependency `libfabric/ | ||
Adding dependency `openmpi/ | Adding dependency `openmpi/ | ||
Line 305: | Line 305: | ||
Adding dependency `gurobi/ | Adding dependency `gurobi/ | ||
Adding package `gurobi-env/ | Adding package `gurobi-env/ | ||
- | |||
(/ | (/ | ||
/ | / | ||
+ | (/ | ||
+ | Python 3.7.7 (default, Mar 26 2020, 15:48:22) | ||
+ | [GCC 7.3.0] :: Anaconda, Inc. on linux | ||
+ | Type " | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | (/ | ||
+ | [(it_css: | ||
</ | </ | ||