int TRACE_smpi_is_enabled(void)
{
- return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI);
+ return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI) &&
+ TRACE_is_enabled();
}
int TRACE_smpi_is_grouped(void)
int TRACE_msg_task_is_enabled(void)
{
- return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK);
+ return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK) &&
+ TRACE_is_enabled();
}
int TRACE_msg_process_is_enabled(void)
{
- return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS);
+ return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS) &&
+ TRACE_is_enabled();
}
int TRACE_msg_volume_is_enabled(void)
{
- return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME);
+ return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME) &&
+ TRACE_is_enabled();
}
char *TRACE_get_filename(void)
*/
void TRACE_msg_set_process_category(m_process_t process, const char *category, const char *color)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled())) return;
+ if (!TRACE_msg_process_is_enabled()) return;
xbt_assert3(process->category == NULL,
"Process %p(%s) already has a category (%s).",
*/
void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host, m_host_t new_host)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
static long long int counter = 0;
char key[INSTR_DEFAULT_STR_SIZE];
void TRACE_msg_process_kill(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
//kill means that this process no longer exists, let's destroy it
destroyContainer (getContainer(process->name));
void TRACE_msg_process_suspend(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
+ if (!(TRACE_msg_process_is_enabled() &&
process->category)) return;
container_t process_container = getContainer (process->name);
void TRACE_msg_process_resume(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
container_t process_container = getContainer (process->name);
type_t type = getType ("MSG_PROCESS_STATE");
void TRACE_msg_process_sleep_in(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
container_t process_container = getContainer (process->name);
type_t type = getType ("MSG_PROCESS_STATE");
void TRACE_msg_process_sleep_out(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
container_t process_container = getContainer (process->name);
type_t type = getType ("MSG_PROCESS_STATE");
void TRACE_msg_process_end(m_process_t process)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_process_is_enabled() &&
- process->category)) return;
+ if (!(TRACE_msg_process_is_enabled() &&
+ process->category)) return;
//that's the end, let's destroy it
destroyContainer (getContainer(process->name));
/* MSG_task_execute related functions */
void TRACE_msg_task_execute_start(m_task_t task)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled() &&
- task->category)) return;
+ if (!(TRACE_msg_task_is_enabled() &&
+ task->category)) return;
DEBUG3("EXEC,in %p, %lld, %s", task, task->counter, task->category);
void TRACE_msg_task_execute_end(m_task_t task)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled() &&
- task->category)) return;
+ if (!(TRACE_msg_task_is_enabled() &&
+ task->category)) return;
DEBUG3("EXEC,out %p, %lld, %s", task, task->counter, task->category);
/* MSG_task_destroy related functions */
void TRACE_msg_task_destroy(m_task_t task)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled() &&
- task->category)) return;
+ if (!(TRACE_msg_task_is_enabled() &&
+ task->category)) return;
//that's the end, let's destroy it
destroyContainer (getContainer(task->name));
/* MSG_task_get related functions */
void TRACE_msg_task_get_start(void)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled())) return;
+ if (!TRACE_msg_task_is_enabled()) return;
DEBUG0("GET,in");
}
void TRACE_msg_task_get_end(double start_time, m_task_t task)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled() &&
- task->category)) return;
+ if (!(TRACE_msg_task_is_enabled() &&
+ task->category)) return;
DEBUG3("GET,out %p, %lld, %s", task, task->counter, task->category);
/* MSG_task_put related functions */
int TRACE_msg_task_put_start(m_task_t task)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled() &&
- task->category)) return 0;
+ if (!(TRACE_msg_task_is_enabled() &&
+ task->category)) return 0;
DEBUG3("PUT,in %p, %lld, %s", task, task->counter, task->category);
void TRACE_msg_task_put_end(void)
{
- if (!(TRACE_is_enabled() &&
- TRACE_msg_task_is_enabled())) return;
+ if (!TRACE_msg_task_is_enabled()) return;
DEBUG0("PUT,out");
}
void TRACE_internal_smpi_set_category (const char *category)
{
- if (!TRACE_is_active())
- return;
- if (!TRACE_smpi_is_enabled())
- return;
+ if (!TRACE_smpi_is_enabled()) return;
//declare category
TRACE_category (category);
const char *TRACE_internal_smpi_get_category (void)
{
- if (!TRACE_is_active())
- return NULL;
- if (!TRACE_smpi_is_enabled())
- return NULL;
+ if (!TRACE_smpi_is_enabled()) return NULL;
char processid[INSTR_DEFAULT_STR_SIZE];
snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
void TRACE_smpi_start(void)
{
- if (TRACE_is_enabled()) {
- TRACE_start();
- }
+ if (!TRACE_smpi_is_enabled()) return;
+
+ TRACE_start();
}
void TRACE_smpi_release(void)
{
- if (TRACE_is_enabled()) {
- TRACE_surf_release();
- TRACE_end();
- }
+ if (!TRACE_smpi_is_enabled()) return;
+
+ TRACE_surf_release();
+ TRACE_end();
}
void TRACE_smpi_init(int rank)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_finalize(int rank)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_collective_in(int rank, int root, const char *operation)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_collective_out(int rank, int root, const char *operation)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_send(int rank, int src, int dst)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char key[INSTR_DEFAULT_STR_SIZE];
TRACE_smpi_put_key(src, dst, key, INSTR_DEFAULT_STR_SIZE);
void TRACE_smpi_recv(int rank, int src, int dst)
{
- if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
- return;
+ if (!TRACE_smpi_is_enabled()) return;
char key[INSTR_DEFAULT_STR_SIZE];
TRACE_smpi_get_key(src, dst, key, INSTR_DEFAULT_STR_SIZE);