7171#include "opal/util/stacktrace.h"
7272#include "opal/util/keyval_parse.h"
7373#include "opal/util/sys_limits.h"
74+ #include "opal/util/timings.h"
7475
7576#if OPAL_CC_USE_PRAGMA_IDENT
7677#pragma ident OPAL_IDENT_STRING
@@ -341,6 +342,7 @@ opal_init_util(int* pargc, char*** pargv)
341342 int ret ;
342343 char * error = NULL ;
343344 char hostname [OPAL_MAXHOSTNAMELEN ];
345+ OPAL_TIMING_ENV_INIT (otmng );
344346
345347 if ( ++ opal_util_initialized != 1 ) {
346348 if ( opal_util_initialized < 1 ) {
@@ -363,6 +365,8 @@ opal_init_util(int* pargc, char*** pargv)
363365 /* initialize the memory allocator */
364366 opal_malloc_init ();
365367
368+ OPAL_TIMING_ENV_NEXT (otmng , "opal_malloc_init" );
369+
366370 /* initialize the output system */
367371 opal_output_init ();
368372
@@ -376,6 +380,8 @@ opal_init_util(int* pargc, char*** pargv)
376380 /* initialize the help system */
377381 opal_show_help_init ();
378382
383+ OPAL_TIMING_ENV_NEXT (otmng , "opal_show_help_init" );
384+
379385 /* register handler for errnum -> string converstion */
380386 if (OPAL_SUCCESS !=
381387 (ret = opal_error_register ("OPAL" ,
@@ -394,18 +400,23 @@ opal_init_util(int* pargc, char*** pargv)
394400 // details)
395401 opal_init_psm ();
396402
403+ OPAL_TIMING_ENV_NEXT (otmng , "opal_init_psm" );
404+
397405 /* Setup the parameter system */
398406 if (OPAL_SUCCESS != (ret = mca_base_var_init ())) {
399407 error = "mca_base_var_init" ;
400408 goto return_error ;
401409 }
410+ OPAL_TIMING_ENV_NEXT (otmng , "opal_var_init" );
402411
403412 /* read any param files that were provided */
404413 if (OPAL_SUCCESS != (ret = mca_base_var_cache_files (false))) {
405414 error = "failed to cache files" ;
406415 goto return_error ;
407416 }
408417
418+ OPAL_TIMING_ENV_NEXT (otmng , "opal_var_cache" );
419+
409420
410421 /* register params for opal */
411422 if (OPAL_SUCCESS != (ret = opal_register_params ())) {
@@ -418,6 +429,8 @@ opal_init_util(int* pargc, char*** pargv)
418429 goto return_error ;
419430 }
420431
432+ OPAL_TIMING_ENV_NEXT (otmng , "opal_net_init" );
433+
421434 /* pretty-print stack handlers */
422435 if (OPAL_SUCCESS != (ret = opal_util_register_stackhandlers ())) {
423436 error = "opal_util_register_stackhandlers" ;
@@ -440,12 +453,16 @@ opal_init_util(int* pargc, char*** pargv)
440453 goto return_error ;
441454 }
442455
456+ OPAL_TIMING_ENV_NEXT (otmng , "opal_arch_init" );
457+
443458 /* initialize the datatype engine */
444459 if (OPAL_SUCCESS != (ret = opal_datatype_init ())) {
445460 error = "opal_datatype_init" ;
446461 goto return_error ;
447462 }
448463
464+ OPAL_TIMING_ENV_NEXT (otmng , "opal_datatype_init" );
465+
449466 /* Initialize the data storage service. */
450467 if (OPAL_SUCCESS != (ret = opal_dss_open ())) {
451468 error = "opal_dss_open" ;
@@ -465,6 +482,8 @@ opal_init_util(int* pargc, char*** pargv)
465482 return ret ;
466483 }
467484
485+ OPAL_TIMING_ENV_NEXT (otmng , "opal_if_init" );
486+
468487 return OPAL_SUCCESS ;
469488
470489 return_error :
0 commit comments