Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# name of base pypsa network
scenario:
name: "nh"
name: "or"

model_options:
ch4: false # if true, ch4 counts against emission budget. Else, ch4 tracked, but not counted against budget.
Expand All @@ -11,8 +11,8 @@ model_options:

# Any additional files needed from pypsa-usa for constraints
pypsa_usa:
network: "nh/elec_s20_c1m_ec_lv1.0_3h_E-G.nc"
pop_layout: "nh/pop_layout_elec_s20_c1m.csv"
network: "or/elec_s30_c3m_ec_lv1.0_3h_E-G.nc"
pop_layout: "or/pop_layout_elec_s30_c3m.csv"
era5_year: 2018

# write out GSA associated metadata with each run
Expand Down Expand Up @@ -51,27 +51,27 @@ uncertainity:
# sobol -> N=2^m (m is a power of 2) -> N ~ 10d
# lhs -> N = r -> N ~ > 10d
sample: lhs # (lhs|sobol)
replicates: 1100
replicates: 1400
parameters: # naems or groups
- capex_wind
- eff_trn_lpg
- elec_export_price
- elec_import_price
- elec_import_rec_price
- elec_trade_flow
- ev_policy
- gwp
- lpg_cost
- ng_leakage_downstream
- ng_marginal_cost_export
- ng_marginal_cost_import
- rps

- ptc_solar
results: config/results.csv # results to extract from ua
plots: config/plots_ua.csv

# Choose a solver
solver:
name: gurobi # (cbc|gurobi|cplex|highs)
options: gurobi-default # see solving config
name: cplex # (cbc|gurobi|cplex|highs)
options: cplex-default # see solving config



Expand Down
10 changes: 3 additions & 7 deletions config/solving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ solving:
threads: 8
Seed: 123
gurobi-fallback: # Use gurobi defaults
name: gurobi
crossover: 0
method: 2 # barrier
BarHomogeneous: 1 # Use homogeneous barrier if standard does not converge
Expand All @@ -65,13 +64,10 @@ solving:
Seed: 123
threads: 8
cplex-default:
threads: 4
threads: 8
lpmethod: 4 # barrier
solutiontype: 2 # non basic solution, ie no crossover
barrier.convergetol: 1.e-5
feasopt.tolerance: 1.e-6
barrier.convergetol: 1.e-3
feasopt.tolerance: 1.e-3
cbc-default: {} # Used in CI
glpk-default: {} # Used in CI

mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2
walltime: "12:00:00"
23 changes: 23 additions & 0 deletions hpc/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
. "$HOME/.cargo/env"

# Path for custom modules
export MODULEPATH=$HOME/modulefiles:$MODULEPATH

# Path for CPLEX executable
export CPLEX_STUDIO_DIR=/home/trevor23/projects/def-tniet-ab/trevor23/cplex_2212
export PATH=$CPLEX_STUDIO_DIR/cplex/bin/x86-64_linux:$PATH
export LD_LIBRARY_PATH=$CPLEX_STUDIO_DIR/cplex/bin/x86-64_linux:$LD_LIBRARY_PATH

# for python location
export CPLEX_STUDIO_BINARIES=$CPLEX_STUDIO_DIR/cplex/bin/x86-64_linux
63 changes: 63 additions & 0 deletions hpc/load_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

# ------------------------------
# Load Alliance HPC modules
# ------------------------------
module load StdEnv/2023
module load openmpi/4.1.5
# module load netcdf-mpi/4.9.2
module load netcdf
# module load mpi4py/3.1.6
module load scipy-stack
module load arrow
module load ipopt
# module load gurobi/11.0.3 # uncomment if using HPC license
module load mycplex/22.1.2
# must load python after mpi
module load python/3.11


# ------------------------------
# Address MPI version issue
# ------------------------------
export OMPI_MCA_ess=^pmi
export OMPI_MCA_plm=isolated
export OMPI_MCA_pml=ob1
export OMPI_MCA_rmaps_base_oversubscribe=1
export OMPI_MCA_btl=^openib

# Prevent ORTE "session_dir" crashes
export OMPI_MCA_orte_base_help_aggregate=0

# ------------------------------
# PROJ fix for PyPSA / pyproj
# ------------------------------

module load proj
export PROJ_DATA="$EBROOTPROJ/share/proj"

# ------------------------------
# Activate Python virtual environment
# ------------------------------
source ~/envs/gsa/bin/activate

# ------------------------------
# Set cplex location
# ------------------------------
# docplex config --upgrade /project/6060200/trevor23/cplex

# ------------------------------
# Enable Rust/Cargo (needed for polars / pypsa)
# ------------------------------
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi

# ------------------------------
# Optional: environment variables for Gurobi
# (needed only if Gurobi complains)
# ------------------------------
# export GUROBI_HOME=$EBROOTGUROBI
# export GRB_LICENSE_FILE=$HOME/gurobi.lic
# export PATH=$GUROBI_HOME/bin:$PATH
# export LD_LIBRARY_PATH=$GUROBI_HOME/lib:$LD_LIBRARY_PATH
64 changes: 64 additions & 0 deletions hpc/modulefiles/mycplex/22.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#%Module1.0####
##
## cplex
##
proc ModulesHelp { } {
global cplexversion

puts stderr "\tIBM ILOG cplex "
puts stderr "\tThis module provides configuration for cplex, concert, cpoptimizer and opl"
}

