From de8ea7b03555f997d1bc71ef97376d7cfa6a85f8 Mon Sep 17 00:00:00 2001 From: Luke Zoltan Kelley Date: Mon, 15 Apr 2024 15:13:22 -0700 Subject: [PATCH] BUG: fix issue in example slurm job script. Modify 'astro-strong' param spaces --- holodeck/librarian/param_spaces.py | 21 +++++++++++++++++++++ scripts/run_holodeck_lib_gen.sh | 9 +++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/holodeck/librarian/param_spaces.py b/holodeck/librarian/param_spaces.py index 6e14f5b3..27a897ea 100644 --- a/holodeck/librarian/param_spaces.py +++ b/holodeck/librarian/param_spaces.py @@ -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 @@ -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, @@ -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, diff --git a/scripts/run_holodeck_lib_gen.sh b/scripts/run_holodeck_lib_gen.sh index 1b37d50c..e341c632 100755 --- a/scripts/run_holodeck_lib_gen.sh +++ b/scripts/run_holodeck_lib_gen.sh @@ -9,11 +9,13 @@ # 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 # holodeck_lib_gen # # 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 @@ -21,13 +23,16 @@ # 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 # LZKelley@berkeley.edu # ================================================================================================== + # ==== SLURM job scheduler configuration ==== # NOTE: SLURM uses a single '#' to denote its configuration. Multiple '#' marks are ignored. @@ -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"