Skip to content

Expect either boost::optional or std::optional from Boost.MPI #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/boost/graph/distributed/detail/mpi_process_group.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void do_oob_receive(mpi_process_group const& self,
status = self.impl_->comm.probe(source, tag);

#if BOOST_VERSION >= 103600
int size = status.count<boost::mpi::packed>().get();
int size = status.count<boost::mpi::packed>().value();
#else
int size;
MPI_Status& mpi_status = status;
Expand Down Expand Up @@ -959,7 +959,7 @@ receive_oob(const mpi_process_group& pg,
std::pair<boost::mpi::communicator, int> actual
= pg.actual_communicator_and_tag(tag, block);

boost::optional<boost::mpi::status> status;
boost::mpi::optional<boost::mpi::status> status;
do {
status = actual.first.iprobe(source, actual.second);
if (!status)
Expand All @@ -972,7 +972,7 @@ receive_oob(const mpi_process_group& pg,
boost::mpi::packed_iarchive in(actual.first);

#if BOOST_VERSION >= 103600
in.resize(status->count<boost::mpi::packed>().get());
in.resize(status->count<boost::mpi::packed>().value());
#else
int size;
MPI_Status mpi_status = *status;
Expand Down
10 changes: 5 additions & 5 deletions src/mpi_process_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ void mpi_process_group::receive_batch(boost::mpi::status& status) const

// Determine how big the receive buffer should be
#if BOOST_VERSION >= 103600
int size = status.count<boost::mpi::packed>().get();
int size = status.count<boost::mpi::packed>().value();
#else
int size;
MPI_Status mpi_status(status);
Expand Down Expand Up @@ -978,7 +978,7 @@ poll(bool wait, int block, bool synchronizing) const
impl_->trigger_context = trc_out_of_band;

//wait = false;
optional<boost::mpi::status> status;
boost::mpi::optional<boost::mpi::status> status;
bool finished=false;
optional<std::pair<int, int> > result;
do {
Expand All @@ -993,14 +993,14 @@ poll(bool wait, int block, bool synchronizing) const

if (status) { // we have a message
// Decode the message
std::pair<int, int> decoded = decode_tag(status.get().tag());
if (maybe_emit_receive(status.get().source(), status.get().tag()))
std::pair<int, int> decoded = decode_tag(status.value().tag());
if (maybe_emit_receive(status.value().source(), status.value().tag()))
// We received the message out-of-band; poll again
finished = false;
else if (decoded.first == (block == -1 ? my_block_number() : block)) {
// This message is for us, but not through a trigger. Return
// the decoded message.
result = std::make_pair(status.get().source(), decoded.second);
result = std::make_pair(status.value().source(), decoded.second);
// otherwise we didn't match any message we know how to deal with, so
// pretend no message exists.
finished = true;
Expand Down
Loading