throw;
}
- if (ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
- TRACE_msg_task_get_end(*task);
+ if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
+ container_t process_container = simgrid::instr::Container::by_name(instr_pid(MSG_process_self()));
+
+ std::string key = std::string("p") + std::to_string((*task)->counter);
+ simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->end_event(process_container, "SR", key);
}
return ret;
}
comm->status = MSG_TIMEOUT;
finished = true;
} catch (simgrid::CancelException& e) {
- comm->status = MSG_HOST_FAILURE;
+ comm->status = MSG_TASK_CANCELED;
finished = true;
}
catch (xbt_ex& e) {
status = MSG_TIMEOUT;
} catch (simgrid::CancelException& e) {
finished_index = e.value;
- status = MSG_HOST_FAILURE;
+ status = MSG_TASK_CANCELED;
}
catch (xbt_ex& e) {
if (e.category != network_error)
} catch (simgrid::TimeoutError& e) {
comm->status = MSG_TIMEOUT;
} catch (simgrid::CancelException& e) {
- comm->status = MSG_HOST_FAILURE;
+ comm->status = MSG_TASK_CANCELED;
}
catch (xbt_ex& e) {
if (e.category == network_error)
status = MSG_TIMEOUT;
} catch (simgrid::CancelException& e) {
finished_index = e.value;
- status = MSG_HOST_FAILURE;
+ status = MSG_TASK_CANCELED;
}
catch(xbt_ex& e) {
if (e.category == network_error) {
*/
void MSG_task_set_category (msg_task_t task, const char *category)
{
- TRACE_msg_set_task_category (task, category);
+ xbt_assert(task->category == nullptr, "Task %p(%s) already has a category (%s).", task, task->name, task->category);
+
+ // if user provides a nullptr category, task is no longer traced
+ if (category == nullptr) {
+ xbt_free(task->category);
+ task->category = nullptr;
+ XBT_DEBUG("MSG task %p(%s), category removed", task, task->name);
+ } else {
+ // set task category
+ task->category = xbt_strdup(category);
+ XBT_DEBUG("MSG task %p(%s), category %s", task, task->name, task->category);
+ }
}
/**