소스 검색

Enable developer warnings only if the STARPU_DEVEL environment is defined to a non-empty value.

Samuel Thibault 14 년 전
부모
커밋
33001ecdb8

+ 5 - 0
README.dev

@@ -160,3 +160,8 @@ makes
 
   While at it, you can also comment the __cdecl definition to avoid spurious
   warnings.
+
+
+Developers warning
+------------------
+They are only enabled if the STARPU_DEVEL environment is defined to a non-empty value.

+ 4 - 0
configure.ac

@@ -1062,6 +1062,10 @@ IS_SUPPORTED_CFLAG(-Wall)
 IS_SUPPORTED_CFLAG(-Wextra)
 AC_SUBST(GLOBAL_AM_CFLAGS)
 
+if test "x$STARPU_DEVEL" != x; then
+	AC_DEFINE(STARPU_DEVEL, [1], [enable developer warnings])
+fi
+
 ###############################################################################
 #                                                                             #
 #                               GCC extensions                                #

+ 4 - 0
mpi/starpu_mpi.c

@@ -575,7 +575,9 @@ static void test_detached_requests(void)
 		if (flag)
 			starpu_mpi_req_list_erase(detached_requests, req);
 
+#ifdef STARPU_DEVEL
 #warning TODO fix memleak
+#endif
 		/* Detached requests are automatically allocated by the lib */
 		//if (req->detached)
 		//	free(req);
@@ -618,7 +620,9 @@ static void *progress_thread_func(void *arg)
         _STARPU_DEBUG("Initialize mpi: %d\n", initialize_mpi);
 
         if (initialize_mpi) {
+#ifdef STARPU_DEVEL
 #warning get real argc and argv from the application
+#endif
                 int argc = 0;
                 char **argv = NULL;
                 int thread_support;

+ 3 - 1
src/core/dependencies/cg.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -111,7 +111,9 @@ void _starpu_notify_cg(starpu_cg_t *cg)
 	
 				tag_successors->ndeps_completed++;
 
+#ifdef STARPU_DEVEL
 #warning FIXME: who locks this?
+#endif
 				if ((tag->state == STARPU_BLOCKED) &&
 					(tag_successors->ndeps == tag_successors->ndeps_completed)) {
 					/* reset the counter so that we can reuse the completion group */

+ 6 - 0
src/core/jobs.c

@@ -269,7 +269,9 @@ static unsigned _starpu_not_all_tag_deps_are_fulfilled(starpu_job_t j)
 	return ret;
 }
 
+#ifdef STARPU_DEVEL
 #warning TODO remove the job_is_already_locked parameter
+#endif
 static unsigned _starpu_not_all_task_deps_are_fulfilled(starpu_job_t j, unsigned job_is_already_locked)
 {
 	unsigned ret;
@@ -303,7 +305,9 @@ static unsigned _starpu_not_all_task_deps_are_fulfilled(starpu_job_t j, unsigned
  *	In order, we enforce tag, task and data dependencies. The task is
  *	passed to the scheduler only once all these constraints are fulfilled.
  */
+#ifdef STARPU_DEVEL
 #warning TODO remove the job_is_already_locked parameter
+#endif
 unsigned _starpu_enforce_deps_and_schedule(starpu_job_t j, unsigned job_is_already_locked)
 {
 	unsigned ret;
@@ -334,7 +338,9 @@ unsigned _starpu_enforce_deps_and_schedule(starpu_job_t j, unsigned job_is_alrea
 }
 
 /* Tag deps are already fulfilled */
+#ifdef STARPU_DEVEL
 #warning TODO remove the job_is_already_locked parameter
+#endif
 unsigned _starpu_enforce_deps_starting_from_task(starpu_job_t j, unsigned job_is_already_locked)
 {
 	unsigned ret;

+ 2 - 0
src/datawizard/filters.c

@@ -292,7 +292,9 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 				_starpu_request_mem_chunk_removal(root_handle, node);
 				isvalid = 0; 
 			}
+#ifdef STARPU_DEVEL
 #warning free the data replicate if needed
+#endif
 
 		}
 

+ 4 - 0
src/datawizard/memalloc.c

@@ -134,7 +134,9 @@ static void transfer_subtree_to_node(starpu_data_handle handle, unsigned src_nod
 			src_replicate->state = STARPU_INVALID;
 			dst_replicate->state = STARPU_OWNER;
 
+#ifdef STARPU_DEVEL
 #warning we should use requests during memory reclaim
+#endif
 			/* TODO use request !! */
 			src_replicate->refcnt++;
 			dst_replicate->refcnt++;
@@ -201,7 +203,9 @@ static size_t free_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
 //	while (_starpu_spin_trylock(&handle->header_lock))
 //		_starpu_datawizard_progress(_starpu_get_local_memory_node());
 
+#ifdef STARPU_DEVEL
 #warning can we block here ?
+#endif
 //	_starpu_spin_lock(&handle->header_lock);
 
 	if (mc->automatically_allocated && 

+ 5 - 1
src/datawizard/user_interactions.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009-2011  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -125,7 +125,9 @@ int starpu_data_acquire_cb(starpu_data_handle handle,
 	PTHREAD_MUTEX_INIT(&wrapper->lock, NULL);
 	wrapper->finished = 0;
 
+#ifdef STARPU_DEVEL
 #warning TODO instead of having the is_prefetch argument, _starpu_fetch_data shoud consider two flags: async and detached
+#endif
 	_starpu_spin_lock(&handle->header_lock);
 	handle->per_node[0].refcnt++;
 	_starpu_spin_unlock(&handle->header_lock);
@@ -414,7 +416,9 @@ void starpu_data_set_default_sequential_consistency_flag(unsigned flag)
 /* Query the status of the handle on the specified memory node. */
 void starpu_data_query_status(starpu_data_handle handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested)
 {
+#ifdef STARPU_DEVEL
 #warning FIXME
+#endif
 //	_starpu_spin_lock(&handle->header_lock);
 
 	if (is_allocated)

+ 2 - 0
src/debug/traces/starpu_fxt.c

@@ -517,7 +517,9 @@ static void handle_start_driver_copy(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 		com->comid = comid;
 		com->comm_start = get_event_time_stamp(ev, options);
 
+#ifdef STARPU_DEVEL
 #warning this is wrong with peers
+#endif
 		/* that's a hack: either src or dst is non null */
 		com->node = (src + dst);
 

+ 2 - 0
src/drivers/gordon/driver_gordon.c

@@ -337,7 +337,9 @@ void *gordon_worker_inject(struct starpu_worker_set_s *arg)
 		else {
 #ifndef NOCHAIN
 			int ret = 0;
+#ifdef STARPU_DEVEL
 #warning we should look into the local job list here !
+#endif
 
 			struct starpu_job_list_s *list = _starpu_pop_every_task();
 			/* XXX 0 is hardcoded */

+ 2 - 0
src/sched_policies/work_stealing_policy.c

@@ -132,7 +132,9 @@ static struct starpu_deque_jobq_s *select_workerq(void)
 
 #endif
 
+#ifdef STARPU_DEVEL
 #warning TODO rewrite ... this will not scale at all now
+#endif
 static struct starpu_task *ws_pop_task(void)
 {
 	struct starpu_task *task;

+ 1 - 1
tests/datawizard/acquire_release2.c

@@ -57,7 +57,7 @@ void callback(void *arg __attribute__ ((unused)))
         starpu_data_release(token_handle);
 }
 
-#warning add threads
+#warning TODO add threads
 
 int main(int argc, char **argv)
 {