return process_info;
}
-/** Load the remote swag of processes into a vector
+/** Load the remote list of processes into a vector
*
- * @param process MCed process
- * @param target Local vector (to be filled with copies of `s_smx_actor_t`)
- * @param remote_swag Address of the process SWAG in the remote list
+ * @param process MCed process
+ * @param target Local vector (to be filled with copies of `s_smx_actor_t`)
+ * @param remote_dynar Address of the process dynar in the remote list
*/
-static void MC_process_refresh_simix_process_list(simgrid::mc::RemoteClient* process,
- std::vector<simgrid::mc::ActorInformation>& target,
- simgrid::mc::RemotePtr<s_xbt_swag_t> remote_swag)
-{
- target.clear();
-
- // swag = REMOTE(*simix_global->process_list)
- s_xbt_swag_t swag;
- process->read_bytes(&swag, sizeof(swag), remote_swag);
-
- // Load each element of the vector from the MCed process:
- int i = 0;
- for (smx_actor_t p = (smx_actor_t) swag.head; p; ++i) {
-
- simgrid::mc::ActorInformation info;
- info.address = p;
- info.hostname = nullptr;
- process->read_bytes(&info.copy, sizeof(info.copy), remote(p));
- target.push_back(std::move(info));
-
- // Lookup next process address:
- p = (smx_actor_t) xbt_swag_getNext(&info.copy, swag.offset);
- }
- assert(i == swag.count);
-}
-
static void MC_process_refresh_simix_actor_dynar(simgrid::mc::RemoteClient* process,
std::vector<simgrid::mc::ActorInformation>& target,
simgrid::mc::RemotePtr<s_xbt_dynar_t> remote_dynar)
this->read<simgrid::simix::Global>(simix_global_p);
MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, remote(simix_global.getBuffer()->actors_vector));
- MC_process_refresh_simix_process_list(this, this->smx_dead_actors_infos,
- remote(simix_global.getBuffer()->process_to_destroy));
+ MC_process_refresh_simix_actor_dynar(this, this->smx_dead_actors_infos,
+ remote(simix_global.getBuffer()->dead_actors_vector));
this->cache_flags_ |= RemoteClient::cache_simix_processes;
}
simix_global->process_list.erase(process->pid);
if (process->host && process->host_process_list_hook.is_linked())
simgrid::xbt::intrusive_erase(process->host->extension<simgrid::simix::Host>()->process_list, *process);
- xbt_swag_insert(process, simix_global->process_to_destroy);
+ if (not xbt_swag_belongs(process, simix_global->process_to_destroy)) {
+#if SIMGRID_HAVE_MC
+ xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, process);
+#endif
+ xbt_swag_insert(process, simix_global->process_to_destroy);
+ }
process->context->iwannadie = 0;
xbt_os_mutex_release(simix_global->mutex);
intrusive_ptr_release(process);
process = static_cast<smx_actor_t>(xbt_swag_extract(simix_global->process_to_destroy));
}
+#if SIMGRID_HAVE_MC
+ xbt_dynar_reset(simix_global->dead_actors_vector);
+#endif
}
namespace simgrid {
std::vector<smx_actor_t> process_to_run;
std::vector<smx_actor_t> process_that_ran;
std::map<aid_t, smx_actor_t> process_list;
+ xbt_swag_t process_to_destroy = nullptr;
#if SIMGRID_HAVE_MC
- /* MCer cannot read the std::map above in the remote process, so we copy the info it needs in a dynar.
+ /* MCer cannot read members process_list and process_to_destroy above in the remote process, so we copy the info it
+ * needs in a dynar.
* FIXME: This is supposed to be a temporary hack.
* A better solution would be to change the split between MCer and MCed, where the responsibility
* to compute the list of the enabled transitions goes to the MCed.
* That way, the MCer would not need to have the list of actors on its side.
* These info could be published by the MCed to the MCer in a way inspired of vd.so
*/
- xbt_dynar_t actors_vector = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
+ xbt_dynar_t actors_vector = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
+ xbt_dynar_t dead_actors_vector = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
#endif
- xbt_swag_t process_to_destroy = nullptr;
smx_actor_t maestro_process = nullptr;
// Maps function names to actor code: