瀏覽代碼

nmad: fix initialization of callback_stack

To be compliant with PadicoTM SVN revision 5434
Philippe SWARTVAGHER 5 年之前
父節點
當前提交
e793016141
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      mpi/src/nmad/starpu_mpi_nmad.c

+ 6 - 2
mpi/src/nmad/starpu_mpi_nmad.c

@@ -67,8 +67,8 @@ static volatile int pending_request = 0;
 
 #define REQ_FINALIZED 0x1
 
-PUK_LFSTACK_TYPE(callback,	struct _starpu_mpi_req *req;);
-static callback_lfstack_t callback_stack = NULL;
+PUK_LFSTACK_TYPE(callback, struct _starpu_mpi_req *req;);
+static callback_lfstack_t callback_stack;
 
 static starpu_sem_t callback_sem;
 
@@ -594,6 +594,8 @@ int _starpu_mpi_progress_init(struct _starpu_mpi_argc_argv *argc_argv)
 		_starpu_mpi_thread_cpuid = starpu_get_next_bindid(STARPU_THREAD_ACTIVE, NULL, 0);
 	}
 
+	callback_lfstack_init(&callback_stack);
+
 	/* Tell pioman to use a bound thread for communication progression:
 	 * share the same core as StarPU's MPI thread, the MPI thread has very low activity with NMAD backend */
 	int indexes[1] = { _starpu_mpi_thread_cpuid };
@@ -663,6 +665,8 @@ void _starpu_mpi_progress_shutdown(void **value)
 
 	STARPU_PTHREAD_JOIN(progress_thread, value);
 
+	callback_lfstack_destroy(&callback_stack);
+
         STARPU_PTHREAD_MUTEX_DESTROY(&progress_mutex);
         STARPU_PTHREAD_COND_DESTROY(&progress_cond);
 }