Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make sure that MSG_task_execute() is not called by error on parallel tasks
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 16 Jun 2010 09:39:44 +0000 (09:39 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 16 Jun 2010 09:39:44 +0000 (09:39 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7875 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/gos.c

index 0b22f51..54b4fa8 100644 (file)
@@ -39,11 +39,15 @@ MSG_error_t MSG_task_execute(m_task_t task)
   m_process_t self = MSG_process_self();
   e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   CHECK_HOST();
   m_process_t self = MSG_process_self();
   e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   CHECK_HOST();
+
+  simdata = task->simdata;
+
+  xbt_assert0(simdata->host_nb==0, "This is a parallel task. Go to hell.");
+
 #ifdef HAVE_TRACING
   TRACE_msg_task_execute_start (task);
 #endif
 
 #ifdef HAVE_TRACING
   TRACE_msg_task_execute_start (task);
 #endif
 
-  simdata = task->simdata;
 
   xbt_assert1((!simdata->compute) && (task->simdata->refcount == 1),
               "This task is executed somewhere else. Go fix your code! %d", task->simdata->refcount);
 
   xbt_assert1((!simdata->compute) && (task->simdata->refcount == 1),
               "This task is executed somewhere else. Go fix your code! %d", task->simdata->refcount);