Skip to content

Projection code

jpdening edited this page Jan 11, 2023 · 1 revision

The projection code in project.py takes the max, min, and average across the z-direction of the slab burner data region. These instructions are specifically for running on LLNL's Quartz.

1. Clone from source

Put this in your home directory. Get there by typing cd in your terminal first. Run the following commands in terminal:

git clone https://github.com/UBCHREST/post-processing.git

2. Create a python virtual environment in post-processing directory

In-depth instructions for all things related to using python on Quartz can be found at https://hpc.llnl.gov/software/development-environment-software/python

To create a virtual environment using python3, navigate to the post-processing repository, then use the following command.

/usr/tce/packages/python/python3.8/bin/virtualenv --system-site-packages ./venv

The virtual environment's version of python can be found in venv/bin/python3.8.

3. Load the required modules

Make sure to load these modules for every new session, or the code will not work

module load hdf5-parallel/1.12.0
module load mvapich2/2.3

4. Download all necessary packages

This only needs to be done once. While in post-processing, run the following:

/venv/bin/python3.8 -m pip install argparse
/venv/bin/python3.8 -m pip install pathlib
/venv/bin/python3.8 -m pip install numpy
/venv/bin/python3.8 -m pip install mpi4py
/venv/bin/python3.8 -m pip install h5py

Some of these modules will already be in place. This list is just for the sake of completeness.

5. Begin an interactive session on Quartz

Vary the number of nodes asked for by modifying the number after the -N flag.

salloc -N 1 -p pdebug --time=60:00

6. Process an HDF5 file with srun

The projection code is able to take both a single file or a directory; however, as these files are quite large, it is advised to only do one at a time. There are a number of argument flags that can be used, listed below.

The actual srun command is as follows:

srun -n number_of_processes venv/bin/python3 ablate/project.py /path/to/hdf5/file arg1 arg 2 arg 3
Argument Description Required(True/False) Default value(if applicable)
--file The input hdf5 file True N/A
-- nx The number of x coordinates False 336
--ny The number of y coordinates False 48
--field The field to draw from False monitor_temperature
--component The component to draw from False sum
--new_dir A boolean option to control whether an output directory is created. Only works for directory inputs. False False

Clone this wiki locally