Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
avoid warnings (and errors) without debug enabled
authorAugustin Degomme <augustin.degomme@imag.fr>
Thu, 4 Sep 2014 15:47:08 +0000 (17:47 +0200)
committerAugustin Degomme <augustin.degomme@imag.fr>
Thu, 11 Sep 2014 12:24:48 +0000 (14:24 +0200)
src/msg/msg_task.c
src/msg/msg_vm.c
src/simix/smx_vm.c
src/xbt/log.c

index 56fbb1e..537364d 100644 (file)
@@ -546,8 +546,7 @@ void MSG_task_set_affinity(msg_task_t task, msg_host_t host, unsigned long mask)
     /* task is being executed on this host. so change the affinity now */
     {
       /* check it works. remove me if it works. */
     /* task is being executed on this host. so change the affinity now */
     {
       /* check it works. remove me if it works. */
-      unsigned long affinity_mask = (unsigned long) xbt_dict_get_or_null_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(msg_host_t));
-      xbt_assert(affinity_mask == mask);
+      xbt_assert((unsigned long) xbt_dict_get_or_null_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(msg_host_t)) == mask);
     }
 
     XBT_INFO("set affinity(0x%04lx@%s) for %s", mask, MSG_host_get_name(host), MSG_task_get_name(task));
     }
 
     XBT_INFO("set affinity(0x%04lx@%s) for %s", mask, MSG_host_get_name(host), MSG_task_get_name(task));
index 3741d9c..64c3a49 100644 (file)
@@ -683,7 +683,8 @@ static void shutdown_overhead_process(msg_task_t comm_task)
 
   // XBT_INFO("micro shutdown: mbox %s", mbox);
   msg_error_t ret = MSG_task_send(task, mbox);
 
   // XBT_INFO("micro shutdown: mbox %s", mbox);
   msg_error_t ret = MSG_task_send(task, mbox);
-  xbt_assert(ret == MSG_OK);
+  if(ret != MSG_OK)
+    xbt_die("shutdown error - task not sent");
 
   xbt_free(mbox);
   // XBT_INFO("shutdown done");
 
   xbt_free(mbox);
   // XBT_INFO("shutdown done");
@@ -697,7 +698,8 @@ static void request_overhead(msg_task_t comm_task, double computation)
 
   // XBT_INFO("req overhead");
   msg_error_t ret = MSG_task_send(task, mbox);
 
   // XBT_INFO("req overhead");
   msg_error_t ret = MSG_task_send(task, mbox);
-  xbt_assert(ret == MSG_OK);
+  if(ret != MSG_OK)
+    xbt_die("req overhead error - task not sent");
 
   xbt_free(mbox);
 }
 
   xbt_free(mbox);
 }
@@ -738,7 +740,8 @@ static void task_send_bounded_with_cpu_overhead(msg_task_t comm_task, char *mbox
       request_overhead(comm_task, data_size * alpha);
 
       msg_error_t ret = MSG_task_send(mtask, mbox);
       request_overhead(comm_task, data_size * alpha);
 
       msg_error_t ret = MSG_task_send(mtask, mbox);
-      xbt_assert(ret == MSG_OK);
+      if(ret != MSG_OK)
+        xbt_die("migration error - task not sent");
 
       xbt_free(mtask_name);
     }
 
       xbt_free(mtask_name);
     }
index 8f1e9c1..d91b857 100644 (file)
@@ -128,8 +128,7 @@ int SIMIX_pre_vm_get_state(smx_simcall_t simcall, smx_host_t ind_vm)
 void SIMIX_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm)
 {
   /* precopy migration makes the VM temporally paused */
 void SIMIX_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm)
 {
   /* precopy migration makes the VM temporally paused */
-  e_surf_vm_state_t state = SIMIX_vm_get_state(ind_vm);
-  xbt_assert(state == SURF_VM_STATE_SUSPENDED);
+  xbt_assert(SIMIX_vm_get_state(ind_vm) == SURF_VM_STATE_SUSPENDED);
 
   /* jump to vm_ws_xigrate(). this will update the vm location. */
   surf_vm_workstation_migrate(ind_vm, ind_dst_pm);
 
   /* jump to vm_ws_xigrate(). this will update the vm location. */
   surf_vm_workstation_migrate(ind_vm, ind_dst_pm);
index 410bf81..80394da 100644 (file)
@@ -1098,8 +1098,8 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
   eq = control_string;
   control_string += strcspn(control_string, " ");
 
   eq = control_string;
   control_string += strcspn(control_string, " ");
 
-  xbt_assert(*dot == '.' && (*eq == '=' || *eq == ':'),
-              "Invalid control string '%s'", orig_control_string);
+  if(*dot != '.' && (*eq == '=' || *eq == ':'))
+    xbt_die ("Invalid control string '%s'", orig_control_string);
 
   if (!strncmp(dot + 1, "threshold", (size_t) (eq - dot - 1))) {
     int i;
 
   if (!strncmp(dot + 1, "threshold", (size_t) (eq - dot - 1))) {
     int i;