From: Samuel Lepetit Date: Wed, 9 May 2012 15:30:29 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_7~26 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0c14e681436e252f680310c7696b3ba17a349706?hp=51c73230bec626b1240fc9f2145ca3c802b05348 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/buildtools/Cmake/simgrid.nsi.in b/buildtools/Cmake/simgrid.nsi.in index a5c4f84224..74077730b2 100644 --- a/buildtools/Cmake/simgrid.nsi.in +++ b/buildtools/Cmake/simgrid.nsi.in @@ -28,7 +28,7 @@ Name "Simgrid" outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_SGjava_@NSIS_WIN_VERSION@@BIN_EXE@" -Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SimGrid.ico" +Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SGicon.ico" RequestExecutionLevel admin @@ -97,12 +97,15 @@ Section "Libraries and Headers" LibSection file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h file @CMAKE_HOME_DIRECTORY@\include\xbt\automatonparse_promela.h file @CMAKE_HOME_DIRECTORY@\include\xbt\datadesc.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\socket.h + file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h CreateDirectory $INSTDIR\include\simgrid setOutPath $INSTDIR\include\simgrid file @CMAKE_HOME_DIRECTORY@\include\simgrid\platf.h file @CMAKE_HOME_DIRECTORY@\include\simgrid\modelchecker.h - + file @CMAKE_HOME_DIRECTORY@\include\simgrid\simix.h + CreateDirectory $INSTDIR\include\msg setOutPath $INSTDIR\include\msg file @CMAKE_HOME_DIRECTORY@\include\msg\msg.h @@ -146,12 +149,6 @@ Section "Libraries and Headers" LibSection setOutPath $INSTDIR\include\instr file @CMAKE_HOME_DIRECTORY@\include\instr\instr.h - CreateDirectory $INSTDIR\include\simix - setOutPath $INSTDIR\include\simix - file @CMAKE_HOME_DIRECTORY@\include\simix\simix.h - file @CMAKE_HOME_DIRECTORY@\include\simix\datatypes.h - file @CMAKE_HOME_DIRECTORY@\include\simix\context.h - SectionEnd Section "Binaries" BinSection @@ -341,7 +338,13 @@ section "Uninstall" delete $INSTDIR\include\xbt\mmalloc.h delete $INSTDIR\include\xbt\replay_trace_reader.h delete $INSTDIR\include\xbt\parmap.h - delete $INSTDIR\include\mc\modelchecker.h + delete $INSTDIR\include\xbt\socket.h + delete $INSTDIR\include\xbt\file_stat.h + + delete $INSTDIR\include\simgrid\platf.h + delete $INSTDIR\include\simgrid\modelchecker.h + delete $INSTDIR\include\simgrid\simix.h + delete $INSTDIR\include\msg\msg.h delete $INSTDIR\include\msg\datatypes.h delete $INSTDIR\include\simdag\simdag.h @@ -365,9 +368,6 @@ section "Uninstall" delete $INSTDIR\include\amok\peermanagement.h delete $INSTDIR\include\amok\bandwidth.h delete $INSTDIR\include\instr\instr.h - delete $INSTDIR\include\simix\simix.h - delete $INSTDIR\include\simix\datatypes.h - delete $INSTDIR\include\simix\context.h # delete EXTRA FILES delete $INSTDIR\AUTHORS diff --git a/doc/webcruft/SGicon.gif b/doc/webcruft/SGicon.gif new file mode 100644 index 0000000000..04b7188495 Binary files /dev/null and b/doc/webcruft/SGicon.gif differ diff --git a/doc/webcruft/SGicon.ico b/doc/webcruft/SGicon.ico new file mode 100644 index 0000000000..11f9273459 Binary files /dev/null and b/doc/webcruft/SGicon.ico differ diff --git a/doc/webcruft/SimGrid.ico b/doc/webcruft/SimGrid_2010.ico similarity index 100% rename from doc/webcruft/SimGrid.ico rename to doc/webcruft/SimGrid_2010.ico diff --git a/doc/webcruft/simgrid_logo.png b/doc/webcruft/simgrid_logo_2010.png similarity index 100% rename from doc/webcruft/simgrid_logo.png rename to doc/webcruft/simgrid_logo_2010.png diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index 31e46e630a..31d822a8c4 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -384,6 +384,10 @@ smx_action_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer) SIMIX_process_sleep_suspend(process->waiting_action); break; + case SIMIX_ACTION_SYNCHRO: + /* Suspension is delayed to when the process is rescheduled. */ + break; + default: xbt_die("Internal error in SIMIX_process_suspend: unexpected action type %d", (int)process->waiting_action->type); @@ -431,14 +435,18 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer) SIMIX_process_sleep_resume(process->waiting_action); break; + case SIMIX_ACTION_SYNCHRO: + /* I cannot resume it now. This is delayed to when the process is rescheduled at + * the end of the synchro. */ + break; + default: xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d", (int)process->waiting_action->type); } } - else - XBT_WARN("Strange. Process %p is trying to resume himself.", issuer); - } + } else XBT_WARN("Strange. Process %p is trying to resume himself.", issuer); + XBT_OUT(); } diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index c752587d3c..a66b8f45ae 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -33,10 +33,12 @@ void SIMIX_simcall_answer(smx_simcall_t simcall) XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call, simcall->issuer->name, simcall->issuer); simcall->issuer->simcall.call = SIMCALL_NONE; - if(!xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer))) - xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer); - else - DIE_IMPOSSIBLE; +/* This check should be useless and slows everyone. Reactivate if you see something + * weird in process scheduling. + */ +/* if(!xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer))) */ + xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer); +/* else DIE_IMPOSSIBLE; */ } } diff --git a/src/surf/network.c b/src/surf/network.c index 2680406b2f..7bb180362a 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -60,7 +60,7 @@ e_UM_t network_update_mechanism = UM_UNDEFINED; static int net_selective_update = 0; static int net_action_is_suspended(surf_action_t action); -static void net_update_action_remaining_lazy(double now); +static void net_update_action_remaining_lazy(surf_action_network_CM02_t action, double now); static xbt_swag_t net_modified_set = NULL; static xbt_heap_t net_action_heap = NULL; @@ -353,46 +353,47 @@ int net_get_link_latency_limited(surf_action_t action) double net_action_get_remains(surf_action_t action) { + XBT_IN("(%p)", action); + /* update remains before return it */ if (network_update_mechanism == UM_LAZY) /* update remains before return it */ - net_update_action_remaining_lazy(surf_get_clock()); + net_update_action_remaining_lazy((surf_action_network_CM02_t)action, + surf_get_clock()); + XBT_OUT(); return action->remains; } -static void net_update_action_remaining_lazy(double now) +static void net_update_action_remaining_lazy(surf_action_network_CM02_t action, double now) { - surf_action_lmm_t action = NULL; double delta = 0.0; - xbt_swag_foreach(action, net_modified_set) { + if (GENERIC_LMM_ACTION(action).suspended != 0) + return; - if (action->suspended != 0) { - continue; - } + delta = now - GENERIC_LMM_ACTION(action).last_update; - delta = now - action->last_update; + double_update(&(((surf_action_t)action)->remains), + GENERIC_LMM_ACTION(action).last_value * delta); - double_update(&(((surf_action_t)action)->remains), - lmm_variable_getvalue(action->variable) * delta); + if (((surf_action_t)action)->max_duration != NO_MAX_DURATION) + double_update(&(((surf_action_t)action)->max_duration), delta); - if (((surf_action_t)action)->max_duration != NO_MAX_DURATION) - double_update(&(((surf_action_t)action)->max_duration), delta); - - if ((((surf_action_t)action)->remains <= 0) && - (lmm_get_variable_weight(action->variable) > 0)) { - ((surf_action_t)action)->finish = surf_get_clock(); - surf_network_model->action_state_set((surf_action_t) action, - SURF_ACTION_DONE); - surf_action_lmm_heap_remove(net_action_heap,action); - } else if (((((surf_action_t)action)->max_duration != NO_MAX_DURATION) - && (((surf_action_t)action)->max_duration <= 0))) { - ((surf_action_t)action)->finish = surf_get_clock(); - surf_network_model->action_state_set((surf_action_t) action, - SURF_ACTION_DONE); - surf_action_lmm_heap_remove(net_action_heap,action); - } + if ((((surf_action_t)action)->remains <= 0) && + (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0)) { + ((surf_action_t)action)->finish = surf_get_clock(); + surf_network_model->action_state_set((surf_action_t) action, + SURF_ACTION_DONE); - action->last_update = now; + surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t)action); + } else if (((((surf_action_t)action)->max_duration != NO_MAX_DURATION) + && (((surf_action_t)action)->max_duration <= 0))) { + ((surf_action_t)action)->finish = surf_get_clock(); + surf_network_model->action_state_set((surf_action_t) action, + SURF_ACTION_DONE); + surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t)action); } + + GENERIC_LMM_ACTION(action).last_update = now; + GENERIC_LMM_ACTION(action).last_value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable); } static double net_share_resources_full(double now) @@ -438,7 +439,6 @@ static double net_share_resources_lazy(double now) XBT_DEBUG ("Before share resources, the size of modified actions set is %d", xbt_swag_size(net_modified_set)); - net_update_action_remaining_lazy(now); lmm_solve(network_maxmin_system); @@ -446,7 +446,7 @@ static double net_share_resources_lazy(double now) ("After share resources, The size of modified actions set is %d", xbt_swag_size(net_modified_set)); - xbt_swag_foreach(action, net_modified_set) { + while((action = xbt_swag_extract(net_modified_set))) { int max_dur_flag = 0; if (GENERIC_ACTION(action).state_set != @@ -457,6 +457,8 @@ static double net_share_resources_lazy(double now) if (GENERIC_ACTION(action).priority <= 0) continue; + net_update_action_remaining_lazy(action,now); + min = -1; value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable); if (value > 0) { diff --git a/src/xbt/heap.c b/src/xbt/heap.c index a91e006bf9..2b153804cd 100644 --- a/src/xbt/heap.c +++ b/src/xbt/heap.c @@ -148,7 +148,7 @@ void *xbt_heap_pop(xbt_heap_t H) * \param i element position * \return the element at position i if ok, NULL otherwise * - * Extracts from the heap and returns the element at position i. The head is automatically reorded. + * Extracts from the heap and returns the element at position i. The heap is automatically reorded. */ void *xbt_heap_remove(xbt_heap_t H, int i) { diff --git a/src/xbt/heap_private.h b/src/xbt/heap_private.h index cd2b6a81a2..40a17af9b7 100644 --- a/src/xbt/heap_private.h +++ b/src/xbt/heap_private.h @@ -9,6 +9,7 @@ #include "xbt/dynar.h" /* void_f_pvoid_t */ #include "xbt/heap.h" +#include typedef struct xbt_heap_item { void *content; @@ -30,6 +31,6 @@ typedef struct xbt_heap { #define KEY(H,i) ((H->items)[i]).key #define CONTENT(H,i) ((H->items)[i]).content -#define MIN_KEY_VALUE -10000 +#define MIN_KEY_VALUE -DBL_MAX #endif /* _XBT_HEAP_PRIVATE_H */ diff --git a/src/xbt/log.c b/src/xbt/log.c index d0e6d002bd..95b684354b 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -556,7 +556,9 @@ static void xbt_log_connect_categories(void) XBT_LOG_CONNECT(xbt); XBT_LOG_CONNECT(graphxml_parse); XBT_LOG_CONNECT(log); +#if HAVE_MMAP XBT_LOG_CONNECT(mm_diff); +#endif XBT_LOG_CONNECT(module); XBT_LOG_CONNECT(peer); XBT_LOG_CONNECT(replay);