浏览代码

starpupy: move callback_func before task_submit

HE Kun 4 年之前
父节点
当前提交
a2685e8c0c
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      starpupy/src/starpu_task_wrapper.c

+ 5 - 2
starpupy/src/starpu_task_wrapper.c

@@ -13,6 +13,7 @@
  *
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
+#undef NDEBUG
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
@@ -373,12 +374,14 @@ static PyObject* starpu_task_submit_wrapper(PyObject *self, PyObject *args)
     task->flops=flops;
     task->flops=flops;
   }
   }
 
 
+  task->callback_func=&cb_func;
+
 	/*call starpu_task_submit method*/
 	/*call starpu_task_submit method*/
   Py_BEGIN_ALLOW_THREADS
   Py_BEGIN_ALLOW_THREADS
 	int ret = starpu_task_submit(task);
 	int ret = starpu_task_submit(task);
-  Py_END_ALLOW_THREADS
 	assert(ret==0);
 	assert(ret==0);
-	task->callback_func=&cb_func;
+  Py_END_ALLOW_THREADS
+	
 	if (strcmp(tp_perf, "PyCapsule")==0)
 	if (strcmp(tp_perf, "PyCapsule")==0)
 	{
 	{
 		struct starpu_perfmodel *perf =(struct starpu_perfmodel *) func_cl->model;
 		struct starpu_perfmodel *perf =(struct starpu_perfmodel *) func_cl->model;