Handling commands in a trace file using threads
This is related to the issue #67 (closed)
After confirming that MPI_Iallreduce() works using multithreading (i.e., we call
MPI_Wait() in a thread), I was looking for essentially the same functionality for an
iallreduce trace command. Since I didn't see it implemented, I tried a simple hack in a local copy on my machine:
- I connected a standard
allreducecommand specified in a trace file to a call to the non-blocking
colls::iallreduce()(Ideally I should have written a handler for
iallreducetrace command but I just wanted to try this out and see if I am getting the desired behavior)
- This is immediately followed by a call to
mythread_create("xyz", &req, rank)following the example provided in the discussion thread on issue #67 (closed).
- The thread handler basically calls Request::wait() on the above req pointer.
When I execute the above, I am seeing that all the iallreduce operations are successful but at the very end there is a reference counting problem possibly due to some memory corruption, which produces output such as the following at the end:
[smpi_request/DEBUG] Finishing non blocking collective request with 148138464 sub-requests
This is immediately followed by a segmentation fault.
Surely what I tried above is a hack, but I was wondering if there is something obviously wrong with this approach and if there is a fix or if you have some guidance for implementing something like this.