From: Takishipp Date: Fri, 21 Jul 2017 10:34:32 +0000 (+0200) Subject: fix conflict X-Git-Tag: v3_17~322^2~4^2^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1366b293e8c700b12567e45076cf0e6b7a25478f?hp=e3397fde30788e5ba847cc9e1ad2d97425275aec fix conflict --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index ac336cc92c..dfe6eb196e 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -176,7 +176,7 @@ void TRACE_declare_mark(const char *mark_type) * \see TRACE_mark */ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mark_value, const char *mark_color) -{ +{ paje_value pj_value; /* safe switches. tracing has to be activated and if platform is not traced, we can't deal with marks */ if (not TRACE_is_enabled() || not TRACE_needs_platform()) return; @@ -231,7 +231,7 @@ void TRACE_declare_mark_value (const char *mark_type, const char *mark_value) * \see TRACE_declare_mark */ void TRACE_mark(const char *mark_type, const char *mark_value) -{ +{ paje_value pj_value; /* safe switches. tracing has to be activated and if platform is not traced, we can't deal with marks */ if (not TRACE_is_enabled() || not TRACE_needs_platform()) return; @@ -247,7 +247,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value) THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type); } - val_t value = PJ_value_get (mark_value, type); + val_t value = pj_value.PJ_value_get (mark_value, type); XBT_DEBUG("MARK %s %s", mark_type, mark_value); new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value); } @@ -947,10 +947,10 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const * \see TRACE_host_state_declare, TRACE_host_push_state, TRACE_host_pop_state, TRACE_host_reset_state */ void TRACE_host_set_state (const char *host, const char *state, const char *value) -{ +{ paje_value pj_value; container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ + val_t val = pj_value.PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new SetStateEvent(MSG_get_clock(), container, type, val); } @@ -966,10 +966,10 @@ void TRACE_host_set_state (const char *host, const char *state, const char *valu * \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_pop_state, TRACE_host_reset_state */ void TRACE_host_push_state (const char *host, const char *state, const char *value) -{ +{ paje_value pj_value; container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ + val_t val = pj_value.PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new PushStateEvent(MSG_get_clock(), container, type, val); } diff --git a/src/instr/instr_paje_values.cpp b/src/instr/instr_paje_values.cpp index 2c4f8bd9db..9e60ab1db3 100644 --- a/src/instr/instr_paje_values.cpp +++ b/src/instr/instr_paje_values.cpp @@ -45,11 +45,11 @@ s_val::s_val(const char *name, const char *color, type_t father){ LogEntityValue(this->ret); }; -val_t PJ_value_get_or_new (const char *name, const char *color, type_t father) -{ +val_t paje_value :: PJ_value_get_or_new (const char *name, const char *color, type_t father) +{ paje_value pj_value; val_t ret = 0; try { - ret = PJ_value_get(name, father); + ret = pj_value.PJ_value_get(name, father); } catch(xbt_ex& e) { s_val rett(name, color, father); @@ -58,7 +58,7 @@ val_t PJ_value_get_or_new (const char *name, const char *color, type_t father) return ret; } -val_t PJ_value_get (const char *name, type_t father) +val_t paje_value::PJ_value_get (const char *name, type_t father) { if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)"); diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index bc6112d766..7be771e5c6 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -265,6 +265,14 @@ class NewEvent : public PajeEvent { }; +class paje_value{ + public: + paje_value(){}; + ~paje_value(){}; + val_t PJ_value_new (const char *name, const char *color, type_t father); + val_t PJ_value_get (const char *name, type_t father); + val_t PJ_value_get_or_new (const char *name, const char *color, type_t father); +}; extern XBT_PRIVATE xbt_dict_t created_categories; extern XBT_PRIVATE xbt_dict_t declared_marks; diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index 21a13553d0..856923b245 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -87,14 +87,14 @@ void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t proc } void TRACE_msg_process_suspend(msg_process_t process) -{ +{ paje_value pj_value; if (TRACE_msg_process_is_enabled()){ int len = INSTR_DEFAULT_STR_SIZE; char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = PJ_value_get ("suspend", type); + val_t value = pj_value.PJ_value_get ("suspend", type); new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -112,14 +112,14 @@ void TRACE_msg_process_resume(msg_process_t process) } void TRACE_msg_process_sleep_in(msg_process_t process) -{ +{ paje_value pj_value; if (TRACE_msg_process_is_enabled()){ int len = INSTR_DEFAULT_STR_SIZE; char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = PJ_value_get ("sleep", type); + val_t value = pj_value.PJ_value_get ("sleep", type); new PushStateEvent (MSG_get_clock(), process_container, type, value); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index fb5862813c..b211d1fdf0 100644 --- a/src/msg/instr_msg_task.cpp +++ b/src/msg/instr_msg_task.cpp @@ -45,7 +45,7 @@ void TRACE_msg_task_create(msg_task_t task) /* MSG_task_execute related functions */ void TRACE_msg_task_execute_start(msg_task_t task) -{ +{ paje_value pj_value; XBT_DEBUG("EXEC,in %p, %lld, %s", task, task->counter, task->category); if (TRACE_msg_process_is_enabled()){ @@ -54,7 +54,7 @@ void TRACE_msg_task_execute_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = PJ_value_get ("task_execute", type); + val_t value = pj_value.PJ_value_get ("task_execute", type); new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -85,7 +85,7 @@ void TRACE_msg_task_destroy(msg_task_t task) /* MSG_task_get related functions */ void TRACE_msg_task_get_start() -{ +{ paje_value pj_value; XBT_DEBUG("GET,in"); if (TRACE_msg_process_is_enabled()){ @@ -94,7 +94,7 @@ void TRACE_msg_task_get_start() container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = PJ_value_get ("receive", type); + val_t value = pj_value.PJ_value_get ("receive", type); new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -120,7 +120,7 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task) /* MSG_task_put related functions */ int TRACE_msg_task_put_start(msg_task_t task) -{ +{ paje_value pj_value; XBT_DEBUG("PUT,in %p, %lld, %s", task, task->counter, task->category); if (TRACE_msg_process_is_enabled()){ @@ -129,7 +129,7 @@ int TRACE_msg_task_put_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - val_t value = PJ_value_get ("send", type); + val_t value = pj_value.PJ_value_get ("send", type); new PushStateEvent (MSG_get_clock(), process_container, type, value); char key[INSTR_DEFAULT_STR_SIZE]; diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index 2eb403d578..60b752c6b4 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -183,7 +183,7 @@ void MSG_vm_destroy(msg_vm_t vm) * If the VM cannot be started (because of memory over-provisioning), an exception is generated. */ void MSG_vm_start(msg_vm_t vm) -{ +{ paje_value pj_value; simgrid::simix::kernelImmediate([vm]() { simgrid::vm::VmHostExt::ensureVmExtInstalled(); @@ -215,7 +215,7 @@ void MSG_vm_start(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); - val_t value = PJ_value_get_or_new("start", "0 0 1", type); // start is blue + val_t value = pj_value.PJ_value_get_or_new("start", "0 0 1", type); // start is blue new PushStateEvent(MSG_get_clock(), vm_container, type, value); } } @@ -806,7 +806,7 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm) * No suspension cost occurs. */ void MSG_vm_suspend(msg_vm_t vm) -{ +{ paje_value pj_value; smx_actor_t issuer = SIMIX_process_self(); simgrid::simix::kernelImmediate([vm, issuer]() { vm->pimpl_vm_->suspend(issuer); }); @@ -815,7 +815,7 @@ void MSG_vm_suspend(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); - val_t value = PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red + val_t value = pj_value.PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red new PushStateEvent(MSG_get_clock(), vm_container, type, value); } } diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index b69b56ccba..8ff4452ea7 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -13,16 +13,16 @@ //attempt to do a quick autotuning version of the collective, - -#define TRACE_AUTO_COLL(cat) \ +paje_value pj_value; +#define TRACE_AUTO_COLL(cat) \ if (TRACE_is_enabled()) { \ type_t type = PJ_type_get_or_null(#cat, PJ_type_get_root()); \ if (not type) { \ type = PJ_type_event_new(#cat, PJ_type_get_root()); \ } \ char cont_name[25]; \ - snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \ - val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ + snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \ + val_t value = pj_value.PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, value); \ } diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index eb3b1410a0..aca15f009c 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -234,7 +234,7 @@ void TRACE_smpi_finalize(int rank) } void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra) -{ +{ paje_value pj_value; if (not TRACE_smpi_is_enabled()) { cleanup_extra_data(extra); return; @@ -245,7 +245,7 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_e container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); - val_t value = PJ_value_get_or_new (operation, color, type); + val_t value = pj_value.PJ_value_get_or_new (operation, color, type); new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } @@ -263,7 +263,7 @@ void TRACE_smpi_collective_out(int rank, int root, const char *operation) } void TRACE_smpi_computing_init(int rank) -{ +{ paje_value pj_value; //first use, initialize the color in the trace if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing()) return; @@ -273,12 +273,12 @@ void TRACE_smpi_computing_init(int rank) container_t container = PJ_container_get(str); type_t type = PJ_type_get("MPI_STATE", container->type); const char* color = instr_find_color("computing"); - val_t value = PJ_value_get_or_new("computing", color, type); + val_t value = pj_value.PJ_value_get_or_new("computing", color, type); new PushStateEvent(SIMIX_get_clock(), container, type, value); } void TRACE_smpi_computing_in(int rank, instr_extra_data extra) -{ +{ paje_value pj_value; //do not forget to set the color first, otherwise this will explode if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing()) { cleanup_extra_data(extra); @@ -289,7 +289,7 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = PJ_value_get_or_new ("computing", nullptr, type); + val_t value = pj_value.PJ_value_get_or_new ("computing", nullptr, type); new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } @@ -305,7 +305,7 @@ void TRACE_smpi_computing_out(int rank) } void TRACE_smpi_sleeping_init(int rank) -{ +{ paje_value pj_value; //first use, initialize the color in the trace if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping()) return; @@ -315,12 +315,12 @@ void TRACE_smpi_sleeping_init(int rank) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color ("sleeping"); - val_t value = PJ_value_get_or_new ("sleeping", color, type); + val_t value = pj_value.PJ_value_get_or_new ("sleeping", color, type); new PushStateEvent (SIMIX_get_clock(), container, type, value); } void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) -{ +{ paje_value pj_value; //do not forget to set the color first, otherwise this will explode if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping()) { cleanup_extra_data(extra); @@ -331,7 +331,7 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = PJ_value_get_or_new ("sleeping", nullptr, type); + val_t value = pj_value.PJ_value_get_or_new ("sleeping", nullptr, type); new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } @@ -347,7 +347,7 @@ void TRACE_smpi_sleeping_out(int rank) } void TRACE_smpi_testing_in(int rank, instr_extra_data extra) -{ +{ paje_value pj_value; //do not forget to set the color first, otherwise this will explode if (not TRACE_smpi_is_enabled()) { cleanup_extra_data(extra); @@ -358,7 +358,7 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - val_t value = PJ_value_get_or_new ("test", nullptr, type); + val_t value = pj_value.PJ_value_get_or_new ("test", nullptr, type); new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } @@ -374,7 +374,7 @@ void TRACE_smpi_testing_out(int rank) } void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra) -{ +{ paje_value pj_value; if (not TRACE_smpi_is_enabled()) { cleanup_extra_data(extra); return; @@ -385,7 +385,7 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_ container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); - val_t value = PJ_value_get_or_new (operation, color, type); + val_t value = pj_value.PJ_value_get_or_new (operation, color, type); new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 827b7adb97..7044975d24 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -234,7 +234,7 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link) } static void sg_instr_new_host(simgrid::s4u::Host& host) -{ +{ paje_value pj_value; container_t father = currentContainer.back(); container_t container = PJ_container_new(host.getCname(), INSTR_HOST, father); @@ -401,7 +401,7 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam } static void recursiveNewValueForUserStateType (const char *type_name, const char *value, const char *color, type_t root) -{ +{ paje_value pj_value; if (not strcmp(root->name, type_name)) { s_val PJ_value (value, color, root); }