Skip to content

Commit d11f625

Browse files
committed
SPC: allow counters to be attached solely through MPI_T and reduce overhead
- only make MCA parameters available if SPC is enabled - do not compile SPC code if SPC is disabled - move includes into ompi_spc.c - allow counters to be enabled through MPI_T without setting MCA parameter - inline counter update calls that are likely in the critical path - fix test to succeed even if encountering invalid pvars - move timer_[start|stop] to header and move attachment info into ompi_spc_t There is no need to store the name in the ompi_spc_t struct too, we can use that space for the attachment info instead to avoid accessing another cache line. - make timer/watermark flags a property of the spc description This is meant to making adding counters easier in the future by centralizing the necessary information. By storing a copy of these flags in the ompi_spc_t structure (without adding to its size) reduces cache pollution for timer/watermark events. - allocate ompi_spc_t objects with cache-alignment This prevents objects from spanning multiple cache lines and thus ensures that only one cache line is loaded per update. - fix handling of timer and timer conversion - only call opal_timer_base_get_cycles if necesary to reduce overhead - Remove use of OPAL_UNLIKELY to improve code generated by GCC It appears that GCC makes less effort in optimizing the unlikely path and generates bloated code. - Allocate ompi_spc_events statically to reduce loads in critical path - duplicate comm_world only when dumping is requested Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 30831fb commit d11f625

File tree

4 files changed

+285
-277
lines changed

4 files changed

+285
-277
lines changed

ompi/runtime/ompi_mpi_params.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,21 +334,23 @@ int ompi_mpi_register_params(void)
334334
MCA_BASE_VAR_SCOPE_READONLY,
335335
&ompi_mpi_compat_mpi3);
336336

337+
#if SPC_ENABLE == 1
337338
ompi_mpi_spc_attach_string = NULL;
338339
(void) mca_base_var_register("ompi", "mpi", NULL, "spc_attach",
339-
"A comma delimeted string listing the software-based performance counters (SPCs) to enable.",
340+
"A comma-delimeted list of software-based performance counters (SPCs) to enable (\"all\" enables all counters).",
340341
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
341342
OPAL_INFO_LVL_4,
342343
MCA_BASE_VAR_SCOPE_READONLY,
343344
&ompi_mpi_spc_attach_string);
344345

345346
ompi_mpi_spc_dump_enabled = false;
346347
(void) mca_base_var_register("ompi", "mpi", NULL, "spc_dump_enabled",
347-
"A boolean value for whether (true) or not (false) to enable dumping SPC counters in MPI_Finalize.",
348+
"A boolean value for whether (true) or not (false) to enable dumping enabled SPC counters in MPI_Finalize.",
348349
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
349350
OPAL_INFO_LVL_4,
350351
MCA_BASE_VAR_SCOPE_READONLY,
351352
&ompi_mpi_spc_dump_enabled);
353+
#endif // SPC_ENABLE
352354

353355
return OMPI_SUCCESS;
354356
}

0 commit comments

Comments
 (0)