From: Christian Heinrich Date: Fri, 27 May 2016 12:51:57 +0000 (+0200) Subject: [SMPI Examples] Add C-example for call location tracing. X-Git-Tag: v3_14~1138^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a6ea08015bccffeff00ba4e82afa7bb473cde7a4?hp=69dc94c6500722b122cf8e6649c598f3ecb5d663 [SMPI Examples] Add C-example for call location tracing. This is just a copy of the trace_simple test. It does check though that the call location is present in the trace file. --- 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 index 0000000000..9ddb4efcb6 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 index 0000000000..0491db5a7d --- /dev/null +++ b/examples/smpi/trace_call_location/trace_call_location.c @@ -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 +#include + +/* 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 index 0000000000..0d23db6edd --- /dev/null +++ b/examples/smpi/trace_call_location/trace_call_location.tesh @@ -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