cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
65 stars 32 forks source link

CPU_TIME reduction #328

Open alwinm opened 1 year ago

alwinm commented 1 year ago

Currently the time reduction uses MPI_Allreduce simply because some reduction routines already existed in mpi_routines.h

This performs an extra unnecessary step of sending the result back out to all procs, but I believe only proc 0 needs the reduced data. MPI_Reduce should suffice.

bcaddy commented 1 year ago

With some refactoring this could also be an asynchronous call, no need for the result until the next time that timer is called.

bcaddy commented 9 months ago

FYI, the average reduction OneTime::End actually does need to be an allreduce since it's used to check if that rank is particularly slow.