Repository containing scripts and results of WNTR quantum experiments in Snellius
An example workflow is given for the Net0
network. The main idea:
-
Run your simulation and save relevant data
To run your
wntr-quantum
, we need to have aSLURM
script and a python script for your job; seerun_wntr_q.slurm
andNet0.py
insideNet0/vqls/
. Then,sbatch run_wntr_q.slurm
After the run is complete, the relevant data, e.g., classical and quantum flows and pressures as well as the network object, should be saved as pickle files.
-
Load data and make a separate analysis
Once all the results are saved, we can perform any analysis we want, without having to repeate any calculation. Note that, before doing anything else, we need to load our object instances from the pickle files, e.g.,
with open("quantum_res.pkl", "rb") as f: quantum_res = pickle.load(f)
An example can be found in the
analysis.py
script insideNet0/vqls/
that can be run as many times you want as:python analysis.py
Of course, this can be done in your local pc, provided that you push from Snellius the calculated results back to the main repo.
From your home, clone the repo:
git clone [email protected]:QuantumApplicationLab/wntr-quantum.git
Here, it might be the case that GitHub asks your credentials; add them as requested. Then,
cd wntr-quantum
Before installing the package, we need to create a python virtual environment (avoid using conda in Snellius):
# load python module
module load 2023
module load Python/3.11.3-GCCcore-12.3.0
# create virtual environment
python -m venv .venv
Finally, activate the environment and install wntr-quantum
as usual:
source .venv/bin/activate
pip install -e .
Note that you don't need to activate your environment every time you log in to Snellius. This will be done from the SLURM
submission scripts. You need to do so, however, if you want to perform any analysis of your calculation as discussed above.
As we will be using wntr-quantum
with epanet-quantum
, you need also to compile locally this custom EPANET code that can be found at: https://github.com/QuantumApplicationLab/EPANET.
You can do this with your activated python environment by simply following the instructions given in https://github.com/QuantumApplicationLab/wntr-quantum.
Note that, we don't need to set up the environment variables EPANET_TMP
and EPANET_QUANTUM
every time. They will also be set in from SLURM
submission scripts.