module-whatis "IBM ILOG cplex (cplex, concert, cpoptimizer, opl). This version doesn't ask for a licence file."

# for Tcl script use only
set cplexversion 2211
set studio_root /project/6060200/trevor23/cplex
set cplexroot $studio_root/cplex
set concertroot $studio_root/concert
set oplroot $studio_root/opl
set cpoptimizerroot $studio_root/cpoptimizer


set cplexbin x86-64_linux
set cplexlib $cplexbin/static_pic
set concertbin x86-64_linux
set concertlib $concertbin/static_pic
set oplbin x86-64_linux
set opllib $oplbin/static_pic
set cpoptimizerbin x86-64_linux
set cpoptimizerlib $cpoptimizerbin/static_pic


prepend-path PATH $cplexroot/bin/$cplexbin
prepend-path PATH $oplroot/bin/$oplbin
prepend-path PATH $cpoptimizerroot/bin/$cpoptimizerbin

prepend-path CPATH $cplexroot/include
prepend-path CPATH $concertroot/include
prepend-path CPATH $oplroot/include
prepend-path CPATH $cpoptimizerroot/include

prepend-path -d " " CPATH_EXPANDED -I$cplexroot/include
prepend-path -d " " CPATH_EXPANDED -I$concertroot/include
prepend-path -d " " CPATH_EXPANDED -I$oplroot/include
prepend-path -d " " CPATH_EXPANDED -I$cpoptimizerroot/include

prepend-path LIBRARY_PATH $cplexroot/lib/$cplexlib
prepend-path LIBRARY_PATH $concertroot/lib/$concertlib
prepend-path LIBRARY_PATH $oplroot/lib/$opllib
prepend-path LIBRARY_PATH $oplroot/bin/x86-64_linux/
prepend-path LIBRARY_PATH $cpoptimizerroot/lib/$cpoptimizerlib

prepend-path -d " " LIBRARY_PATH_EXPANDED -L$cplexroot/lib/$cplexlib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$concertroot/lib/$concertlib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$oplroot/lib/$opllib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$oplroot/bin/x86-64_linux/
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$cpoptimizerroot/lib/$cpoptimizerlib

prepend-path LD_LIBRARY_PATH $cplexroot/bin/$cplexbin
prepend-path LD_LIBRARY_PATH $oplroot/bin/$oplbin

prepend-path CLASSPATH $cplexroot/lib/cplex.jar
prepend-path MATLABPATH $cplexroot/matlab
prepend-path STUDIO_ROOT $studio_root
64 changes: 64 additions & 0 deletions hpc/modulefiles/mycplex/22.1.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#%Module1.0####
##
## cplex
##
proc ModulesHelp { } {
global cplexversion

puts stderr "\tIBM ILOG cplex "
puts stderr "\tThis module provides configuration for cplex, concert, cpoptimizer and opl"
}

module-whatis "IBM ILOG cplex (cplex, concert, cpoptimizer, opl). This version doesn't ask for a licence file."

# for Tcl script use only
set cplexversion 2212
set studio_root /home/trevor23/projects/def-tniet-ab/trevor23/cplex_2212
set cplexroot $studio_root/cplex
set concertroot $studio_root/concert
set oplroot $studio_root/opl
set cpoptimizerroot $studio_root/cpoptimizer


set cplexbin x86-64_linux
set cplexlib $cplexbin/static_pic
set concertbin x86-64_linux
set concertlib $concertbin/static_pic
set oplbin x86-64_linux
set opllib $oplbin/static_pic
set cpoptimizerbin x86-64_linux
set cpoptimizerlib $cpoptimizerbin/static_pic


prepend-path PATH $cplexroot/bin/$cplexbin
prepend-path PATH $oplroot/bin/$oplbin
prepend-path PATH $cpoptimizerroot/bin/$cpoptimizerbin

prepend-path CPATH $cplexroot/include
prepend-path CPATH $concertroot/include
prepend-path CPATH $oplroot/include
prepend-path CPATH $cpoptimizerroot/include

prepend-path -d " " CPATH_EXPANDED -I$cplexroot/include
prepend-path -d " " CPATH_EXPANDED -I$concertroot/include
prepend-path -d " " CPATH_EXPANDED -I$oplroot/include
prepend-path -d " " CPATH_EXPANDED -I$cpoptimizerroot/include

prepend-path LIBRARY_PATH $cplexroot/lib/$cplexlib
prepend-path LIBRARY_PATH $concertroot/lib/$concertlib
prepend-path LIBRARY_PATH $oplroot/lib/$opllib
prepend-path LIBRARY_PATH $oplroot/bin/x86-64_linux/
prepend-path LIBRARY_PATH $cpoptimizerroot/lib/$cpoptimizerlib

prepend-path -d " " LIBRARY_PATH_EXPANDED -L$cplexroot/lib/$cplexlib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$concertroot/lib/$concertlib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$oplroot/lib/$opllib
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$oplroot/bin/x86-64_linux/
prepend-path -d " " LIBRARY_PATH_EXPANDED -L$cpoptimizerroot/lib/$cpoptimizerlib

prepend-path LD_LIBRARY_PATH $cplexroot/bin/$cplexbin
prepend-path LD_LIBRARY_PATH $oplroot/bin/$oplbin

prepend-path CLASSPATH $cplexroot/lib/cplex.jar
prepend-path MATLABPATH $cplexroot/matlab
prepend-path STUDIO_ROOT $studio_root
Loading