Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 21 May 2017 15:03:13 +0000 (17:03 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 21 May 2017 15:03:13 +0000 (17:03 +0200)
1  2 
src/msg/instr_msg_task.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/instr_smpi.cpp
src/smpi/smpi_replay.cpp
src/xbt/log.c
tools/cmake/DefinePackages.cmake

@@@ -7,6 -7,7 +7,7 @@@
  #include "mc/mc.h"
  #include "src/instr/instr_private.h"
  #include "src/msg/msg_private.h"
+ #include "src/mc/mc_ignore.h"
  
  XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_msg, instr, "MSG instrumentation");
  
@@@ -53,7 -54,7 +54,7 @@@ void TRACE_msg_task_execute_start(msg_t
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
      val_t value = PJ_value_get ("task_execute", type);
 -    new_pajePushState (MSG_get_clock(), process_container, type, value);
 +    new PushStateEvent (MSG_get_clock(), process_container, type, value);
    }
  }
  
@@@ -67,7 -68,7 +68,7 @@@ void TRACE_msg_task_execute_end(msg_tas
  
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 -    new_pajePopState (MSG_get_clock(), process_container, type);
 +    new PopStateEvent (MSG_get_clock(), process_container, type);
    }
  }
  
@@@ -93,7 -94,7 +94,7 @@@ void TRACE_msg_task_get_start(
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
      val_t value = PJ_value_get ("receive", type);
 -    new_pajePushState (MSG_get_clock(), process_container, type, value);
 +    new PushStateEvent (MSG_get_clock(), process_container, type, value);
    }
  }
  
@@@ -107,12 -108,12 +108,12 @@@ void TRACE_msg_task_get_end(double star
  
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 -    new_pajePopState (MSG_get_clock(), process_container, type);
 +    new PopStateEvent (MSG_get_clock(), process_container, type);
  
      char key[INSTR_DEFAULT_STR_SIZE];
      snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
      type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
 -    new_pajeEndLink(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
 +    new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
    }
  }
  
@@@ -128,12 -129,12 +129,12 @@@ int TRACE_msg_task_put_start(msg_task_
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
      val_t value = PJ_value_get ("send", type);
 -    new_pajePushState (MSG_get_clock(), process_container, type, value);
 +    new PushStateEvent (MSG_get_clock(), process_container, type, value);
  
      char key[INSTR_DEFAULT_STR_SIZE];
      snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
      type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
 -    new_pajeStartLink(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
 +    new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
    }
  
    return 1;
@@@ -149,6 -150,6 +150,6 @@@ void TRACE_msg_task_put_end(
  
      container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
      type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 -    new_pajePopState (MSG_get_clock(), process_container, type);
 +    new PopStateEvent (MSG_get_clock(), process_container, type);
    }
  }
@@@ -9,6 -9,8 +9,8 @@@
  #include <exception>
  
  #include "colls_private.h"
+ #include "src/smpi/smpi_process.hpp"
  
  //attempt to do a quick autotuning version of the collective,
  
@@@ -20,7 -22,7 +22,7 @@@
           char cont_name[25];\
           snprintf(cont_name,25, "rank-%d", smpi_process()->index());\
           val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
 -         new_pajeNewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
 +         new NewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
        }
  
  #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)\
