Browse Source

mpi: new function starpu_mpi_cache_is_enabled()

Nathalie Furmento 10 years ago
parent
commit
ebed5dd827
3 changed files with 14 additions and 2 deletions
  1. 6 1
      doc/doxygen/chapters/api/mpi.doxy
  2. 3 1
      mpi/include/starpu_mpi.h
  3. 5 0
      mpi/src/starpu_mpi_cache.c

+ 6 - 1
doc/doxygen/chapters/api/mpi.doxy

@@ -1,7 +1,7 @@
 /*
 /*
  * This file is part of the StarPU Handbook.
  * This file is part of the StarPU Handbook.
  * Copyright (C) 2009--2011  Universit@'e de Bordeaux
  * Copyright (C) 2009--2011  Universit@'e de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  * See the file version.doxy for copying conditions.
  * See the file version.doxy for copying conditions.
  */
  */
@@ -191,8 +191,13 @@ todo
 @name Communication Cache
 @name Communication Cache
 \ingroup API_MPI_Support
 \ingroup API_MPI_Support
 
 
+\fn void starpu_mpi_cache_is_enabled()
+\ingroup API_MPI_Support
+Return 1 if the communication cache is enabled, 0 otherwise
+
 \fn void starpu_mpi_cache_flush(MPI_Comm comm, starpu_data_handle_t data_handle)
 \fn void starpu_mpi_cache_flush(MPI_Comm comm, starpu_data_handle_t data_handle)
 \ingroup API_MPI_Support
 \ingroup API_MPI_Support
+
 Clear the send and receive communication cache for the data
 Clear the send and receive communication cache for the data
 \p data_handle and invalidate the value. The function has to be called synchronously by all the
 \p data_handle and invalidate the value. The function has to be called synchronously by all the
 MPI nodes. The function does nothing if the cache mechanism is
 MPI nodes. The function does nothing if the cache mechanism is

+ 3 - 1
mpi/include/starpu_mpi.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009-2012, 2014-2015  Université de Bordeaux
  * Copyright (C) 2009-2012, 2014-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -85,6 +85,8 @@ void starpu_mpi_data_register(starpu_data_handle_t data_handle, int tag, int ran
 char *starpu_mpi_node_selection_get_default_policy();
 char *starpu_mpi_node_selection_get_default_policy();
 int starpu_mpi_node_selection_set_default_policy(char *policy);
 int starpu_mpi_node_selection_set_default_policy(char *policy);
 
 
+int starpu_mpi_cache_is_enabled();
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 5 - 0
mpi/src/starpu_mpi_cache.c

@@ -36,6 +36,11 @@ static struct _starpu_data_entry **_cache_sent_data = NULL;
 static struct _starpu_data_entry **_cache_received_data = NULL;
 static struct _starpu_data_entry **_cache_received_data = NULL;
 int _starpu_cache_enabled=1;
 int _starpu_cache_enabled=1;
 
 
+int starpu_mpi_cache_is_enabled()
+{
+	return _starpu_cache_enabled==1;
+}
+
 void _starpu_mpi_cache_init(MPI_Comm comm)
 void _starpu_mpi_cache_init(MPI_Comm comm)
 {
 {
 	int nb_nodes;
 	int nb_nodes;