浏览代码

backport branches/starpu-1.1@13065: src/datawizard/interfaces/data_interface.c: only display message once when calling starpu_data_set_rank and starpu_data_set_tag

Nathalie Furmento 11 年之前
父节点
当前提交
733a26726d
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/datawizard/interfaces/data_interface.c

+ 12 - 2
src/datawizard/interfaces/data_interface.c

@@ -417,7 +417,12 @@ int _starpu_data_set_rank(starpu_data_handle_t handle, int rank)
 
 int starpu_data_set_rank(starpu_data_handle_t handle, int rank)
 {
-	_STARPU_DISP("Warning: You should call starpu_mpi_data_register which will insure MPI cache will be cleared when unregistering the data\n");
+	static int first=1;
+	if (first)
+	{
+		_STARPU_DISP("Warning: You should call starpu_mpi_data_register which will insure MPI cache will be cleared when unregistering the data\n");
+		first=0;
+	}
 	return _starpu_data_set_rank(handle, rank);
 }
 
@@ -466,7 +471,12 @@ int _starpu_data_set_tag(starpu_data_handle_t handle, int tag)
 
 int starpu_data_set_tag(starpu_data_handle_t handle, int tag)
 {
-	_STARPU_DISP("Warning: You should call starpu_mpi_data_register which will insure MPI cache will be cleared when unregistering the data\n");
+	static int first=1;
+	if (first)
+	{
+		_STARPU_DISP("Warning: You should call starpu_mpi_data_register which will insure MPI cache will be cleared when unregistering the data\n");
+		first=0;
+	}
 	return _starpu_data_set_tag(handle, tag);
 }