Skip to content

Commit

Permalink
Add logging to collective shim
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycurtis committed Jun 16, 2022
1 parent 3af51f2 commit de64e02
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 32 deletions.
26 changes: 26 additions & 0 deletions src/api/collectives/shcoll-shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void
shmem_alltoall32(void *target, const void *source, size_t nelems,
int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.alltoall.f32(target, source, nelems,
PE_start, logPE_stride, PE_size, pSync);
}
Expand All @@ -60,6 +62,8 @@ void
shmem_alltoall64(void *target, const void *source, size_t nelems,
int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.alltoall.f64(target, source, nelems,
PE_start, logPE_stride, PE_size, pSync);
}
Expand All @@ -77,6 +81,8 @@ shmem_alltoalls32(void *target, const void *source,
int PE_start, int logPE_stride, int PE_size,
long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.alltoalls.f32(target, source,
dst, sst, nelems,
PE_start, logPE_stride, PE_size,
Expand All @@ -89,6 +95,8 @@ shmem_alltoalls64(void *target, const void *source,
int PE_start, int logPE_stride, int PE_size,
long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.alltoalls.f64(target, source,
dst, sst, nelems,
PE_start, logPE_stride, PE_size,
Expand All @@ -106,6 +114,8 @@ void
shmem_collect32(void *target, const void *source, size_t nelems,
int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.collect.f32(target, source, nelems,
PE_start, logPE_stride, PE_size, pSync);
}
Expand All @@ -129,6 +139,8 @@ void
shmem_fcollect32(void *target, const void *source, size_t nelems,
int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.fcollect.f32(target, source, nelems,
PE_start, logPE_stride, PE_size, pSync);
}
Expand All @@ -137,6 +149,8 @@ void
shmem_fcollect64(void *target, const void *source, size_t nelems,
int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.fcollect.f64(target, source, nelems,
PE_start, logPE_stride, PE_size, pSync);
}
Expand All @@ -149,6 +163,8 @@ shmem_fcollect64(void *target, const void *source, size_t nelems,
void
shmem_barrier(int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.barrier.f(PE_start, logPE_stride, PE_size, pSync);
}

Expand All @@ -166,6 +182,8 @@ extern long *shmemc_sync_all_psync;
void
shmem_barrier_all(void)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.barrier_all.f(shmemc_barrier_all_psync);
}

Expand All @@ -177,6 +195,8 @@ shmem_barrier_all(void)
void
shmem_sync(int PE_start, int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.sync.f(PE_start, logPE_stride, PE_size, pSync);
}

Expand All @@ -188,6 +208,8 @@ shmem_sync(int PE_start, int logPE_stride, int PE_size, long *pSync)
void
shmem_sync_all(void)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.sync_all.f(shmemc_sync_all_psync);
}

Expand All @@ -203,6 +225,8 @@ shmem_broadcast32(void *target, const void *source,
size_t nelems, int PE_root, int PE_start,
int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.broadcast.f32(target, source,
nelems, PE_root, PE_start,
logPE_stride, PE_size, pSync);
Expand All @@ -213,6 +237,8 @@ shmem_broadcast64(void *target, const void *source,
size_t nelems, int PE_root, int PE_start,
int logPE_stride, int PE_size, long *pSync)
{
logger(LOG_COLLECTIVES, "%s()", __func__);

colls.broadcast.f64(target, source,
nelems, PE_root, PE_start,
logPE_stride, PE_size, pSync);
Expand Down
30 changes: 15 additions & 15 deletions src/shmemu/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ shmemu_logger_init(void)

events = kh_init(events_hash);

event_set(LOG_INIT, false);
event_set(LOG_FINALIZE, false);
event_set(LOG_MEMORY, false);
event_set(LOG_FENCE, false);
event_set(LOG_QUIET, false);
event_set(LOG_HEAPS, false);
event_set(LOG_RMA, false);
event_set(LOG_CONTEXTS, false);
event_set(LOG_RANKS, false);
event_set(LOG_INFO, false);
event_set(LOG_REDUCTIONS, false);
event_set(LOG_BARRIERS, false);
event_set(LOG_DEPRECATE, false);
event_set(LOG_LOCKS, false);
event_set(LOG_ATOMICS, false);
event_set(LOG_INIT, false);
event_set(LOG_FINALIZE, false);
event_set(LOG_MEMORY, false);
event_set(LOG_FENCE, false);
event_set(LOG_QUIET, false);
event_set(LOG_HEAPS, false);
event_set(LOG_RMA, false);
event_set(LOG_CONTEXTS, false);
event_set(LOG_RANKS, false);
event_set(LOG_INFO, false);
event_set(LOG_REDUCTIONS, false);
event_set(LOG_COLLECTIVES, false);
event_set(LOG_DEPRECATE, false);
event_set(LOG_LOCKS, false);
event_set(LOG_ATOMICS, false);

parse_log_events();

Expand Down
34 changes: 17 additions & 17 deletions src/shmemu/shmemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ const char *shmemu_plural(size_t n);
* message logging (cf. logger.c to init these)
*/

#define LOG_ALL "ALL"
#define LOG_INIT "INIT"
#define LOG_FINALIZE "FINALIZE"
#define LOG_MEMORY "MEMORY"
#define LOG_RMA "RMA"
#define LOG_FENCE "FENCE"
#define LOG_QUIET "QUIET"
#define LOG_HEAPS "HEAPS"
#define LOG_CONTEXTS "CONTEXTS"
#define LOG_RANKS "RANKS"
#define LOG_INFO "INFO"
#define LOG_REDUCTIONS "REDUCTIONS"
#define LOG_BARRIERS "BARRIERS"
#define LOG_DEPRECATE "DEPRECATE"
#define LOG_LOCKS "LOCKS"
#define LOG_ATOMICS "ATOMICS"
#define LOG_UNKNOWN "UNKNOWN"
#define LOG_ALL "ALL"
#define LOG_INIT "INIT"
#define LOG_FINALIZE "FINALIZE"
#define LOG_MEMORY "MEMORY"
#define LOG_RMA "RMA"
#define LOG_FENCE "FENCE"
#define LOG_QUIET "QUIET"
#define LOG_HEAPS "HEAPS"
#define LOG_CONTEXTS "CONTEXTS"
#define LOG_RANKS "RANKS"
#define LOG_INFO "INFO"
#define LOG_REDUCTIONS "REDUCTIONS"
#define LOG_COLLECTIVES "COLLECTIVES"
#define LOG_DEPRECATE "DEPRECATE"
#define LOG_LOCKS "LOCKS"
#define LOG_ATOMICS "ATOMICS"
#define LOG_UNKNOWN "UNKNOWN"

/*
* bail out on major problems early/late on during setup/finalize,
Expand Down

0 comments on commit de64e02

Please sign in to comment.