Boost logo

Boost Users :

Subject: [Boost-users] mpi isend to group
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2012-12-27 09:15:49


Hello,

I have got a problem to create a mpi::isend call. I have got a thread loop like:

while (thread_is_running)
{
      std::size_t id = 0;
      if (!mpicom.rank())
      {
            try {
                id = getID();
                mpicom.isend(id)
            } catch (...) { }
     } else {
        mpicom.ireceive(id);
     }
     
    if (id > 0)
    {
           mpi::barrier();
           do something with id
    }

   boost::thread::yield();
}

I would like to create a non-blocking communication over all nodes, so my node with rank 0
checks if a dataset exists, if it exists, the id should be send to all other hosts. After all hosts
reveived this id, they should start the calculation. The nodes must be synchronized before the
"working part" is startet, but if there is no data send to the host, they should do nothing.

I don't know how to use isend to send a message to all hosts. I know only the mpi::any_source flag
but I can not find an any_destination. IMHO the ireceive call must be written with iprobe like

if (boost::optional<mpi::status> l_status = mpicom.iprobe( 0, myTag ))
{
        std::size_t id = 0;
        mpicom.recv( l_status->source(), l_status->tag(), id )
}

Is there a way to create a non-blocking group communication? How can I send if data exists, a message
to all nodes and receive it on each node also with non-blocking communication?

Thanks for your help

Phil
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net