- // Read dynar:
- s_xbt_dynar_t comms;
- MC_process_read_simple(&mc_model_checker->process(),
- &comms, simcall_comm_waitany__get__comms(req), sizeof(comms));
- // Read dynar buffer:
- assert(comms.elmsize == sizeof(act));
- size_t buffer_size = comms.elmsize * comms.used;
+ xbt_dynar_t comms;
+ s_xbt_dynar_t comms_buffer;
+ size_t buffer_size;
+ if (mc_mode == MC_MODE_SERVER) {
+ // Read dynar:
+ MC_process_read_simple(&mc_model_checker->process(),
+ &comms_buffer, simcall_comm_waitany__get__comms(req), sizeof(comms_buffer));
+ assert(comms_buffer.elmsize == sizeof(act));
+ buffer_size = comms_buffer.elmsize * comms_buffer.used;
+ comms = &comms_buffer;
+ } else {
+ comms = simcall_comm_waitany__get__comms(req);
+ }
+ // Read all the dynar buffer: