From 4aa1cd22325b98b31547d515f870d99ba2057d5f Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 4 Sep 2014 17:47:08 +0200 Subject: [PATCH] avoid warnings (and errors) without debug enabled --- src/msg/msg_task.c | 3 +-- src/msg/msg_vm.c | 9 ++++++--- src/simix/smx_vm.c | 3 +-- src/xbt/log.c | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/msg/msg_task.c b/src/msg/msg_task.c index 56fbb1e4f5..537364d752 100644 --- a/src/msg/msg_task.c +++ b/src/msg/msg_task.c @@ -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. */ - 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)); diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 3741d9c309..64c3a49680 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -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_assert(ret == MSG_OK); + if(ret != MSG_OK) + xbt_die("shutdown error - task not sent"); 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_assert(ret == MSG_OK); + if(ret != MSG_OK) + xbt_die("req overhead error - task not sent"); 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); - xbt_assert(ret == MSG_OK); + if(ret != MSG_OK) + xbt_die("migration error - task not sent"); xbt_free(mtask_name); } diff --git a/src/simix/smx_vm.c b/src/simix/smx_vm.c index 8f1e9c1fcf..d91b857b7d 100644 --- a/src/simix/smx_vm.c +++ b/src/simix/smx_vm.c @@ -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 */ - 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); diff --git a/src/xbt/log.c b/src/xbt/log.c index 410bf813cb..80394daf24 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -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, " "); - 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; -- 2.20.1