1
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2
2
/*
3
- * Copyright (c) 2018-2022 Triad National Security, LLC. All rights
3
+ * Copyright (c) 2018-2023 Triad National Security, LLC. All rights
4
4
* reserved.
5
5
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
6
6
* Copyright (c) 2022 The University of Tennessee and The University
21
21
#include "opal/util/show_help.h"
22
22
#include "opal/util/argv.h"
23
23
#include "opal/runtime/opal_params.h"
24
+ #include "opal/util/timings.h"
25
+ #include "opal/mca/allocator/base/base.h"
26
+ #include "opal/mca/rcache/base/base.h"
27
+ #include "opal/mca/mpool/base/base.h"
28
+ #include "opal/mca/smsc/base/base.h"
29
+ #include "opal/mca/mpool/base/mpool_base_tree.h"
30
+ #include "opal/mca/pmix/pmix-internal.h"
31
+ #include "opal/mca/pmix/base/base.h"
24
32
25
33
#include "ompi/mca/pml/pml.h"
26
34
#include "ompi/runtime/params.h"
36
44
#include "ompi/dpm/dpm.h"
37
45
#include "ompi/file/file.h"
38
46
#include "ompi/mpiext/mpiext.h"
47
+ #include "ompi/util/timings.h"
39
48
40
49
#include "ompi/mca/hook/base/base.h"
41
50
#include "ompi/mca/op/base/base.h"
42
- #include "opal/mca/allocator/base/base.h"
43
- #include "opal/mca/rcache/base/base.h"
44
- #include "opal/mca/mpool/base/base.h"
45
- #include "opal/mca/smsc/base/base.h"
46
51
#include "ompi/mca/bml/base/base.h"
47
52
#include "ompi/mca/pml/base/base.h"
48
53
#include "ompi/mca/coll/base/base.h"
49
54
#include "ompi/mca/osc/base/base.h"
50
55
#include "ompi/mca/part/base/base.h"
51
56
#include "ompi/mca/io/base/base.h"
52
57
#include "ompi/mca/topo/base/base.h"
53
- #include "opal/mca/pmix/base/base.h"
54
58
55
- #include "opal/mca/mpool/base/mpool_base_tree.h"
56
59
#include "ompi/mca/pml/base/pml_base_bsend.h"
57
- #include "ompi/util/timings.h"
58
- #include "opal/mca/pmix/pmix-internal.h"
59
60
60
61
ompi_predefined_instance_t ompi_mpi_instance_null = {{{{0 }}}};
61
62
@@ -344,7 +345,8 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
344
345
pmix_info_t info [2 ];
345
346
pmix_status_t rc ;
346
347
opal_pmix_lock_t mylock ;
347
- OMPI_TIMING_INIT (64 );
348
+
349
+ OPAL_TIMING_ENV_INIT (init_common );
348
350
349
351
ret = ompi_mpi_instance_retain ();
350
352
if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
@@ -385,13 +387,15 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
385
387
mca_base_var_set_value (ret , allvalue , 4 , MCA_BASE_VAR_SOURCE_DEFAULT , NULL );
386
388
}
387
389
388
- OMPI_TIMING_NEXT ( "initialization" );
390
+ OPAL_TIMING_ENV_NEXT ( init_common , "initialization" );
389
391
390
392
/* Setup RTE */
391
393
if (OMPI_SUCCESS != (ret = ompi_rte_init (& argc , & argv ))) {
392
394
return ompi_instance_print_error ("ompi_mpi_init: ompi_rte_init failed" , ret );
393
395
}
394
396
397
+ OPAL_TIMING_ENV_NEXT (init_common , "ompi_rte_init" );
398
+
395
399
/* open the ompi hook framework */
396
400
for (int i = 0 ; ompi_framework_dependencies [i ] ; ++ i ) {
397
401
ret = mca_base_framework_open (ompi_framework_dependencies [i ], 0 );
@@ -404,10 +408,6 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
404
408
}
405
409
}
406
410
407
- OMPI_TIMING_NEXT ("rte_init" );
408
- OMPI_TIMING_IMPORT_OPAL ("orte_ess_base_app_setup" );
409
- OMPI_TIMING_IMPORT_OPAL ("rte_init" );
410
-
411
411
ompi_rte_initialized = true;
412
412
/* if we are oversubscribed, then set yield_when_idle
413
413
* accordingly */
@@ -509,9 +509,6 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
509
509
return ompi_instance_print_error ("mca_pml_base_select() failed" , ret );
510
510
}
511
511
512
- OMPI_TIMING_IMPORT_OPAL ("orte_init" );
513
- OMPI_TIMING_NEXT ("rte_init-commit" );
514
-
515
512
/* exchange connection info - this function may also act as a barrier
516
513
* if data exchange is required. The modex occurs solely across procs
517
514
* in our job. If a barrier is required, the "modex" function will
@@ -522,19 +519,20 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
522
519
return ret ; /* TODO: need to fix this */
523
520
}
524
521
525
- OMPI_TIMING_NEXT ("commit" );
522
+ OPAL_TIMING_ENV_NEXT (init_common , "PMIx_Commit" );
523
+
526
524
#if (OPAL_ENABLE_TIMING )
527
525
if (OMPI_TIMING_ENABLED && !opal_pmix_base_async_modex &&
528
526
opal_pmix_collect_all_data && !opal_process_info .is_singleton ) {
529
527
if (PMIX_SUCCESS != (rc = PMIx_Fence (NULL , 0 , NULL , 0 ))) {
530
528
ret = opal_pmix_convert_status (rc );
531
529
return ompi_instance_print_error ("timing: pmix-barrier-1 failed" , ret );
532
530
}
533
- OMPI_TIMING_NEXT ( "pmix-barrier-1" );
531
+ OPAL_TIMING_ENV_NEXT ( init_common , "pmix-barrier-1" );
534
532
if (PMIX_SUCCESS != (rc = PMIx_Fence (NULL , 0 , NULL , 0 ))) {
535
533
return ompi_instance_print_error ("timing: pmix-barrier-2 failed" , ret );
536
534
}
537
- OMPI_TIMING_NEXT ( "pmix-barrier-2" );
535
+ OPAL_TIMING_ENV_NEXT ( init_common , "pmix-barrier-2" );
538
536
}
539
537
#endif
540
538
@@ -579,7 +577,7 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
579
577
}
580
578
}
581
579
582
- OMPI_TIMING_NEXT ( "modex" );
580
+ OPAL_TIMING_ENV_NEXT ( init_common , "modex" );
583
581
584
582
/* select buffered send allocator component to be used */
585
583
if (OMPI_SUCCESS != (ret = mca_pml_base_bsend_init ())) {
@@ -627,14 +625,6 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
627
625
return ompi_instance_print_error ("ompi_attr_create_predefined_keyvals() failed" , ret );
628
626
}
629
627
630
- if (mca_pml_base_requires_world ()) {
631
- /* need to set up comm world for this instance -- XXX -- FIXME -- probably won't always
632
- * be the case. */
633
- if (OMPI_SUCCESS != (ret = ompi_comm_init_mpi3 ())) {
634
- return ompi_instance_print_error ("ompi_comm_init_mpi3 () failed" , ret );
635
- }
636
- }
637
-
638
628
/* initialize file handles */
639
629
if (OMPI_SUCCESS != (ret = ompi_file_init ())) {
640
630
return ompi_instance_print_error ("ompi_file_init() failed" , ret );
@@ -711,11 +701,12 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
711
701
return ompi_instance_print_error ("ompi_mpi_init: ompi_comm_cid_init failed" , ret );
712
702
}
713
703
714
- /* Do we need to wait for a debugger? */
715
- ompi_rte_wait_for_debugger ();
704
+ if (OMPI_SUCCESS != (ret = ompi_comm_init_mpi3 ())) {
705
+ return ompi_instance_print_error ("ompi_comm_init_mpi3 () failed" , ret );
706
+ }
716
707
717
708
/* Next timing measurement */
718
- OMPI_TIMING_NEXT ( "modex-barrier" );
709
+ OPAL_TIMING_ENV_NEXT ( init_common , "modex-barrier" );
719
710
720
711
if (!opal_process_info .is_singleton ) {
721
712
/* if we executed the above fence in the background, then
@@ -740,9 +731,7 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
740
731
}
741
732
}
742
733
743
- /* check for timing request - get stop time and report elapsed
744
- time if so, then start the clock again */
745
- OMPI_TIMING_NEXT ("barrier" );
734
+ OPAL_TIMING_ENV_NEXT (init_common , "barrier" );
746
735
747
736
#if OPAL_ENABLE_PROGRESS_THREADS == 0
748
737
/* Start setting up the event engine for MPI operations. Don't
@@ -751,7 +740,8 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
751
740
CPU utilization for the remainder of MPI_INIT when we are
752
741
blocking on RTE-level events, but may greatly reduce non-TCP
753
742
latency. */
754
- opal_progress_set_event_flag (OPAL_EVLOOP_NONBLOCK );
743
+ int old_event_flags = opal_progress_set_event_flag (0 );
744
+ opal_progress_set_event_flag (old_event_flags | OPAL_EVLOOP_NONBLOCK );
755
745
#endif
756
746
757
747
/* Undo OPAL calling opal_progress_event_users_increment() during
0 commit comments