浏览代码

Fix recording precious MPI events even when stopping tracing during execution

Samuel Thibault 6 年之前
父节点
当前提交
13e5c6155b
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      mpi/src/starpu_mpi_fxt.h

+ 5 - 3
mpi/src/starpu_mpi_fxt.h

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012,2013,2016                           Inria
  * Copyright (C) 2010,2012,2014-2018                      CNRS
- * Copyright (C) 2010,2011,2014,2017                      Université de Bordeaux
+ * Copyright (C) 2010,2011,2014,2017,2019                 Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -66,8 +66,10 @@ static int trace_loop = 0;
 	FUT_DO_PROBE3(_STARPU_MPI_FUT_START, (rank), (worldsize), _starpu_gettid());
 #define _STARPU_MPI_TRACE_STOP(rank, worldsize)	\
 	FUT_DO_PROBE3(_STARPU_MPI_FUT_STOP, (rank), (worldsize), _starpu_gettid());
-#define _STARPU_MPI_TRACE_BARRIER(rank, worldsize, key)	\
-	FUT_DO_PROBE4(_STARPU_MPI_FUT_BARRIER, (rank), (worldsize), (key), _starpu_gettid());
+#define _STARPU_MPI_TRACE_BARRIER(rank, worldsize, key)	do {\
+	if (_starpu_fxt_started) \
+	FUT_DO_ALWAYS_PROBE4(_STARPU_MPI_FUT_BARRIER, (rank), (worldsize), (key), _starpu_gettid()); \
+} while (0)
 #define _STARPU_MPI_TRACE_ISEND_SUBMIT_BEGIN(dest, data_tag, size)	\
 	FUT_DO_PROBE4(_STARPU_MPI_FUT_ISEND_SUBMIT_BEGIN, (dest), (data_tag), (size), _starpu_gettid());
 #define _STARPU_MPI_TRACE_ISEND_SUBMIT_END(dest, data_tag, size, jobid)	\