|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifndef RLOG_MACROS_H_INCLUDED
|
|
Packit Service |
c5cf8c |
#define RLOG_MACROS_H_INCLUDED
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "rlog.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifndef MPIDM_Wtime_todouble
|
|
Packit Service |
c5cf8c |
#error Failed to select a defintion for MPIDM_Wtime_todouble
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* prototype the initialization/finalization functions */
|
|
Packit Service |
c5cf8c |
int MPII_Timer_init(int rank, int size);
|
|
Packit Service |
c5cf8c |
int MPII_Timer_finalize(void);
|
|
Packit Service |
c5cf8c |
int MPII_Describe_timer_states(void);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* structures, global variables */
|
|
Packit Service |
c5cf8c |
/* FIXME: All global names should follow the prefix rules to ensure that
|
|
Packit Service |
c5cf8c |
there are no collisions with user-defined global names. g_pRLOG should be
|
|
Packit Service |
c5cf8c |
RLOGI_something */
|
|
Packit Service |
c5cf8c |
extern RLOGI_Struct *g_pRLOG;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* state declaration macros */
|
|
Packit Service |
c5cf8c |
#define RLOG_STATE_DECL(a) MPID_Time_t time_stamp_in##a , time_stamp_out##a
|
|
Packit Service |
c5cf8c |
#define RLOG_INIT_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_FINALIZE_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* function enter and exit macros */
|
|
Packit Service |
c5cf8c |
#define RLOG_FUNC_ENTER(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
g_pRLOG->nRecursion++; \
|
|
Packit Service |
c5cf8c |
MPID_Wtime(&time_stamp_in##a); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOGI_MACRO_HEADER_CAST() ((RLOGI_HEADER*)g_pRLOG->pOutput->pCurHeader)
|
|
Packit Service |
c5cf8c |
#define RLOGI_MACRO_EVENT_CAST() ((RLOGI_EVENT*)((char*)g_pRLOG->pOutput->pCurHeader + sizeof(RLOGI_HEADER)))
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_FUNC_EXIT(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG->bLogging) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
double d1, d2; \
|
|
Packit Service |
c5cf8c |
MPID_Wtime(&time_stamp_out##a); \
|
|
Packit Service |
c5cf8c |
MPIDM_Wtime_todouble((&time_stamp_in##a), &d1;; \
|
|
Packit Service |
c5cf8c |
MPIDM_Wtime_todouble((&time_stamp_out##a), &d2;; \
|
|
Packit Service |
c5cf8c |
g_pRLOG->nRecursion--; \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG->pOutput->pCurHeader + sizeof(RLOGI_HEADER) + sizeof(RLOGI_EVENT) > g_pRLOG->pOutput->pEnd) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
WriteCurrentDataAndLogEvent(g_pRLOG, a , d1, d2, g_pRLOG->nRecursion); \
|
|
Packit Service |
c5cf8c |
} \
|
|
Packit Service |
c5cf8c |
else \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_HEADER_CAST()->type = RLOGI_EVENT_TYPE; \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_HEADER_CAST()->length = sizeof(RLOGI_HEADER) + sizeof(RLOGI_EVENT); \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_EVENT_CAST()->rank = g_pRLOG->nRank; \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_EVENT_CAST()->end_time = d2 - g_pRLOG->dFirstTimestamp; \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_EVENT_CAST()->start_time = d1 - g_pRLOG->dFirstTimestamp; \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_EVENT_CAST()->event = a ; \
|
|
Packit Service |
c5cf8c |
RLOGI_MACRO_EVENT_CAST()->recursion = g_pRLOG->nRecursion; \
|
|
Packit Service |
c5cf8c |
/* advance the current position pointer */ \
|
|
Packit Service |
c5cf8c |
g_pRLOG->pOutput->pCurHeader += sizeof(RLOGI_HEADER) + sizeof(RLOGI_EVENT); \
|
|
Packit Service |
c5cf8c |
} \
|
|
Packit Service |
c5cf8c |
} \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_ENTER(a) RLOG_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_EXIT(a) RLOG_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_COLL_FUNC_ENTER(a) RLOG_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_COLL_FUNC_EXIT(a) RLOG_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_RMA_FUNC_ENTER(a) RLOG_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_RMA_FUNC_EXIT(a) RLOG_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_INIT_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_INIT_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_FINALIZE_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define RLOG_FINALIZE_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* arrow generating enter and exit macros */
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_ENTER_FRONT(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
g_pRLOG->nRecursion++; \
|
|
Packit Service |
c5cf8c |
MPID_Wtime(&time_stamp_in##a); \
|
|
Packit Service |
c5cf8c |
RLOGI_LogSend(g_pRLOG, dest, tag, count); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_ENTER_BACK(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
g_pRLOG->nRecursion++; \
|
|
Packit Service |
c5cf8c |
MPID_Wtime(&time_stamp_in##a); \
|
|
Packit Service |
c5cf8c |
RLOGI_LogRecv(g_pRLOG, source, tag, count); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_ENTER_BOTH(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
g_pRLOG->nRecursion++; \
|
|
Packit Service |
c5cf8c |
MPID_Wtime(&time_stamp_in##a); \
|
|
Packit Service |
c5cf8c |
RLOGI_LogSend(g_pRLOG, dest, sendtag, sendcount); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_EXIT_BACK(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
RLOGI_LogRecv(g_pRLOG, source, tag, count); \
|
|
Packit Service |
c5cf8c |
RLOG_PT2PT_FUNC_EXIT(a); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define RLOG_PT2PT_FUNC_EXIT_BOTH(a) \
|
|
Packit Service |
c5cf8c |
if (g_pRLOG) \
|
|
Packit Service |
c5cf8c |
{ \
|
|
Packit Service |
c5cf8c |
RLOGI_LogRecv(g_pRLOG, source, recvtag, recvcount); \
|
|
Packit Service |
c5cf8c |
RLOG_PT2PT_FUNC_EXIT(a); \
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* MPI layer definitions */
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_STATE_DECL(a) RLOG_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_INIT_STATE_DECL(a) RLOG_INIT_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_FINALIZE_STATE_DECL(a) RLOG_FINALIZE_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_ENTER(a) RLOG_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_EXIT(a) RLOG_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_ENTER(a) RLOG_PT2PT_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_EXIT(a) RLOG_PT2PT_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_COLL_ENTER(a) RLOG_COLL_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_COLL_EXIT(a) RLOG_COLL_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_RMA_ENTER(a) RLOG_RMA_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_RMA_EXIT(a) RLOG_RMA_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_INIT_ENTER(a) RLOG_INIT_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_INIT_EXIT(a) RLOG_INIT_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_FINALIZE_ENTER(a) RLOG_FINALIZE_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_FINALIZE_EXIT(a) RLOG_FINALIZE_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_ENTER_FRONT(a) RLOG_PT2PT_FUNC_ENTER_FRONT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_EXIT_FRONT(a) RLOG_PT2PT_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_ENTER_BACK(a) RLOG_PT2PT_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_EXIT_BACK(a) RLOG_PT2PT_FUNC_EXIT_BACK(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_EXIT_BOTH(a) RLOG_PT2PT_FUNC_EXIT_BOTH(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_TERSE_PT2PT_ENTER_BOTH(a) RLOG_PT2PT_FUNC_ENTER_BOTH(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_TIMING) && (HAVE_TIMING == MPICH_TIMING_KIND__LOG_DETAILED || HAVE_TIMING == MPICH_TIMING_KIND__ALL)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* device layer definitions */
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_STATE_DECL(a) RLOG_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_ENTER(a) RLOG_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_EXIT(a) RLOG_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_PT2PT_ENTER(a) RLOG_PT2PT_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_PT2PT_EXIT(a) RLOG_PT2PT_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_RMA_ENTER(a) RLOG_RMA_FUNC_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_RMA_EXIT(a) RLOG_RMA_FUNC_EXIT(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#else
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_STATE_DECL(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_PT2PT_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_PT2PT_EXIT(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_RMA_ENTER(a)
|
|
Packit Service |
c5cf8c |
#define MPIR_FUNC_VERBOSE_RMA_EXIT(a)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif /* (HAVE_TIMING == MPICH_TIMING_KIND__LOG_DETAILED || HAVE_TIMING == MPICH_TIMING_KIND__ALL) */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif /* RLOG_MACROS_H_INCLUDED */
|