It's not tested, sorry @henricasanova.
S4U
- Execution->setHost() can be called after start() to migrate it.
+ - Comm::test_any() is now implemented.
Fixed bugs:
- #245: migrating an actor does not migrate its execution
comm->wait();
}
}
+ /*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
+ static int test_any(std::vector<CommPtr> * comms);
/** Creates (but don't start) an async send to the mailbox @p dest */
XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
}
return this;
}
+int Comm::test_any(std::vector<CommPtr>* comms)
+{
+ smx_activity_t* array = static_cast<smx_activity_t*>(malloc(sizeof(smx_activity_t) * comms->size()));
+ for (unsigned int i = 0; i < comms->size(); i++) {
+ array[i] = comms->at(i)->pimpl_;
+ }
+ int res = simcall_comm_testany(array, static_cast<size_t>(comms->size()));
+ free(array);
+ return res;
+}
Activity* Comm::detach()
{