diff --git a/Examples/configs/data/iron_FS_sampler_test.yaml b/Examples/configs/data/loa_FS_sampler_test.yaml similarity index 52% rename from Examples/configs/data/iron_FS_sampler_test.yaml rename to Examples/configs/data/loa_FS_sampler_test.yaml index a42e4ea..353027b 100644 --- a/Examples/configs/data/iron_FS_sampler_test.yaml +++ b/Examples/configs/data/loa_FS_sampler_test.yaml @@ -4,26 +4,31 @@ general: slurm args: mail-type: fail mail-user: herbold.9@osu.edu - defaults file: Iron_FS.yaml + defaults file: /pscratch/sd/m/mherbold/tests/bookkeeper/full_shape/loa_fs_v2_no_lyB.yaml data: - bookkeeper dir: /pscratch/sd/m/mherbold/tests/bookkeeper/full_shape/iron_baseline_test - healpix data: /global/cfs/cdirs/desi/spectro/redux/iron/healpix/ - catalog: /global/cfs/cdirs/desicollab/science/lya/y1-kp6/iron-baseline/catalogs/QSO_cat_iron_main_dark_healpix_zlya-altbal_zwarn_cut_20230918.fits + bookkeeper dir: /global/cfs/cdirs/desi/science/lya/y3-fs/validation-tests/v1-0-0-0/baseline + healpix data: /global/cfs/cdirs/desi/spectro/redux/loa/healpix/ + catalog: /global/cfs/cdirs/desi/survey/catalogs/DA2/QSO/loa/QSO_cat_loa_main_dark_healpix_v2.fits delta extraction: calib: 1 calib region: ciii - use existing: /pscratch/sd/m/mherbold/tests/bookkeeper/full_shape/iron_baseline_test + use existing: /global/cfs/cdirs/desi/science/lya/y3-fs/validation-tests/v1-0-0-0/baseline correlations: computed distortions: - general: /pscratch/sd/m/mherbold/tests/bookkeeper/full_shape/iron_baseline_test/correlations/results + general: /global/cfs/cdirs/desi/science/lya/y3-fs/validation-tests/v1-0-0-0/baseline/correlations/results fits: + sampler environment: /global/homes/m/mherbold/.conda/envs/full_shape_bookkeeper + # need to specify, same as general: conda environment: + # default is currently: /global/common/software/desi/users/acuceu/stable_vega/activate_vega.sh extra args: vega_main: general: + control: + run_sampler: True + sampler: Polychord # or PocoMC Polychord: num_live: 512 num_repeats: 20 - path: do_clustering: True resume: True boost_posterior: 3 @@ -37,17 +42,3 @@ fits: time: "08:00:00" nodes: 6 ntasks-per-node: 64 - sampler environment: /global/homes/m/mherbold/.conda/envs/full_shape_bookkeeper - # need to specify, same as general: conda environment: - # default is currently: /global/common/software/desi/users/acuceu/stable_vega/activate_vega.sh - -# Note: to calculate polychord and slurm args: - # num_live = 25 * num_params (rounded down to nearest multiple of 64) - # nodes = num_live / tasks_per_node - # num_repeats = num_params - -# e.g. for 16 parameters: - # num_repeats=16 - # num_live=384 - # tasks_per_node=64 - # nodes=6 diff --git a/README.md b/README.md index 9cab6ce..a7d7a37 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,13 @@ cd vega pip install -e . ``` -If using the Vega sampler, install MPI: +For running the Vega sampler, install MPI: ```bash MPICC="cc -shared" pip install --force-reinstall --no-cache-dir --no-binary=mpi4py mpi4py ``` +Then install Polychord or PocoMC (Vega instructions here: https://github.com/andreicuceu/vega). + To get the most up-to-date version of the bookkeper, clone the repo: ```bash git clone https://github.com/cramirezpe/picca_bookkeeper.git picca_bookkeeper @@ -115,7 +117,38 @@ To run the sampler, ensure that MPI is properly installed with NERSC specific se ```bash MPICC="cc -shared" pip install --force-reinstall --no-cache-dir --no-binary=mpi4py mpi4py ``` -Note: for the bookkeeper config file, you will need to specify your conda environment again. (Otherwise the bookkeeper will default to sourcing a separate Vega installation.) + +### You will also need to install Polychord or PocoMC (Polychord instructions here are taken from: https://github.com/andreicuceu/vega): + +1) Clone the Polychord repo (does not require conda environment yet): +```bash +git clone https://github.com/PolyChord/PolyChordLite.git +cd PolyChordLite +``` +2) In the PolyChordLite folder, locate a file called ``Makefile_gnu``, and change 3 lines: + ```bash +FC = mpifort +CC = mpicc +CXX = mpicxx +``` +to + ```bash +FC = ftn +CC = CC +CXX = CC +``` +3) Then, inside your conda environment, install Polychord: +```bash +make veryclean +make COMPILER_TYPE=gnu +pip install -e . +``` +4) You can test by running the following on an interractive node: +```bash +srun -n 2 python run_pypolychord.py +``` + +Note: for the bookkeeper.yaml config file, you will need to specify your conda environment again. (Otherwise the bookkeeper will default to sourcing a separate Vega installation.) ```bash general: conda environment: /path/to/conda_environment @@ -125,6 +158,18 @@ general: fits: sampler environment: /path/to/conda_environment ``` + +You will also need to specify which sampler (Polychord / PocoMC) you will be using. +```bash +fits: + extra args: + vega_main: + general: + control: + run_sampler: True + sampler: Polychord # or PocoMC +``` + Then to run from the terminal (including arguments like ``--skip-sent`` if skipping deltas, etc.): ```bash picca_bookkeeper_run_sampler /path_to_config.yaml diff --git a/picca_bookkeeper/resources/default_configs/loa_fs_v2_no_lyB.yaml b/picca_bookkeeper/resources/default_configs/loa_fs_v2.yaml similarity index 97% rename from picca_bookkeeper/resources/default_configs/loa_fs_v2_no_lyB.yaml rename to picca_bookkeeper/resources/default_configs/loa_fs_v2.yaml index 0371afb..dec2b65 100644 --- a/picca_bookkeeper/resources/default_configs/loa_fs_v2_no_lyB.yaml +++ b/picca_bookkeeper/resources/default_configs/loa_fs_v2.yaml @@ -1,3 +1,4 @@ +# the goal is to modify this for full shape analysis delta extraction: extra args: picca_delta_extraction: @@ -389,16 +390,16 @@ fits: # smooth-scaling: False ## FS peak/smooth AP: fit phi-alpha, smooth-scaling True - cosmo fit func: phi_alpha - full-shape: False - full-shape-alpha: False - smooth-scaling: True - - ## FS AP: fit phi_alpha, smooth-scaling True, FS True # cosmo fit func: phi_alpha - # full-shape: True + # full-shape: False # full-shape-alpha: False # smooth-scaling: True + + ## FS AP: fit phi_alpha, smooth-scaling True, FS True + cosmo fit func: phi_alpha + full-shape: True + full-shape-alpha: False + smooth-scaling: True ## FS galaxy: fit phi-alpha, all True # cosmo fit func: phi_alpha @@ -439,16 +440,16 @@ fits: dnl_arinyo_kp: 5 22 19.47 0.1 # Peak/smooth AP config - phi: True - alpha: True - phi_smooth: True - alpha_smooth: True - - # Full-shape AP config + # phi: True # alpha: True - # phi_full: True + # phi_smooth: True # alpha_smooth: True + # Full-shape AP config + alpha: True + phi_full: True + alpha_smooth: True + # Galaxy full-shape config # phi_full: True # alpha_full: True @@ -503,16 +504,16 @@ fits: desi_inst_sys_amp: 1e-4 # Peak/smooth AP config - phi: 1.0 - alpha: 1.0 - phi_smooth: 1.0 - alpha_smooth: 1.0 - - # Full-shape AP config + # phi: 1.0 # alpha: 1.0 - # phi_full: 1.0 + # phi_smooth: 1.0 # alpha_smooth: 1.0 + # Full-shape AP config + alpha: 1.0 + phi_full: 1.0 + alpha_smooth: 1.0 + # Galaxy full-shape config # phi_full: 1.0 # alpha_full: 1.0