#include "simgrid/modelchecker.h"
#include "src/mc/mc_replay.h"
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
+simgrid::simix::Comm::Comm(e_smx_comm_type_t _type) {
+ state = SIMIX_WAITING;
+ this->type = _type;
+ refcount = 1;
+ src_data=NULL;
+ dst_data=NULL;
+
+ XBT_DEBUG("Create communicate synchro %p", this);
+}
void simgrid::simix::Comm::suspend() {
/* FIXME: shall we suspend also the timeout synchro? */
if (surf_comm)
surf_comm->cancel();
}
}
+
+/** @brief get the amount remaining from the communication */
+double simgrid::simix::Comm::remains() {
+ switch (state) {
+
+ case SIMIX_RUNNING:
+ return surf_comm->getRemains();
+ break;
+
+ case SIMIX_WAITING:
+ case SIMIX_READY:
+ return 0; /*FIXME: check what should be returned */
+ break;
+
+ default:
+ return 0; /*FIXME: is this correct? */
+ break;
+ }
+}