Opened 12 years ago
Last modified 9 years ago
#5292 new Patches
boost::mpi::scatterv and boost::mpi::gatherv added
Reported by: | Owned by: | Matthias Troyer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpi |
Version: | Boost 1.45.0 | Severity: | Not Applicable |
Keywords: | collective operations | Cc: | troyer@… |
Description
Two more collective operations for Boost.MPI. I made the headers completely based on the existent one: scatter.hpp and gather.hpp
"common use versions" was added too, for those cases where the great buffer is stored contiguously at the root process.
The "common use version" of gatherv needs a warning in the docs: Since the process send it's own buffer size and nothing more, all sizes will be gathered before the real call. I don't know if this is tolerable, you have the decision.
Other doubt about gatherv implementation: I did switch to the packed_archive_send() / packed_archive_recv() communication, i tried to figure out the difference in send an archive or send using communicator::send when dealing with non-MPI types, but without success. boost::mpi::scatter uses the first and boost::mpi::gather uses the second. Anyway,the snippet of code is commented if you want to switch back.
I'm sending a Main.cpp file with the simple tests i made, comment or uncomment the prototypes in pairs: scatterv / gatherv.
To see the results in a separate terminal for each process, this is a possible way:
mpicxx Main.cpp -o test && echo 107 > input.txt && mpirun -np 4 xterm -e ./test
Attachments (9)
Change History (14)
by , 12 years ago
Attachment: | scatterv.hpp added |
---|
by , 12 years ago
Attachment: | gatherv.hpp added |
---|
by , 12 years ago
by , 12 years ago
Attachment: | scatterv(fixed version).hpp added |
---|
comment:1 by , 12 years ago
Thinking better... the gatherv prototype that calls gather is not great. Was discarded and the user needs to pass all sizes.
comment:2 by , 12 years ago
I don't understand so much about copyright terms, be free to remove my name in the header files. :-)
Júlio.
comment:3 by , 11 years ago
Type: | Feature Requests → Patches |
---|
comment:4 by , 10 years ago
Owner: | changed from | to
---|
comment:5 by , 9 years ago
Can we receive an update on this, please? Seems like an excellent and much-needed addition to the present implementation. As it stands, the Boost implementation of scatter is all but useless (i.e. no support for count-array and thus no ability to scatter a vector that is greater than the comm size).
Fixed version