Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI Examples] Add C-example for call location tracing.
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 27 May 2016 12:51:57 +0000 (14:51 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 27 May 2016 12:52:46 +0000 (14:52 +0200)
This is just a copy of the trace_simple test. It does check
though that the call location is present in the trace file.

examples/smpi/trace_call_location/smpi_trace_call_location [new file with mode: 0755]
examples/smpi/trace_call_location/trace_call_location.c [new file with mode: 0644]
examples/smpi/trace_call_location/trace_call_location.tesh [new file with mode: 0644]

diff --git a/examples/smpi/trace_call_location/smpi_trace_call_location b/examples/smpi/trace_call_location/smpi_trace_call_location
new file mode 100755 (executable)
index 0000000..9ddb4ef
Binary files /dev/null and b/examples/smpi/trace_call_location/smpi_trace_call_location differ
diff --git a/examples/smpi/trace_call_location/trace_call_location.c b/examples/smpi/trace_call_location/trace_call_location.c
new file mode 100644 (file)
index 0000000..0491db5
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright (c) 2012, 2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* 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 <stdio.h>
+#include <mpi.h>
+
+/* test*/
+int main(int argc, char *argv[])
+{
+  MPI_Init(&argc, &argv);
+  MPI_Barrier (MPI_COMM_WORLD);
+  MPI_Finalize();
+  return 0;
+}
diff --git a/examples/smpi/trace_call_location/trace_call_location.tesh b/examples/smpi/trace_call_location/trace_call_location.tesh
new file mode 100644 (file)
index 0000000..0d23db6
--- /dev/null
@@ -0,0 +1,18 @@
+# use the tested library, not the installed one
+# (since we want to pass it to the child, it has to be redefined before each command)
+# Go for the first test
+
+p Test SMPI with call-location tracing. This means that the binary must have
+p already been compiled with the -trace-call-location switch.
+$ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ./trace_call_location/smpi_trace_call_location --log=smpi_kernel.thres:warning 
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_trace.trace'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/trace-call-location' to '1'
+
+$ grep --quiet "12 0.000000 2 1 5 .*trace_call_location\.c\" 14$" smpi_trace.trace 
+
+$ rm -f smpi_trace.trace