All commands below are to be run on your local computer. If you use Windows, make sure you work in a BASH shell prompt, e.g. via the Windows Subsystem for Linux.
- Clone this repo, e.g. in
~/dotfiles/wbashcd ~/dotfiles git clone git@github.com:witch-team/wbash.git
- Source
wbash.shin your~/.bashrcecho 'source ~/dotfiles/wbash/wbash.sh' >> ~/.bashrc
Open a new shell to make the new commands available.
- Follow the setup wizard:
wsetup-wizard
export WHOST=zeus
export WHOST=athena
export WHOST=local3 hosts are supported: zeus and athena will run the code on the respective supercomputer. local will run code locally on your computer. You can change the default (currently zeus) at the beginning of wbash.sh.
The directory used on WHOST depends on
- WHOST
- your current local directory name (WD)
- the git branch you are in (BRANCH)
as follows:
| WHOST | WD | BRANCH | work dir on WHOST |
|---|---|---|---|
| local | current dir | ||
| athena/zeus | witch-BRANCH | WHOST:~/work/witch-BRANCH | |
| witch-master | WHOST:~/work/witch | ||
| witch | BRANCH==master | WHOST:~/work/witch | |
| witch | BRANCH!=master | WHOST:~/work/witch-BRANCH |
git clone git@github.com:witch-team/witch.git
cd witch
wsetupThis will:
- clone
../witch-dataif it does not exist, pull it, then sync it to WHOST - clone
../witchtoolsif it does not exist, pull it, then sync it to WHOST - pull current dir, then sync it to WHOST
- run
tools/R/setup.Ron WHOST, which will install basic R dependencies
To download the remote folder xxx from the remost working dir, use:
wdown xxxUse wdown -a xxx to download also the all_data_temp*.gdx.
To upload the local folder yyy, use:
wup yyyBy default:
- w/o arguments the current dir is uploaded;
- only versioned files are uploaded; to include non-git files, use
-abeforeyyy; - target folder name on WHOST is the same, to use a different name, e.g.
zzz, use-t zzzbeforeyyy.
To generate data_witch17:
wdataThis will:
- sync
../witch-dataand./to host - run
translate_witch_data.Rinteractively (drop-ito launch a job non-interactively) - download the resulting
data_witch17folder (needs to be done manually if non-interactive).
Use -r xxx to use regional setup xxx.
wrun -j calib -i -cThis will:
- sync
../witch-dataand./to host - submit a job on WHOST named
calibthat runsgams run_witch.gmsset up for calibration - at the end download
data_witch17and acalibfolder with these contents:calib ├── calib.err ├── calib.lst ├── calib.out ├── errors_calib.txt └── results_calib.gdx
File names follow the job name (i.e. the one specified after -j).
Drop the -i after wrun (this won’t affect local runs).
To list all running jobs:
wcheckTo attach to the console output of a running job named bau:
wcheck bauTo check the errors_*.txt file of job bau:
werr bauTo run a bau using calib/results_calib.gdx as starting gdx:
wrun -j bau -s calibNotice that it’s enough to specify calib. This will be translated into calib/results_calib. You can also specify a local gdx file after -s. If so, this will be moved to the current folder, synced to host, and used as a startgdx. The same mechanism holds for:
- -f
- for gdxfix
- -b
- for baugdx
Add -S for startboost.
To pass double-dash parameters to gams, just specify them at the end:
wrun -j wb600 --policy=innopaths --scen=wb600wrun -j calib_xxx -CNotice the upper-case -C instead of -c. To later use this calibration in a bau for example, run:
wrun -j bau_xxx -i -u calib_xxxThis will also set start and bau gdx to calib_xxx/results_calib_xxx.
If the run was named bau, use:
wshow bauIf the run was named ctax, use:
wdb ctaxAfter running the command above, the ctax/ local folder will be updated with the generated db files. Use -o switch to specify a gdx out db name, and -b to specify a bau gdx different than bau/results_bau.
To run a command, e.g. ls -clt, in WHOST working dir, use:
wssh ls -clt