| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
|
|
| _SLIM_ROOT="/egr/research-slim/ghoshavr/llm-reasoning-logic-puzzles" |
| _SLIM_RUN="${_SLIM_ROOT}/sudoku-code/multicandidate_run" |
| _SLIM_PY="/egr/research-slim/ghoshavr/conda-envs/logicpuzzles/bin/python" |
| _SLIM_CUDNN="/egr/research-slim/ghoshavr/conda-envs/logicpuzzles/lib/python3.9/site-packages/nvidia/cudnn/lib" |
|
|
| |
| _BERK_RUN_SCRATCH="/scratch/users/gatmiry/llm-reasoning-logic-puzzles/sudoku-code/multicandidate_run" |
| _BERK_RUN="${HOME}/llm-reasoning-logic-puzzles/sudoku-code/multicandidate_run" |
|
|
| |
| if [ -n "${SUDOKU_RUN_DIR:-}" ]; then |
| RUN_DIR="${SUDOKU_RUN_DIR}" |
| elif [ -d "${_SLIM_RUN}" ]; then |
| RUN_DIR="${_SLIM_RUN}" |
| elif [ -d "${_BERK_RUN_SCRATCH}" ]; then |
| RUN_DIR="${_BERK_RUN_SCRATCH}" |
| else |
| RUN_DIR="${_BERK_RUN}" |
| fi |
|
|
| if [ -n "${SUDOKU_PY:-}" ]; then |
| PY="${SUDOKU_PY}" |
| elif [ -x "${_SLIM_PY}" ]; then |
| PY="${_SLIM_PY}" |
| else |
| |
| for _cand in \ |
| "${HOME}/miniconda3/envs/logic_puzzles/bin/python" \ |
| "${HOME}/miniconda3/envs/logicpuzzles/bin/python" \ |
| "${HOME}/anaconda3/envs/logic_puzzles/bin/python" \ |
| "${HOME}/anaconda3/envs/logicpuzzles/bin/python" \ |
| "${HOME}/.conda/envs/logic_puzzles/bin/python" \ |
| "${HOME}/.conda/envs/logicpuzzles/bin/python" \ |
| "/scratch/users/gatmiry/conda/envs/logic_puzzles/bin/python" \ |
| "/scratch/users/gatmiry/conda/envs/logicpuzzles/bin/python"; do |
| if [ -x "${_cand}" ]; then |
| PY="${_cand}" |
| break |
| fi |
| done |
| if [ -z "${PY:-}" ]; then |
| if command -v python >/dev/null 2>&1; then |
| PY="$(command -v python)" |
| else |
| echo "ERROR: no Python found. Create env: conda env create -f ~/llm-reasoning-logic-puzzles/environment.yml -n logic_puzzles" >&2 |
| echo " then: export SUDOKU_PY=\$HOME/miniconda3/envs/logic_puzzles/bin/python" >&2 |
| return 1 2>/dev/null || exit 1 |
| fi |
| fi |
| fi |
|
|
| if [ -n "${SUDOKU_CUDNN_LIB:-}" ]; then |
| CUDNN_LIB="${SUDOKU_CUDNN_LIB}" |
| elif [ -d "${_SLIM_CUDNN}" ]; then |
| CUDNN_LIB="${_SLIM_CUDNN}" |
| else |
| |
| _py_root="$(cd "$(dirname "${PY}")/.." && pwd)" |
| _cudnn_guess="${_py_root}/lib/python3.9/site-packages/nvidia/cudnn/lib" |
| if [ -d "${_cudnn_guess}" ]; then |
| CUDNN_LIB="${_cudnn_guess}" |
| else |
| CUDNN_LIB="" |
| fi |
| fi |
|
|
| export RUN_DIR PY CUDNN_LIB |
| unset _SLIM_ROOT _SLIM_RUN _SLIM_PY _SLIM_CUDNN _BERK_RUN _cand _py_root _cudnn_guess |
|
|