diff --combined src/smpi/instr_smpi.cpp
@@@ -61,20 -61,20 +61,20 @@@ static const char *smpi_colors[] =
  
  static char *str_tolower (const char *str)
  {
-   char *ret = xbt_strdup (str);
-   int i, n = strlen (ret);
-   for (i = 0; i < n; i++)
+   char* ret = xbt_strdup(str);
+   int n     = strlen(ret);
+   for (int i = 0; i < n; i++)
      ret[i] = tolower (str[i]);
    return ret;
  }
  
  static const char *instr_find_color (const char *state)
  {
-   char *target = str_tolower (state);
-   const char *ret = nullptr;
-   unsigned int i = 0;
-   const char *current = smpi_colors[i];
-   while ((current != nullptr)){
+   char* target        = str_tolower(state);
+   const char* ret     = nullptr;
+   unsigned int i      = 0;
+   const charcurrent = smpi_colors[i];
+   while (current != nullptr) {
      if (strcmp (state, current) == 0 //exact match
          || strstr(target, current) != 0 ){//as substring
           ret = smpi_colors[i+1]; 
@@@ -246,7 -246,7 +246,7 @@@ void TRACE_smpi_collective_in(int rank
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color (operation);
    val_t value = PJ_value_get_or_new (operation, color, type);
 -   new_pajePushStateWithExtra (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
 +  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
  }
  
  void TRACE_smpi_collective_out(int rank, int root, const char *operation)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
  
 -  new_pajePopState (SIMIX_get_clock(), container, type);
 +  new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
  void TRACE_smpi_computing_init(int rank)
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color ("computing");
    val_t value = PJ_value_get_or_new ("computing", color, type);
 -  new_pajePushState (SIMIX_get_clock(), container, type, value);
 +  new PushStateEvent (SIMIX_get_clock(), container, type, value);
  }
  
  void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    val_t value = PJ_value_get_or_new ("computing", nullptr, type);
 -  new_pajePushStateWithExtra  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
 +  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
  }
  
  void TRACE_smpi_computing_out(int rank)
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
 -  new_pajePopState (SIMIX_get_clock(), container, type);
 +  new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
  void TRACE_smpi_sleeping_init(int rank)
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color ("sleeping");
    val_t value = PJ_value_get_or_new ("sleeping", color, type);
 -  new_pajePushState (SIMIX_get_clock(), container, type, value);
 +  new PushStateEvent (SIMIX_get_clock(), container, type, value);
  }
  
  void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    val_t value = PJ_value_get_or_new ("sleeping", nullptr, type);
 -  new_pajePushStateWithExtra  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
 +  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
  }
  
  void TRACE_smpi_sleeping_out(int rank)
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
 -  new_pajePopState (SIMIX_get_clock(), container, type);
 +  new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
  void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    val_t value = PJ_value_get_or_new ("test", nullptr, type);
 -  new_pajePushStateWithExtra  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
 +  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
  }
  
  void TRACE_smpi_testing_out(int rank)
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
 -  new_pajePopState (SIMIX_get_clock(), container, type);
 +  new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
  void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra)
    type_t type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color (operation);
    val_t value = PJ_value_get_or_new (operation, color, type);
 -  new_pajePushStateWithExtra (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
 +  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
  }
  
  void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_STATE", container->type);
  
 -  new_pajePopState (SIMIX_get_clock(), container, type);
 +  new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
  void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
    XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
 -  new_pajeStartLinkWithSize (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
 +  new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
  }
  
  void TRACE_smpi_recv(int rank, int src, int dst, int tag)
    container_t container = PJ_container_get (str);
    type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
    XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
 -  new_pajeEndLink (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
 +  new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
  }
diff --combined src/smpi/smpi_replay.cpp
@@@ -3,8 -3,15 +3,15 @@@
  /* 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. */
  
- #include "private.h"
+ #include "src/smpi/private.h"
+ #include "src/smpi/smpi_coll.hpp"
+ #include "src/smpi/smpi_comm.hpp"
+ #include "src/smpi/smpi_datatype.hpp"
+ #include "src/smpi/smpi_group.hpp"
+ #include "src/smpi/smpi_process.hpp"
+ #include "src/smpi/smpi_request.hpp"
  #include "xbt/replay.hpp"
  #include <unordered_map>
  #include <vector>
  
@@@ -106,7 -113,6 +113,7 @@@ static MPI_Datatype decode_datatype(con
        break;
      default:
        MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
 +      break;
    }
     return MPI_CURRENT_TYPE;
  }
