Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
software:gurobi:caviness [2020-04-13 17:30] – [Serial or Threaded Python] anita | software:gurobi:caviness [2022-05-05 11:49] – anita | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Gurobi on Caviness ====== | ||
- | <code bash> | ||
- | [traine@login00 ~]$ vpkg_versions gurobi | ||
- | Available versions in package (* = default version): | ||
- | |||
- | [/ | ||
- | gurobi | ||
- | * 9.0.1 release 9.0.1 for Linux | ||
- | </ | ||
- | |||
- | ===== Serial or Threaded Python Environment ===== | ||
- | |||
- | ==== Adding Gurobi to a Anaconda Environment === | ||
- | |||
- | Based on the instructions on Gurobi' | ||
- | |||
- | The workgroup '' | ||
- | |||
- | <code bash> | ||
- | [traine@login00 ~]$ workgroup -g it_css | ||
- | [(it_css: | ||
- | Adding package `gurobi/ | ||
- | [(it_css: | ||
- | Adding package `anaconda/ | ||
- | [(it_css: | ||
- | [(it_css: | ||
- | Solving environment: | ||
- | |||
- | |||
- | ==> WARNING: A newer version of conda exists. <== | ||
- | current version: 4.5.11 | ||
- | latest version: 4.8.3 | ||
- | |||
- | Please update conda by running | ||
- | |||
- | $ conda update -n base -c defaults conda | ||
- | |||
- | |||
- | |||
- | ## Package Plan ## | ||
- | |||
- | environment location: / | ||
- | |||
- | |||
- | Proceed ([y]/n)? y | ||
- | Preparing transaction: | ||
- | Verifying transaction: | ||
- | Executing transaction: | ||
- | # | ||
- | # To activate this environment, | ||
- | # > source activate / | ||
- | # | ||
- | # To deactivate an active environment, | ||
- | # > source deactivate | ||
- | # | ||
- | |||
- | [(it_css: | ||
- | (/ | ||
- | Solving environment: | ||
- | |||
- | |||
- | ==> WARNING: A newer version of conda exists. <== | ||
- | current version: 4.5.11 | ||
- | latest version: 4.8.3 | ||
- | |||
- | Please update conda by running | ||
- | |||
- | $ conda update -n base -c defaults conda | ||
- | |||
- | |||
- | |||
- | ## Package Plan ## | ||
- | |||
- | environment location: / | ||
- | |||
- | added / updated specs: | ||
- | - gurobi | ||
- | - joblib | ||
- | - pandas | ||
- | - scipy | ||
- | |||
- | |||
- | The following NEW packages will be INSTALLED: | ||
- | |||
- | _libgcc_mutex: | ||
- | blas: | ||
- | ca-certificates: | ||
- | certifi: | ||
- | gurobi: | ||
- | intel-openmp: | ||
- | joblib: | ||
- | ld_impl_linux-64: | ||
- | libedit: | ||
- | libffi: | ||
- | libgcc-ng: | ||
- | libgfortran-ng: | ||
- | libstdcxx-ng: | ||
- | mkl: 2020.0-166 | ||
- | mkl-service: | ||
- | mkl_fft: | ||
- | mkl_random: | ||
- | ncurses: | ||
- | numpy: | ||
- | numpy-base: | ||
- | openssl: | ||
- | pandas: | ||
- | pip: 20.0.2-py37_1 | ||
- | python: | ||
- | python-dateutil: | ||
- | pytz: | ||
- | readline: | ||
- | scipy: | ||
- | setuptools: | ||
- | six: 1.14.0-py37_0 | ||
- | sqlite: | ||
- | tk: | ||
- | wheel: | ||
- | xz: | ||
- | zlib: | ||
- | |||
- | Proceed ([y]/n)? y | ||
- | |||
- | Preparing transaction: | ||
- | Verifying transaction: | ||
- | Executing transaction: | ||
- | [(it_css: | ||
- | </ | ||
- | ==== Running a Gurobi Serial or Threaded Job ==== | ||
- | |||
- | The below steps are based on copying a template job script and modifying '' | ||
- | |||
- | <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. | ||
- | |||
- | |||
- | === Example serial.qs script === | ||
- | <code bash> | ||
- | # | ||
- | # Do general job environment setup: | ||
- | # | ||
- | . / | ||
- | |||
- | # | ||
- | # [EDIT] Add your script statements hereafter, or execute a script or program | ||
- | # using the srun command. | ||
- | # | ||
- | |||
- | vpkg_require gurobi | ||
- | vpkg_require anaconda/ | ||
- | |||
- | source activate ~${USER}/ | ||
- | python serial_test.py | ||
- | source deactivate | ||
- | |||
- | </ | ||
- | === Example threads.qs script === | ||
- | <code bash> | ||
- | # | ||
- | # Do standard OpenMP environment setup: | ||
- | # | ||
- | . / | ||
- | |||
- | # | ||
- | # [EDIT] Execute your OpenMP/ | ||
- | # | ||
- | |||
- | vpkg_require gurobi | ||
- | vpkg_require anaconda/ | ||
- | |||
- | source activate ~${USER}/ | ||
- | python sample_parallel.py | ||
- | source deactivate | ||
- | |||
- | </ | ||
- | |||
- | ===== MPI ===== |