Skip to content

Commit

Permalink
work on better sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschwanden committed Nov 21, 2024
1 parent cd1adc5 commit 768b235
Show file tree
Hide file tree
Showing 15 changed files with 749 additions and 797 deletions.
4 changes: 2 additions & 2 deletions hindcasts/hindcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
dest="osize",
choices=["small", "medium", "big", "big_2d", "custom", "none"],
help="output size type",
default="custom",
default="none",
)
parser.add_argument(
"-s",
Expand Down Expand Up @@ -368,7 +368,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
"-p",
periodicity,
"-d",
"2008-01-01",
"1980-01-01",
pism_timefile,
]
sub.call(tm_cmd)
Expand Down
38 changes: 38 additions & 0 deletions pism_ragis/computing.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,18 @@ def list_bed_types():
},
}

systems["stampede3"] = {
"mpido": "ibrun",
"submit": "sbatch",
"work_dir": "SLURM_SUBMIT_DIR",
"job_id": "SLURM_JOBID",
"queue": {
"small": 56,
"normal": 56,
"development": 56,
},
}

systems["frontera"] = {
"mpido": "ibrun",
"submit": "sbatch",
Expand Down Expand Up @@ -826,6 +838,30 @@ def list_bed_types():
"""

systems["stampede3"][
"header"
] = """#!/bin/sh
#SBATCH -n {cores}
#SBATCH -N {nodes}
#SBATCH --time={walltime}
#SBATCH -p {queue}
#SBATCH --mail-type=BEGIN
#SBATCH --mail-type=END
#SBATCH --mail-type=FAIL
#SBATCH --output=pism.%j
module list
umask 007
cd $SLURM_SUBMIT_DIR
ulimit -l unlimited
ulimit -s unlimited
ulimit
"""

systems["frontera"][
"header"
] = """#!/bin/sh
Expand Down Expand Up @@ -1144,6 +1180,8 @@ def make_batch_post_header(system):
"chinook-rl8-40",
"chinook-rl8-24",
"stampede2",
"stampede3",
"frontera",
):
post_header = post_headers["slurm"] + v
else:
Expand Down
6 changes: 3 additions & 3 deletions uq/draw_ragis_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
default="ragis",
)
parser.add_argument(
"--calc_second_order",
"--second_order",
action="store_true",
help="""Second order interactions.""",
default=False,
Expand All @@ -216,7 +216,7 @@
)
options = parser.parse_args()
n_draw_samples = options.n_samples
calc_second_order = options.calc_second_order
calc_second_order = options.second_order
method = options.method
outfile = options.OUTFILE[-1]
distribution_name = options.distribution
Expand All @@ -237,7 +237,7 @@
# Generate uniform samples (i.e. one unit hypercube)
if method == "sobol":
unif_sample = sobol.sample(
problem, n_draw_samples, calc_second_order=calc_second_order
problem, n_draw_samples, calc_second_order=calc_second_order, seed=42
)
else:
unif_sample = lhs(len(keys_prior), n_draw_samples)
Expand Down
17 changes: 0 additions & 17 deletions uq/ensemble_gris_ragis_w_posterior_lhs_10.csv

This file was deleted.

Loading

0 comments on commit 768b235

Please sign in to comment.