desihub / gpu_specter

Scratch work for porting spectroperfectionism extractions to GPUs
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

clean up serial/parallel io helper classes #61

Closed dmargala closed 3 years ago

dmargala commented 3 years ago

This PR makes a few changes to clean up the serial/parallel io helper classes. The classes help coordinate the read/process/write steps in a typical use case. To make that more clear, I added a process method to each of the classes so that they all have a read, process, and write method now. I also updated the names of the classes to reduce confusion with MPI communicator objects:

NoMPIComm -> NoMPIIOCoordinator SyncIOComm -> SerialIOCoordinator AsyncIOComm -> ParallelIOCoordinator

There is now an example program that demonstrates how to use the classes. To run the example using each of the three coordinators:

# no mpi
python py/gpu_specter/mpi.py

# mpi: serial io
mpirun -n 2 python py/gpu_specter/mpi.py --mpi

# mpi: parallel io
mpirun -n 4 python py/gpu_specter/mpi.py --mpi --async-io
sbailey commented 3 years ago

Catching up on old PRs... looks good, thanks, merging now.