X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/539916de848562683cf2e5425d5160c2a43f135a..9532edf044eed31bcf6de22916c8824e18f373ad:/src/simix/smx_global.c diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index cbf502fc52..cb99d35900 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -16,6 +16,7 @@ #ifdef HAVE_MC #include "mc/mc_private.h" #endif +#include "mc/mc_record.h" #ifdef HAVE_SMPI #include "smpi/private.h" @@ -280,7 +281,7 @@ void SIMIX_clean(void) */ XBT_INLINE double SIMIX_get_clock(void) { - if(MC_is_active()){ + if(MC_is_active() || MC_record_replay_is_active()){ return MC_process_clock_get(SIMIX_process_self()); }else{ return surf_get_clock(); @@ -306,6 +307,12 @@ static int process_syscall_color(void *p) */ void SIMIX_run(void) { + if(MC_record_path) { + MC_record_replay_init(); + MC_record_replay_from_string(MC_record_path); + return; + } + double time = 0; smx_process_t process; surf_action_t action; @@ -334,7 +341,7 @@ void SIMIX_run(void) xbt_os_cputimer_resume(simix_global->timer_seq); #endif - /* Move all killing processes to the end of the list, because killing a process that have an ongoing simcall is a bad idea */ + /* Move all killer processes to the end of the list, because killing a process that have an ongoing simcall is a bad idea */ xbt_dynar_three_way_partition(simix_global->process_that_ran, process_syscall_color); /* answer sequentially and in a fixed arbitrary order all the simcalls that were issued during that sub-round */ @@ -449,9 +456,7 @@ void SIMIX_run(void) if (xbt_swag_size(simix_global->process_list) != 0) { -#ifdef HAVE_TRACING - TRACE_end(); -#endif + TRACE_end(); XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean."); SIMIX_display_process_status(); @@ -607,4 +612,3 @@ xbt_dict_t SIMIX_asr_get_properties(const char *name) { return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL); } -