23 if (elect ==
nullptr) {
34 if (elect !=
nullptr) {
46 electionMember =
true;
58 MPI_Bcast(&cmd, 1, MPI_INT, 0,
comm->
comm);
59 int length =
other.length() +
name.length() + 3;
60 char* remote_c =
new char[length];
61 strcpy(remote_c, (
other+
"<-"+
name).c_str());
62 MPI_Bcast(&length, 1, MPI_INT, 0,
comm->
comm);
63 MPI_Bcast(remote_c, length, MPI_CHAR, 0,
comm->
comm);
81 if (caster==
nullptr) {
84 if (caster==
nullptr) {
95 return elect==
this || elect==
nullptr;
const yarp::os::LogComponent & MPI_CARRIER()
Carrier for port communicating via MPI broadcast.
virtual ~MpiBcastCarrier()
void close() override
Close the carrier.
void createStream(bool sender) override
virtual bool isElect() const
void prepareDisconnect() override
Do cleanup and preparation for the coming disconnect, if necessary.
bool isActive() const override
Check if carrier is alive and error free.
Implements communication via MPI broadcast.
Wrapper for MPI_Comm communicator.
void disconnect(bool disconn)
Pick one of a set of peers to be "active".
PR * add(const std::string &key, typename PR::peer_type *entity)
PR::peer_type * getElect(const std::string &key)
void remove(const std::string &key, typename PR::peer_type *entity)
static void unlock()
Call post() on a global mutual-exclusion semaphore allocated by YARP.
static void lock()
Call wait() on a global mutual-exclusion semaphore allocated by YARP.
void wait()
Decrement the counter, even if we must wait to do that.
void post()
Increment the counter.
#define yCError(component,...)
#define yCTrace(component,...)
#define yCDebug(component,...)
An interface to the operating system, including Port based communication.