High-level scripts for performing HERA Validation (ideal) simulations, as well as utilities for performing similar custom simulations (for performance benchmarking, debugging, etc.)
In this repo are a number of subdirectories and it can be difficult to navigate
without insider knowledge. The main thing to note is that anything that is
project-specific is in the projects/ directory, and then under the project
for which it is run. For example all the scripts used to to run off the H6C
simulations are in projects/h6c/runscripts/main/.
Each project directory should have an associated conda environment file to
help get set up for that project, e.g. projects/h6c/h6c-env.yaml.
-
Clone this repo, and create a Python environment using the included environment file, e.g.
conda env create -f projects/h6c/h6c-env.yaml -
If not already present somewhere on your system, clone the
HERA-Beamsrepo to a location outside this repo:git clone git@github:hera-team/HERA-Beams ../hera-beams -
If your system has no HPC configuration file in
hpc-configs/yet, add one (cp/paste one of the existing ones). Specifically:- Change the
paths.beamsentry to point to the beams repo location (addingNicolasFagnoniBeamsto the end of the string). - Add any modules required to be loaded on your system (if any). You'll need a
version of
cudaand a version ofopenmpi. - Update both the
cpuandgpuentries of theslurm:section. These provide defaults for running jobs (mostly simulations) on the cluster via SLURM. The most important entries are thepartition,nodes,memandgres(orgpus). In general, you should use as muchmemas available on a single node on your system, and usenodes=1(as multiple nodes are used via multiple jobs).
- Change the
-
Note that if you are going to use matvis, then CUDA 11 is required (NOT Cuda 12), so ensure that the loaded modules are correct. You can check this by running
module liston your system.
There is a top-level CLI interface for running simulations and managing their outputs.
Use ./vsim.py --help to see all the options you have.
Several general steps need to be taken to run a particular simulation. These can generally be done in three parts:
-
Make sky models by running
./vsim.py sky-model [SKYMODEL]. You can use the--helpmenu to find more info. This sends jobs to the SLURM job manager on your HPC to create a single .skyh5 model per frequency. One file per frequency channel is output into thesky_models/directory. -
Make simulation configuration (obsparams) with
./vsim.py make-obsparams. NOTE: this step is not necessary, as it can be done on-the-fly in the next step. There are several options here, so be sure to use the--helpmenu. Some of the important options are--layout, which is a string name (check thehelpmenu to see what is available currently) that maps onto a particular antenna layout (usually a specific subset of HERA 350). You can add your own by updating theutils.pymodule. You can instead provide-a [ANTNUM]or-a LOW~HIGHany number of times to include only those antennas (or ranges) from the full HERA 350. You can also provide--channels [CHANNEL]and/or--channels LOW~HIGHas well as--freq-range LOW HIGHto specify which channels to include (all frequency channels are from the actual HERA array). Also provide the--sky-modelin the same way as step 1. Finally, provide--n-time-chunksto set the number of chunks over which the 17280 LSTs will be simulated. Using a higher number can be good for debugging on small chunks. -
Run the simulation with
./vsim.py runsim. Again,--helpis your friend. Here, you can (in addition to all options frommake_obsparams.pyabove) specify--do-time-chunks LOW[~HIGH]which limits the actual time chunks to simulate (i.e. you might split the simulation into 288 chunks, and only perform the first one). You can also specify--dry-runto create all the configuration files and sbatch files, but not actually run the simulation.
The scripts used to actually run a particular project are contained in the that project's
directory, e.g. projects/h6c. These are generally split into batch_scripts and
runscripts. The runscripts are generally the entrypoints that should be called,
though sometimes these are in batch_scripts (have a look in both if you're unsure,
this is not particularly well organized). Some of the sub-directories of
batch_scripts are auto-generated by particular runscripts (which can produce
Nfreqs batch scripts and then run each one), so be careful of that.
- ``./vsim.py cornerturn
: This performs cornerturns on the output of therunsim` command, taking in the files with large number of times and a single frequency and outputing files with smaller number of times and all frequencies, ready to be passed on to systematics simulation. notebooks/: a bunch of notebooks used for validating the outputs.