Skip to content

Run on a linux server

Raphaël Payet-Burin edited this page Mar 4, 2022 · 12 revisions

Setting up WHAT-IF on a (linux) server MIT and DTU server addresses are given as examples, as well as file directories, you need to replace these by your own

Connect to server

#open command prompt on windows

ssh [email protected]

#move to home directory

cd /home/rapy

Transfer files using scp:

#On the local window - go to the local what_if directory

cd C://Users//rapy//OneDrive - COWI//WHAT_IF

all files

scp -r bin [email protected]://home//rapy//WHAT_IF

scp -r Data [email protected]://home//rapy//WHAT_IF

specific files

scp Data//MainFile.xlsx [email protected]://home//rapy//WHAT_IF//Data

scp Data//WaterModule.xlsx [email protected]://home//rapy//WHAT_IF//Data

scp Data//EnergyModule.xlsx [email protected]://home//rapy//WHAT_IF//Data

combined:

scp WHATIFmit.sh WHATIF_scenario.py WHATIF_main.py [email protected]://home//rapy//WHAT_IF

from server to computer

scp -r [email protected]://zhome//8a//f//104114//CoinIpopt//ThirdParty//HSL//coinhsl solver_libraries

scp -r [email protected]://home//rapy//WHAT_IF//Results//modelopt_renew_17Aug Results

scp -r [email protected]://home//rapy//WHAT_IF//bin//hydroeconomic_optimization.py bin

Install miniconda:

https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html

  1. Download
  2. transfer to server:

scp Miniconda3-latest-Linux-x86_64.sh [email protected]://home//rapy

  1. install:

bash Miniconda3-latest-Linux-x86_64.sh

Install the WHAT-IF environment:

conda config --add channels conda-forge

conda create -n WHATIF_py37 python=3.7.3

conda install -n WHATIF_py37 openpyxl xlsxwriter xlrd pyomo pandas numpy multiprocess ipopt scipy

conda install -n WHATIF_py37 -c ibmdecisionoptimization docplex

Submit jobs (svante MIT server):

sbatch WHATIFmit.sh

squeue

sinfo

Submit jobs (DTU hpc server):

bsub<whatif.sh

bstat

On a windows server

On a windows server it seems pandas has troubles importing numpy, if installed through conda/mininconda, you can do the following, after activating the conda environment, (dark magic)

pip install numpy

pip uninstall numpy

pip install numpy