1 /* Copyright (c) 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "instr/private.h"
11 static char *_TRACE_smpi_container (int rank, char *container, int n)
13 snprintf (container, n, "rank-%d", rank);
17 void TRACE_smpi_start (void)
24 void TRACE_smpi_end (void)
31 void TRACE_smpi_init (int rank)
33 if (!IS_TRACING_SMPI) return;
36 _TRACE_smpi_container (rank, str, 100);
37 pajeCreateContainer (SIMIX_get_clock(), str, "MPI_PROCESS",
38 SIMIX_host_get_name(SIMIX_host_self()), str);
41 void TRACE_smpi_finalize (int rank)
43 if (!IS_TRACING_SMPI) return;
46 pajeDestroyContainer (SIMIX_get_clock(), "MPI_PROCESS",
47 _TRACE_smpi_container (rank, str, 100));
50 void TRACE_smpi_collective_in (int rank, int root, const char *operation)
52 if (!IS_TRACING_SMPI) return;
55 pajePushState (SIMIX_get_clock(), "MPI_STATE",
56 _TRACE_smpi_container (rank, str, 100), operation);
59 void TRACE_smpi_collective_out (int rank, int root, const char *operation)
61 if (!IS_TRACING_SMPI) return;
64 pajePopState (SIMIX_get_clock(), "MPI_STATE",
65 _TRACE_smpi_container (rank, str, 100));