Parallel reading of serial basis files#316
Conversation
…y of other world-communicator ranks.
|
@dreamer2368 and @ckendrick Let's review and approve this PR. |
dreamer2368
left a comment
There was a problem hiding this comment.
Could you describe the use case of this PR a little more?
- How does a serial basis file look like? Is it a monolithic basis matrix, or some rows of the basis matrix corresponding to a MPI process at the time of POD training?
- What kind of parallel reading is performed here? All MPI processes attempt to read one monolithic basis matrix?
| d_format(db_format) | ||
| { | ||
| CAROM_ASSERT(!base_file_name.empty()); | ||
| d_distributed = comm != MPI_COMM_NULL; |
There was a problem hiding this comment.
This concerns me a little bit, since libROM currently does not support custom MPI communicator other than MPI_COMM_WORLD.
Should we add a line of CAROM_VERIFY for checking if the communicator is MPI_COMM_WORLD?
|
@dreamer2368 An example using this PR is in file The workflow being supported is
In this PR, the As you suggested, we could add a verification that the communicator is either |
ckendrick
left a comment
There was a problem hiding this comment.
I think using the communicator over a bool for this is a good idea and will hopefully save work later on when we support different MPI communicators.
Could you also add a small test for this feature? It can be something like a simple call to BasisReader with the new communicator option and just check if the Matrix returned has the correct sizes and distributed flag set for each rank.
ckendrick
left a comment
There was a problem hiding this comment.
@dylan-copeland thanks for adding the test, this looks good to me now!
I'm okay with this PR as long as a verification line is added. |
This PR enables the reading of serial basis files in parallel, by using the
MPI_COMM_NULLcommunicator inBasisReader.