Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
TRACE_start and TRACE_end should no longer be called by user-code
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Nov 2010 14:42:08 +0000 (14:42 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 23 Nov 2010 14:42:08 +0000 (14:42 +0000)
details:
- MSG_global_init and MSG_clean do the job for the user
if tracing is set to on in cmake

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8618 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/msg/tracing/categories.c
examples/msg/tracing/ms.c
examples/msg/tracing/procmig.c
examples/msg/tracing/tasks.c
examples/msg/tracing/volume.c
src/msg/global.c

index ecc22fb..07d03f6 100644 (file)
@@ -106,8 +106,6 @@ int main(int argc, char *argv[])
     printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
     exit(1);
   }
-  //starting the simulation tracing
-  TRACE_start();
 
   //declaring user categories
   TRACE_category("compute");
@@ -118,9 +116,6 @@ int main(int argc, char *argv[])
   res = test_all(argv[1], argv[2]);
   MSG_clean();
 
-  //ending the simulation tracing
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else
index 1f7a168..179e1c5 100644 (file)
@@ -113,8 +113,6 @@ int main(int argc, char *argv[])
     printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
     exit(1);
   }
-  //starting the simulation tracing
-  TRACE_start();
 
   //declaring user variables
   TRACE_host_variable_declare("is_slave");
@@ -132,9 +130,6 @@ int main(int argc, char *argv[])
   res = test_all(argv[1], argv[2]);
   MSG_clean();
 
-  //ending the simulation tracing
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else
index e45aab6..2a22680 100644 (file)
@@ -50,8 +50,6 @@ int main(int argc, char *argv[])
               argv[0]);
     exit(1);
   }
-  //starting the simulation trace
-  TRACE_start();
   TRACE_category("emigrant");
 
   /* Simulation setting */
@@ -67,9 +65,6 @@ int main(int argc, char *argv[])
   if (res == MSG_OK)
     res = MSG_clean();
 
-  //ending the simulation trace
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else
index ca955ee..8cac0f8 100644 (file)
@@ -110,8 +110,6 @@ int main(int argc, char *argv[])
     printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
     exit(1);
   }
-  //starting the simulation tracing
-  TRACE_start();
 
   //declaring user categories
   TRACE_category("compute");
@@ -120,9 +118,6 @@ int main(int argc, char *argv[])
   res = test_all(argv[1], argv[2]);
   MSG_clean();
 
-  //ending the simulation tracing
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else
index 7210fc5..da85069 100644 (file)
@@ -117,7 +117,6 @@ int main(int argc, char *argv[])
   // - the communication volume among processes expects that:
   //     - the processes involved have a category
   //     - the tasks sent have a category
-  TRACE_start();
 
   //declaring user categories (for tasks)
   TRACE_category("compute");
@@ -132,9 +131,6 @@ int main(int argc, char *argv[])
   res = test_all(argv[1], argv[2]);
   MSG_clean();
 
-  //ending the simulation tracing
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else
index bee1308..7629d66 100644 (file)
@@ -80,6 +80,9 @@ void MSG_global_init(int *argc, char **argv)
     SIMIX_function_register_process_cleanup(__MSG_process_cleanup);
     SIMIX_function_register_process_kill(_MSG_process_kill_from_SIMIX);
   }
+#ifdef HAVE_TRACING
+  TRACE_start();
+#endif
 }
 
 /** \defgroup m_channel_management    Understanding channels
@@ -214,6 +217,10 @@ MSG_error_t MSG_clean(void)
 
   SIMIX_clean();
 
+#ifdef HAVE_TRACING
+  TRACE_end();
+#endif
+
   return MSG_OK;
 }