diff --combined src/xbt/log.c
@@@ -102,7 -102,6 +102,6 @@@ static void xbt_log_connect_categories(
    XBT_LOG_CONNECT(log);
    XBT_LOG_CONNECT(module);
    XBT_LOG_CONNECT(replay);
-   XBT_LOG_CONNECT(strbuff);
    XBT_LOG_CONNECT(xbt_cfg);
    XBT_LOG_CONNECT(xbt_dict);
    XBT_LOG_CONNECT(xbt_dict_cursor);
    /* The following categories are only defined in libsimgrid */
  
    /* bindings */
- #if HAVE_LUA
+ #if SIMGRID_HAVE_LUA
    XBT_LOG_CONNECT(lua);
    XBT_LOG_CONNECT(lua_host);
    XBT_LOG_CONNECT(lua_platf);
    XBT_LOG_CONNECT(instr_resource);
    XBT_LOG_CONNECT(instr_routing);
    XBT_LOG_CONNECT(instr_surf);
 -  XBT_LOG_CONNECT(instr_trace);
 -  XBT_LOG_CONNECT(instr_TI_trace);
  
    /* jedule */
- #if HAVE_JEDULE
+ #if SIMGRID_HAVE_JEDULE
    XBT_LOG_CONNECT(jedule);
    XBT_LOG_CONNECT(jed_sd);
  #endif
  
    /* mc */
- #if HAVE_MC
+ #if SIMGRID_HAVE_MC
    XBT_LOG_CONNECT(mc);
    XBT_LOG_CONNECT(mc_checkpoint);
    XBT_LOG_CONNECT(mc_comm_determinism);
    XBT_LOG_CONNECT(surf_lagrange_dichotomy);
    XBT_LOG_CONNECT(surf_maxmin);
    XBT_LOG_CONNECT(surf_network);
- #if HAVE_NS3
+ #if SIMGRID_HAVE_NS3
    XBT_LOG_CONNECT(ns3);
  #endif
    XBT_LOG_CONNECT(surf_parse);
@@@ -53,6 -53,7 +53,7 @@@ set(EXTRA_DIS
    src/surf/network_ib.hpp
    src/surf/ns3/ns3_interface.h
    src/surf/ns3/ns3_simulator.h
+   src/surf/trace_mgr_test.cpp
    src/surf/xml/simgrid.dtd
    src/surf/xml/simgrid_dtd.h
    src/surf/xml/simgrid_dtd.c
@@@ -287,7 -288,6 +288,6 @@@ set(XBT_SR
    src/xbt/xbt_os_time.c
    src/xbt/xbt_replay.cpp
    src/xbt/xbt_str.cpp
-   src/xbt/xbt_strbuff.c
    src/xbt/xbt_virtu.c
    src/xbt_modinter.h
    )
@@@ -533,6 -533,7 +533,6 @@@ set(LUA_SR
    )
  
  set(TRACING_SRC
 -  src/instr/instr_TI_trace.cpp
    src/instr/instr_config.cpp
    src/instr/instr_interface.cpp
    src/instr/instr_paje_containers.cpp
    src/instr/instr_private.h
    src/instr/instr_smpi.h
    src/instr/instr_resource_utilization.cpp
 -  src/instr/instr_trace.cpp
    )
  
  set(JEDULE_SRC
@@@ -724,7 -726,6 +724,6 @@@ set(headers_to_instal
    include/xbt/log.hpp
    include/xbt/mallocator.h
    include/xbt/matrix.h
-   include/xbt/memory.hpp
    include/xbt/misc.h
    include/xbt/mmalloc.h
    include/xbt/module.h
    include/xbt/range.hpp
    include/xbt/replay.hpp
    include/xbt/str.h
-   include/xbt/strbuff.h
    include/xbt/swag.h
    include/xbt/synchro.h
    include/xbt/sysdep.h
@@@ -784,7 -784,7 +782,7 @@@ set(simgrid_source
    ${XBT_SRC}
    )
  
- if(${HAVE_JEDULE})  
+ if(${SIMGRID_HAVE_JEDULE})  
    set(simgrid_sources  ${simgrid_sources}  ${JEDULE_SRC})
  else()
    set(EXTRA_DIST       ${EXTRA_DIST}       ${JEDULE_SRC})
@@@ -794,11 -794,11 +792,11 @@@ if(enable_smpi
    set(simgrid_sources  ${simgrid_sources}  ${SMPI_SRC})
  endif()
  
- if(HAVE_MC)
+ if(SIMGRID_HAVE_MC)
    set(simgrid_sources  ${simgrid_sources}  ${MC_SRC})
  endif()
  
- if(HAVE_NS3)
+ if(SIMGRID_HAVE_NS3)
    set(simgrid_sources  ${simgrid_sources}  ${NS3_SRC})
  endif()
  
@@@ -812,7 -812,7 +810,7 @@@ if(WIN32
      )
  endif()
  
- if(HAVE_LUA)
+ if(SIMGRID_HAVE_LUA)
    set(simgrid_sources  ${simgrid_sources}  ${LUA_SRC})
  else()
    set(EXTRA_DIST       ${EXTRA_DIST}       ${LUA_SRC})