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