From: Gabriel Corona Date: Tue, 8 Mar 2016 09:44:49 +0000 (+0100) Subject: [mc] Remove the SNAPSHOT and COMPARE_SNAPSHOTS MC simcalls X-Git-Tag: v3_13~488 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/507785035fffb029577ed608142f0cb8a43f77e9?hp=195e487a20a55e069bd2300dedf67d7cb122ee47 [mc] Remove the SNAPSHOT and COMPARE_SNAPSHOTS MC simcalls They were not used. --- diff --git a/include/simgrid/modelchecker.h b/include/simgrid/modelchecker.h index b77f417b64..da3d83150c 100644 --- a/include/simgrid/modelchecker.h +++ b/include/simgrid/modelchecker.h @@ -46,8 +46,6 @@ XBT_PUBLIC(void) MC_assert(int); XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, int(*fct)(void)); XBT_PUBLIC(void) MC_automaton_new_propositional_symbol_pointer(const char *id, int* value); -XBT_PUBLIC(void *) MC_snapshot(void); -XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2); XBT_PUBLIC(void) MC_cut(void); XBT_PUBLIC(void) MC_ignore(void *addr, size_t size); @@ -59,8 +57,6 @@ XBT_PUBLIC(void) MC_ignore(void *addr, size_t size); #define MC_assert(a) xbt_assert(a) #define MC_automaton_new_propositional_symbol(a, b) ((void)0) #define MC_automaton_new_propositional_symbol_pointer(a, b) ((void)0) -#define MC_snapshot() ((void*)0) -#define MC_compare_snapshots(a, b) 0 #define MC_cut() ((void)0) #define MC_ignore(a, b) ((void)0) diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 5e930ff5ec..ae24e72b22 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -481,8 +481,6 @@ XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name); XBT_PUBLIC(xbt_dict_t) simcall_asr_get_properties(const char *name); /************************** MC simcalls **********************************/ -XBT_PUBLIC(void *) simcall_mc_snapshot(void); -XBT_PUBLIC(int) simcall_mc_compare_snapshots(void *s1, void *s2); XBT_PUBLIC(int) simcall_mc_random(int min, int max); SG_END_DECL() diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index c3fbeedd58..70ca01cebf 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -187,10 +187,6 @@ bool request_is_visible(smx_simcall_t req) || req->call == SIMCALL_MC_RANDOM || req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK -#ifdef HAVE_MC - || req->call == SIMCALL_MC_SNAPSHOT - || req->call == SIMCALL_MC_COMPARE_SNAPSHOTS -#endif ; } diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index c8311007f4..3e9a705c9f 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -635,9 +635,3 @@ void restore_snapshot(mc_snapshot_t snapshot) } } - -extern "C" -mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall) -{ - return simgrid::mc::take_snapshot(1); -} diff --git a/src/mc/mc_client_api.cpp b/src/mc/mc_client_api.cpp index 21a1db98d3..9433798db9 100644 --- a/src/mc/mc_client_api.cpp +++ b/src/mc/mc_client_api.cpp @@ -39,22 +39,6 @@ void MC_assert(int prop) } } -void *MC_snapshot(void) -{ - return simcall_mc_snapshot(); -} - -int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, - mc_snapshot_t s1, mc_snapshot_t s2) -{ - return snapshot_compare(s1, s2); -} - -int MC_compare_snapshots(void *s1, void *s2) -{ - return simcall_mc_compare_snapshots(s1, s2); -} - void MC_cut(void) { user_max_depth_reached = 1; diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index 0c2acf8651..29d008efda 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -399,16 +399,6 @@ char *simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid::mc:: break; } - case SIMCALL_MC_SNAPSHOT: - type = "MC_SNAPSHOT"; - args = nullptr; - break; - - case SIMCALL_MC_COMPARE_SNAPSHOTS: - type = "MC_COMPARE_SNAPSHOTS"; - args = nullptr; - break; - case SIMCALL_MC_RANDOM: type = "MC_RANDOM"; args = bprintf("%d", value); @@ -612,24 +602,6 @@ char *request_get_dot_output(smx_simcall_t req, int value) label = bprintf("[(%lu)] MC_RANDOM (%d)", issuer->pid, value); break; - case SIMCALL_MC_SNAPSHOT: - if (issuer->host) - label = - bprintf("[(%lu)%s] MC_SNAPSHOT", issuer->pid, - MC_smx_process_get_host_name(issuer)); - else - label = bprintf("[(%lu)] MC_SNAPSHOT", issuer->pid); - break; - - case SIMCALL_MC_COMPARE_SNAPSHOTS: - if (issuer->host) - label = - bprintf("[(%lu)%s] MC_COMPARE_SNAPSHOTS", issuer->pid, - MC_smx_process_get_host_name(issuer)); - else - label = bprintf("[(%lu)] MC_COMPARE_SNAPSHOTS", issuer->pid); - break; - default: THROW_UNIMPLEMENTED; } diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index cdd3b404b5..5eacc32a52 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -1291,18 +1291,6 @@ void simcall_run_kernel(std::function const& code) return simcall_BODY_run_kernel((void*) &code); } -#ifdef HAVE_MC - -void *simcall_mc_snapshot(void) { - return simcall_BODY_mc_snapshot(); -} - -int simcall_mc_compare_snapshots(void *s1, void *s2) { - return simcall_BODY_mc_compare_snapshots((simgrid::mc::Snapshot*)s1, (simgrid::mc::Snapshot*)s2); -} - -#endif /* HAVE_MC */ - int simcall_mc_random(int min, int max) { return simcall_BODY_mc_random(min, max); } diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index d3c67e9775..b7aa14364b 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -1380,35 +1380,6 @@ static inline void* simcall_run_kernel__get__code(smx_simcall_t simcall) { static inline void simcall_run_kernel__set__code(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -#ifdef HAVE_MC - -static inline mc_snapshot_t simcall_mc_snapshot__get__result(smx_simcall_t simcall){ - return (mc_snapshot_t) simcall->result.dp; -} -static inline void simcall_mc_snapshot__set__result(smx_simcall_t simcall, void* result){ - simcall->result.dp = result; -} - -static inline mc_snapshot_t simcall_mc_compare_snapshots__get__s1(smx_simcall_t simcall) { - return (mc_snapshot_t) simcall->args[0].dp; -} -static inline void simcall_mc_compare_snapshots__set__s1(smx_simcall_t simcall, void* arg) { - simcall->args[0].dp = arg; -} -static inline mc_snapshot_t simcall_mc_compare_snapshots__get__s2(smx_simcall_t simcall) { - return (mc_snapshot_t) simcall->args[1].dp; -} -static inline void simcall_mc_compare_snapshots__set__s2(smx_simcall_t simcall, void* arg) { - simcall->args[1].dp = arg; -} -static inline int simcall_mc_compare_snapshots__get__result(smx_simcall_t simcall){ - return simcall->result.i; -} -static inline void simcall_mc_compare_snapshots__set__result(smx_simcall_t simcall, int result){ - simcall->result.i = result; -} -#endif - /* The prototype of all simcall handlers, automatically generated for you */ @@ -1460,8 +1431,4 @@ XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage); XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name); XBT_PRIVATE xbt_dict_t simcall_HANDLER_asr_get_properties(smx_simcall_t simcall, const char* name); -XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max); -#ifdef HAVE_MC -XBT_PRIVATE mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall); -XBT_PRIVATE int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2); -#endif +XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max); \ No newline at end of file diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 2a0c62d516..05e6b825ad 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -1844,49 +1844,4 @@ inline static void simcall_BODY_run_kernel(void* code) { SIMIX_simcall_handle(&self->simcall, 0); } - } -#ifdef HAVE_MC - -inline static mc_snapshot_t simcall_BODY_mc_snapshot() { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_mc_snapshot(&self->simcall); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MC_SNAPSHOT; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - - if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, - SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_handle(&self->simcall, 0); - } - return (mc_snapshot_t) self->simcall.result.dp; - } - -inline static int simcall_BODY_mc_compare_snapshots(mc_snapshot_t s1, mc_snapshot_t s2) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_mc_compare_snapshots(&self->simcall, s1, s2); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) s1; - self->simcall.args[1].dp = (void*) s2; - if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, - SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_handle(&self->simcall, 0); - } - return (int) self->simcall.result.i; - } -#endif + } \ No newline at end of file diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 4f357d8bd9..877f0a3a11 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -100,10 +100,5 @@ typedef enum { SIMCALL_ASR_GET_PROPERTIES, SIMCALL_MC_RANDOM, SIMCALL_SET_CATEGORY, - SIMCALL_RUN_KERNEL, -#ifdef HAVE_MC - SIMCALL_MC_SNAPSHOT, - SIMCALL_MC_COMPARE_SNAPSHOTS, -#endif - NUM_SIMCALLS + SIMCALL_RUN_KERNEL, NUM_SIMCALLS } e_smx_simcall_t; diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 2306854f1f..cee0200fa4 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -105,12 +105,7 @@ const char* simcall_names[] = { "SIMCALL_ASR_GET_PROPERTIES", "SIMCALL_MC_RANDOM", "SIMCALL_SET_CATEGORY", - "SIMCALL_RUN_KERNEL", -#ifdef HAVE_MC - "SIMCALL_MC_SNAPSHOT", - "SIMCALL_MC_COMPARE_SNAPSHOTS", -#endif -}; + "SIMCALL_RUN_KERNEL",}; /** * @brief (in kernel mode) unpack the simcall and activate the handler @@ -518,19 +513,6 @@ case SIMCALL_RUN_KERNEL: SIMIX_run_kernel( simcall->args[0].dp); SIMIX_simcall_answer(simcall); break; - -#ifdef HAVE_MC -case SIMCALL_MC_SNAPSHOT: - simcall->result.dp = simcall_HANDLER_mc_snapshot(simcall ); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_MC_COMPARE_SNAPSHOTS: - simcall->result.i = simcall_HANDLER_mc_compare_snapshots(simcall , (mc_snapshot_t) simcall->args[0].dp, (mc_snapshot_t) simcall->args[1].dp); - SIMIX_simcall_answer(simcall); - break; - -#endif case NUM_SIMCALLS: break; case SIMCALL_NONE: diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index a98a6d3550..904718dcc9 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -141,7 +141,3 @@ Func H mc_random (int) (min, int) (max, int) Proc - set_category (void) (synchro, void*, smx_synchro_t) (category, const char*) Proc - run_kernel (void) (code, void*) - -## HAVE_MC -Func H mc_snapshot (void*, mc_snapshot_t) -Func H mc_compare_snapshots (int) (s1, void*, mc_snapshot_t) (s2, void*, mc_snapshot_t)