Hi for large mpi projects in c++ with multiple .hp and .cpp files ,should there be a MPI_Finalize(); at the end of every header or cpp file that uses an mpi function? or should there just be on global one in the main cpp file? This also goes with initiation of MPI as well
Share
MPI_Init() is in charge of initiating communication with the other processes, so you only want to call that once if possible. MPI_Finalize() means you’re done with MPI, and won’t be calling any more MPI functions for the rest of the program.