X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/afb1729eae045359028c802a71475b1ae7dae507..36fa571a13985879dc627c70ecc2340af606aa42:/src/mc/mc_smx.h diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index 733d63f962..c078cca1ea 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -4,16 +4,20 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#ifndef MC_SMX_H -#define MC_SMX_H +#ifndef SIMGRID_MC_SMX_H +#define SIMGRID_MC_SMX_H #include +#include #include + #include -#include "mc_process.h" -#include "mc_protocol.h" +#include "src/smpi/private.h" + +#include "src/mc/Process.hpp" +#include "src/mc/remote/mc_protocol.h" /** @file * @brief (Cross-process, MCer/MCed) Access to SMX structures @@ -31,26 +35,12 @@ * * The process lists are currently refreshed each time MCed code is executed. * We don't try to give a persistent MCer address for a given MCed process. - * For this reason, a MCer mc_process_t is currently not reusable after + * For this reason, a MCer simgrid::mc::Process* is currently not reusable after * MCed code. */ SG_BEGIN_DECL() -struct s_mc_smx_process_info { - /** MCed address of the process */ - void* address; - /** (Flat) Copy of the process data structure */ - struct s_smx_process copy; - /** Hostname (owned by `mc_modelchecker->hostnames`) */ - char* hostname; - char* name; -}; - -xbt_dynar_t MC_smx_process_info_list_new(void); - -void MC_process_smx_refresh(mc_process_t process); - /** Get the issuer of a simcall (`req->issuer`) * * In split-process mode, it does the black magic necessary to get an address @@ -60,40 +50,14 @@ void MC_process_smx_refresh(mc_process_t process); * @param process the MCed process * @param req the simcall (copied in the local process) */ -smx_process_t MC_smx_simcall_get_issuer(smx_simcall_t req); - -const char* MC_smx_process_get_name(smx_process_t p); -const char* MC_smx_process_get_host_name(smx_process_t p); - -#define MC_EACH_SIMIX_PROCESS(process, code) \ - if (MC_process_is_self(&mc_model_checker->process)) { \ - xbt_swag_foreach(process, simix_global->process_list) { \ - code; \ - } \ - } else { \ - MC_process_smx_refresh(&mc_model_checker->process); \ - unsigned int _smx_process_index; \ - mc_smx_process_info_t _smx_process_info; \ - xbt_dynar_foreach_ptr(mc_model_checker->process.smx_process_infos, _smx_process_index, _smx_process_info) { \ - smx_process_t process = &_smx_process_info->copy; \ - code; \ - } \ - } - -/** Execute a given simcall */ -void MC_simcall_handle(smx_simcall_t req, int value); - - - -/* ***** Resolve (local/MCer structure from remote/MCed addresses) ***** */ - -/** Get a local copy of the process from the process remote address */ -smx_process_t MC_smx_resolve_process(smx_process_t process_remote_address); +XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req); -/** Get the process info structure from the process remote address */ -mc_smx_process_info_t MC_smx_resolve_process_info(smx_process_t process_remote_address); +XBT_PRIVATE const char* MC_smx_actor_get_name(smx_actor_t p); +XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p); +XBT_PRIVATE int MC_smpi_process_count(void); +XBT_PRIVATE unsigned long MC_smx_get_maxpid(void); SG_END_DECL()