Skip to content

Commit

Permalink
BUG: fix issue in example slurm job script. Modify 'astro-strong' par…
Browse files Browse the repository at this point in the history
…am spaces
  • Loading branch information
lzkelley committed Apr 15, 2024
1 parent f53dcce commit de8ea7b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
21 changes: 21 additions & 0 deletions holodeck/librarian/param_spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def __init__(self, log=None, nsamples=None, sam_shape=None, seed=None):
# Hardening model (phenom 2PL)
PD_Uniform("hard_time", 0.1, 11.0, default=3.0), # [Gyr]
PD_Uniform("hard_gamma_inner", -2.0, +0.0, default=-1.0),
PD_Uniform("hard_rchar", 2.0, 20.0, default=10.0), # [pc]

# GSMF
PD_Normal('gsmf_log10_phi_one_z0', -2.383, 0.028), # - 2.383 ± 0.028
Expand Down Expand Up @@ -332,6 +333,25 @@ def __init__(self, log=None, nsamples=None, sam_shape=None, seed=None):
# Hardening model (phenom 2PL)
PD_Uniform("hard_time", 0.1, 11.0, default=3.0), # [Gyr]
PD_Uniform("hard_gamma_inner", -2.0, +0.0, default=-1.0),
PD_Uniform("hard_rchar", 2.0, 20.0, default=10.0), # [pc]
]
_Param_Space.__init__(
self, parameters,
log=log, nsamples=nsamples, sam_shape=sam_shape, seed=seed,
)
return


class PS_Astro_Strong_Hard_All(_PS_Astro_Strong):

def __init__(self, log=None, nsamples=None, sam_shape=None, seed=None):
parameters = [
# Hardening model (phenom 2PL)
PD_Uniform("hard_time", 0.1, 11.0, default=3.0), # [Gyr]
PD_Uniform("hard_gamma_inner", -2.0, +0.0, default=-1.0),
PD_Uniform("hard_rchar", 2.0, 20.0, default=10.0), # [pc]
PD_Uniform_Log("hard_sepa_init", 1e3, 1e4, default=1e4), # [pc]
PD_Uniform("hard_gamma_outer", 0.0, +2.5, default=0.0),
]
_Param_Space.__init__(
self, parameters,
Expand Down Expand Up @@ -424,6 +444,7 @@ def __init__(self, log=None, nsamples=None, sam_shape=None, seed=None):
_param_spaces_dict = {
'PS_Astro_Strong_All': PS_Astro_Strong_All,
'PS_Astro_Strong_Hard': PS_Astro_Strong_Hard,
'PS_Astro_Strong_Hard_All': PS_Astro_Strong_Hard_All,
'PS_Astro_Strong_GSMF': PS_Astro_Strong_GSMF,
'PS_Astro_Strong_GMR': PS_Astro_Strong_GMR,
'PS_Astro_Strong_MMBulge_BFrac': PS_Astro_Strong_MMBulge_BFrac,
Expand Down
9 changes: 7 additions & 2 deletions scripts/run_holodeck_lib_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,30 @@
# The library generation is performed using the `holodeck.librarian.lib_gen` script.
# When holodeck is installed, this is aliased to the command-line function `holodeck_lib_gen`.
# The following two commands should be identical:
#
# python -m holodeck.librarian.lib_gen <ARGS>
# holodeck_lib_gen <ARGS>
#
# The library generation script is parallelized using MPI (specifically mpi4py in python).
# The actual run command can be very simple, for example:
#
# mpirun -np 16 holodeck_lib_gen -n 64 -r 100 --gwb --ss --params PS_Classic_Phenom ./output/
#
# When running on a remote server with a job scheduler (e.g. SLURM), things can be a bit more
# complicated. Example SLURM configuration is included below, but if you're running on a personal
# computer you can ignore these elements.
#
# Remember to use `nohup` and `&` to run in the background on remote server, so that it's not killed
# when you logout.
# when you logout, e.g.
#
# nohup mpirun -np 16 holodeck_lib_gen -n 64 -r 100 --gwb --ss --params PS_Classic_Phenom ./output/ &
#
# ------------------
# Luke Zoltan Kelley
# [email protected]
# ==================================================================================================


# ==== SLURM job scheduler configuration ====
# NOTE: SLURM uses a single '#' to denote its configuration. Multiple '#' marks are ignored.

Expand Down Expand Up @@ -136,7 +141,7 @@ echo -e "Running mpirun $(date +'%Y-%m-%d|%H:%M:%S')\n"
echo ""

# this is the actual call to run holodeck
mpirun -np $NTASKS $COMMAND $SPACE $OUTPUT -n $NSAMPS -r $NREALS -f $NFREQS $ARGS 1> $LOG_OUT 2> $LOG_ERR &
mpirun -np $NTASKS $COMMAND $SPACE $OUTPUT -n $NSAMPS -r $NREALS -f $NFREQS $ARGS 1> $LOG_OUT 2> $LOG_ERR

echo ""
echo -e "Completed python script $(date +'%Y-%m-%d|%H:%M:%S')\n"
Expand Down

0 comments on commit de8ea7b

Please sign in to comment.