X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aff9fc9900200a2b07bedc65273c2f205cb580a4..a5395eca622202d8f7a531e7a95a0bfa1922c0ee:/src/smpi/smpi_bench.c diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index 9f58470608..fe88c48aa1 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -13,6 +13,7 @@ #include "surf/surf.h" #include "simgrid/sg_config.h" #include "simgrid/modelchecker.h" +#include "mc/mc_replay.h" #ifndef WIN32 #include @@ -152,14 +153,12 @@ void smpi_execute_(double *duration) void smpi_execute_flops(double flops) { smx_synchro_t action; - smx_host_t host; + sg_host_t host; host = SIMIX_host_self(); XBT_DEBUG("Handle real computation time: %f flops", flops); - action = simcall_host_execute("computation", host, flops, 1, 0, 0); -#ifdef HAVE_TRACING + action = simcall_process_execute("computation", host, flops, 1, 0, 0); simcall_set_category (action, TRACE_internal_smpi_get_category()); -#endif - simcall_host_execution_wait(action); + simcall_process_execution_wait(action); smpi_switch_data_segment(smpi_process_index()); } @@ -168,18 +167,14 @@ void smpi_execute(double duration) if (duration >= smpi_cpu_threshold) { XBT_DEBUG("Sleep for %g to handle real computation time", duration); double flops = duration * smpi_running_power; -#ifdef HAVE_TRACING int rank = smpi_process_index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type=TRACING_COMPUTING; extra->comp_size=flops; TRACE_smpi_computing_in(rank, extra); -#endif smpi_execute_flops(flops); -#ifdef HAVE_TRACING TRACE_smpi_computing_out(rank); -#endif } else { XBT_DEBUG("Real computation took %g while option smpi/cpu_threshold is set to %g => ignore it", @@ -228,17 +223,15 @@ static unsigned int private_sleep(double secs) smpi_bench_end(); XBT_DEBUG("Sleep for: %lf secs", secs); - #ifdef HAVE_TRACING int rank = smpi_comm_rank(MPI_COMM_WORLD); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type=TRACING_SLEEPING; extra->sleep_duration=secs; TRACE_smpi_sleeping_in(rank, extra); -#endif + simcall_process_sleep(secs); -#ifdef HAVE_TRACING + TRACE_smpi_sleeping_out(rank); -#endif smpi_bench_begin(); return 0; @@ -467,7 +460,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) { void* mem; if (sg_cfg_get_boolean("smpi/use_shared_malloc")){ - char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line); + char *loc = bprintf("/%zu_%s_%d", (size_t)getpid(), file, line); int fd; shared_data_t *data; loc = smpi_shared_alloc_hash(loc); /* hash loc, in order to have something @@ -628,7 +621,7 @@ void smpi_really_switch_data_segment(int dest) { if(smpi_size_data_exe == 0)//no need to switch return; -#ifdef HAVE_MMAP +#ifdef HAVE_PRIVATIZATION int i; if(smpi_loaded_page==-1){//initial switch, do the copy from the real page here for (i=0; i< SIMIX_process_count(); i++){ @@ -731,7 +724,7 @@ void smpi_get_executable_global_size(){ void smpi_initialize_global_memory_segments(){ -#ifndef HAVE_MMAP +#ifndef HAVE_PRIVATIZATION smpi_privatize_global_variables=0; return; #else @@ -805,7 +798,7 @@ Ask the Internet about tutorials on how to increase the files limit such as: htt void smpi_destroy_global_memory_segments(){ if (smpi_size_data_exe == 0)//no need to switch return; -#ifdef HAVE_MMAP +#ifdef HAVE_PRIVATIZATION int i; for (i=0; i< smpi_process_count(); i++){ if(munmap(smpi_privatisation_regions[i].address, smpi_size_data_exe) < 0) {