Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'killgraskill'
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 23 Nov 2012 10:24:55 +0000 (11:24 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 23 Nov 2012 10:24:55 +0000 (11:24 +0100)
src/smpi/smpi_replay.c
src/xbt/swag.c
src/xbt/xbt_str.c
teshsuite/smpi/mpich-test/coll/CMakeLists.txt
teshsuite/smpi/mpich-test/context/CMakeLists.txt
teshsuite/smpi/mpich-test/env/CMakeLists.txt
teshsuite/smpi/mpich-test/profile/CMakeLists.txt
teshsuite/smpi/mpich-test/pt2pt/CMakeLists.txt

index dc35a68..7214b99 100644 (file)
@@ -70,8 +70,11 @@ static void action_comm_size(const char *const *action)
 
   communicator_size = parse_double(action[2]);
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 
@@ -80,8 +83,11 @@ static void action_compute(const char *const *action)
   double clock = smpi_process_simulated_elapsed();
   smpi_execute_flops(parse_double(action[2]));
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_send(const char *const *action)
@@ -98,9 +104,14 @@ static void action_send(const char *const *action)
 #endif
 
   smpi_mpi_send(NULL, size, MPI_BYTE, to , 0, MPI_COMM_WORLD);
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
-#ifdef HAVE_TRACING
+
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
+
+  #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
@@ -133,8 +144,11 @@ static void action_Isend(const char *const *action)
   xbt_dynar_push(globals->isends,&request);
 
   //TODO do the asynchronous cleanup
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_recv(const char *const *action) {
@@ -158,8 +172,11 @@ static void action_recv(const char *const *action) {
   TRACE_smpi_computing_in(rank);
 #endif
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_Irecv(const char *const *action)
@@ -185,8 +202,11 @@ static void action_Irecv(const char *const *action)
   xbt_dynar_push(globals->irecvs,&request);
 
   //TODO do the asynchronous cleanup
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_wait(const char *const *action){
@@ -221,8 +241,11 @@ static void action_wait(const char *const *action){
   TRACE_smpi_computing_in(rank);
 #endif
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_barrier(const char *const *action){
@@ -238,8 +261,11 @@ static void action_barrier(const char *const *action){
   TRACE_smpi_computing_in(rank);
 #endif
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_bcast(const char *const *action)
@@ -259,8 +285,11 @@ static void action_bcast(const char *const *action)
   TRACE_smpi_computing_in(rank);
 #endif
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_reduce(const char *const *action)
@@ -279,8 +308,11 @@ static void action_reduce(const char *const *action)
   TRACE_smpi_computing_in(rank);
 #endif
 
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 static void action_allReduce(const char *const *action) {
@@ -299,31 +331,38 @@ static void action_allReduce(const char *const *action) {
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
-  XBT_VERB("%s %f", xbt_str_join_array(action, " "),
-           smpi_process_simulated_elapsed()-clock);
+
+  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
+    char *name = xbt_str_join_array(action, " ");
+    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
+    free(name);
+  }
 }
 
 void smpi_replay_init(int *argc, char***argv){
   PMPI_Init(argc, argv);
-  _xbt_replay_action_init();
-
-  xbt_replay_action_register("init",     action_init);
-  xbt_replay_action_register("finalize", action_finalize);
-  xbt_replay_action_register("comm_size",action_comm_size);
-  xbt_replay_action_register("send",     action_send);
-  xbt_replay_action_register("Isend",    action_Isend);
-  xbt_replay_action_register("recv",     action_recv);
-  xbt_replay_action_register("Irecv",    action_Irecv);
-  xbt_replay_action_register("wait",     action_wait);
-  xbt_replay_action_register("barrier",  action_barrier);
-  xbt_replay_action_register("bcast",    action_bcast);
-  xbt_replay_action_register("reduce",   action_reduce);
-  xbt_replay_action_register("allReduce",action_allReduce);
-  xbt_replay_action_register("compute",  action_compute);
+  if (!smpi_process_index()){
+    _xbt_replay_action_init();
+    xbt_replay_action_register("init",     action_init);
+    xbt_replay_action_register("finalize", action_finalize);
+    xbt_replay_action_register("comm_size",action_comm_size);
+    xbt_replay_action_register("send",     action_send);
+    xbt_replay_action_register("Isend",    action_Isend);
+    xbt_replay_action_register("recv",     action_recv);
+    xbt_replay_action_register("Irecv",    action_Irecv);
+    xbt_replay_action_register("wait",     action_wait);
+    xbt_replay_action_register("barrier",  action_barrier);
+    xbt_replay_action_register("bcast",    action_bcast);
+    xbt_replay_action_register("reduce",   action_reduce);
+    xbt_replay_action_register("allReduce",action_allReduce);
+    xbt_replay_action_register("compute",  action_compute);
+  }
 
   xbt_replay_action_runner(*argc, *argv);
 }
 
 int smpi_replay_finalize(){
+  if(!smpi_process_index())
+     _xbt_replay_action_exit();
   return PMPI_Finalize();
 }
index dcee5ef..1a75c7f 100644 (file)
@@ -218,8 +218,9 @@ XBT_TEST_UNIT("basic", test_swag_basic, "Basic usage")
   xbt_swag_insert(obj2, setA);
   xbt_swag_insert(obj2, setB);
 
-  xbt_swag_remove(obj1, setB);
-  /*  xbt_swag_remove(obj2, setB); */
+  xbt_test_assert(xbt_swag_remove(NULL, setB) == NULL);
+  xbt_test_assert(xbt_swag_remove(obj1, setB) == obj1);
+  /*  xbt_test_assert(xbt_swag_remove(obj2, setB) == obj2); */
 
   xbt_test_add("Traverse set A");
   xbt_swag_foreach(obj, setA) {
index a8d06e7..d698133 100644 (file)
@@ -345,7 +345,7 @@ xbt_dynar_t xbt_str_split_quoted_in_place(char *s) {
 
   beg = s;
 
-  /* do not trim leading spaces: caller responsability to clean his cruft */
+  /* do not trim leading spaces: caller responsibility to clean his cruft */
   end = beg;
 
   while (!done) {
index 6661479..7137203 100644 (file)
@@ -121,7 +121,6 @@ endif()
 
 set(tesh_files
   ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -130,7 +129,7 @@ set(xml_files
   )
 set(examples_src
   ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll1 .c
+  ${CMAKE_CURRENT_SOURCE_DIR}/coll1.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll2.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll3.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll4.c
@@ -141,7 +140,7 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/coll9.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll10.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll11.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll12 .c
+  ${CMAKE_CURRENT_SOURCE_DIR}/coll12.c
   ${CMAKE_CURRENT_SOURCE_DIR}/coll13.c
   ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.c
   ${CMAKE_CURRENT_SOURCE_DIR}/bcastbug.c
@@ -171,7 +170,6 @@ set(examples_src
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../hostfile
   PARENT_SCOPE
   )
 set(txt_files
index db189a0..6097802 100644 (file)
@@ -59,7 +59,6 @@ endif()
 
 set(tesh_files
   ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/context.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -85,7 +84,6 @@ set(examples_src
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../hostfile
   PARENT_SCOPE
   )
 set(txt_files
index 4395eb6..088e8f3 100644 (file)
@@ -61,7 +61,6 @@ endif()
 
 set(tesh_files
   ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/env.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -85,7 +84,6 @@ set(examples_src
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../hostfile
   PARENT_SCOPE
   )
 set(txt_files
index 4170b1b..5d904ae 100644 (file)
@@ -21,7 +21,6 @@ endif()
 
 set(tesh_files
   ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/profile.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -36,7 +35,6 @@ set(examples_src
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../hostfile
   PARENT_SCOPE
   )
 set(txt_files
index 93e347a..9570be9 100644 (file)
@@ -289,7 +289,6 @@ endif()
 
 set(tesh_files
   ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -356,7 +355,7 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/order.c
   ${CMAKE_CURRENT_SOURCE_DIR}/pack.c
   ${CMAKE_CURRENT_SOURCE_DIR}/probe1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testtest1 .c
+  ${CMAKE_CURRENT_SOURCE_DIR}/testtest1.c
   ${CMAKE_CURRENT_SOURCE_DIR}/hvectest.c
   ${CMAKE_CURRENT_SOURCE_DIR}/hvectest2.c
   ${CMAKE_CURRENT_SOURCE_DIR}/hvec.c
@@ -394,7 +393,6 @@ set(examples_src
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../hostfile
   PARENT_SCOPE
   )
 set(txt_files