Browse Source

make function starpu_is_initialized() public

Nathalie Furmento 8 years ago
parent
commit
1ec52668c5

+ 1 - 0
ChangeLog

@@ -54,6 +54,7 @@ Small changes:
   * Use asynchronous transfers for task data fetches with were not prefetched.
   * Allow to call starpu_sched_ctx_set_policy_data on the main
     scheduler context
+  * Fonction starpu_is_initialized() is moved to the public API.
 
 StarPU 1.2.2 (svn revision xxx)
 ==============================================

+ 4 - 0
doc/doxygen/chapters/api/initialization.doxy

@@ -257,6 +257,10 @@ field starpu_conf::calibrate of \p conf. Upon successful
 completion, this function returns 0. Otherwise, <c>-EINVAL</c> indicates that
 the argument was <c>NULL</c>.
 
+\fn int starpu_is_initialized(void)
+\ingroup API_Initialization_and_Termination
+Return 1 if StarPU is already initialized.
+
 \fn void starpu_shutdown(void)
 \ingroup API_Initialization_and_Termination
 This is StarPU termination method. It must be called at the end of the

+ 2 - 2
include/starpu.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2014, 2016-2017  Université de Bordeaux
- * Copyright (C) 2010-2015  CNRS
+ * Copyright (C) 2010-2015, 2017  CNRS
  * Copyright (C) 2014, 2016  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -145,8 +145,8 @@ struct starpu_conf
 int starpu_conf_init(struct starpu_conf *conf);
 
 int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT;
-
 int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv);
+int starpu_is_initialized(void);
 
 void starpu_pause(void);
 void starpu_resume(void);

+ 1 - 1
src/core/workers.c

@@ -90,7 +90,7 @@ char ***_starpu_get_argv()
 	return my_argv;
 }
 
-int _starpu_is_initialized(void)
+int starpu_is_initialized(void)
 {
 	return initialized == INITIALIZED;
 }

+ 0 - 2
src/core/workers.h

@@ -551,8 +551,6 @@ static inline struct _starpu_sched_ctx *_starpu_get_sched_ctx_struct(unsigned id
 
 struct _starpu_combined_worker *_starpu_get_combined_worker_struct(unsigned id);
 
-int _starpu_is_initialized(void);
-
 /* Returns the structure that describes the overall machine configuration (eg.
  * all workers and topology). */
 static inline struct _starpu_machine_config *_starpu_get_machine_config(void)

+ 1 - 1
src/datawizard/malloc.c

@@ -392,7 +392,7 @@ int starpu_free_flags(void *A, size_t dim, int flags)
 #else /* !STARPU_SIMGRID */
 #ifdef STARPU_USE_CUDA
 #ifndef HAVE_CUDA_MEMCPY_PEER
-			if (!_starpu_is_initialized())
+			if (!starpu_is_initialized())
 			{
 #endif
 				/* This is especially useful when starpu_free is called from