@@ -244,11 +244,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
244
244
opal_mutex_unlock (& ompi_group_afp_mutex );
245
245
#if OPAL_ENABLE_DEBUG
246
246
stop = PMPI_Wtime ();
247
- #endif
248
247
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
249
248
"%s ompi: comm_shrink: group_inter: %g seconds" ,
250
249
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - start ));
251
- #if OPAL_ENABLE_DEBUG
252
250
start = PMPI_Wtime ();
253
251
#endif
254
252
do {
@@ -266,10 +264,10 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
266
264
} while ( MPI_ERR_PROC_FAILED == rc );
267
265
#if OPAL_ENABLE_DEBUG
268
266
stop = PMPI_Wtime ();
269
- #endif
270
267
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
271
268
"%s ompi: comm_shrink: AGREE: %g seconds" ,
272
269
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - start ));
270
+ #endif
273
271
if (OMPI_SUCCESS != rc ) {
274
272
opal_output (0 , "%s:%d Agreement failure: %d\n" , __FILE__ , __LINE__ , rc );
275
273
exit_status = rc ;
@@ -313,7 +311,7 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
313
311
comm -> c_keyhash , /* attrs */
314
312
comm -> error_handler , /* error handler */
315
313
alive_group , /* local group */
316
- alive_rgroup /* remote group */
314
+ alive_rgroup , /* remote group */
317
315
0 /* flags */
318
316
);
319
317
if ( OMPI_SUCCESS != rc ) {
@@ -326,10 +324,10 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
326
324
}
327
325
#if OPAL_ENABLE_DEBUG
328
326
stop = PMPI_Wtime ();
329
- #endif
330
327
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
331
328
"%s ompi: comm_shrink: GRP COMPUTATION: %g seconds\n" ,
332
329
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - start ));
330
+ #endif
333
331
/*
334
332
* Step 3: Determine context id
335
333
*/
@@ -356,10 +354,10 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
356
354
}
357
355
#if OPAL_ENABLE_DEBUG
358
356
stop = PMPI_Wtime ();
359
- #endif
360
357
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
361
358
"%s ompi: comm_shrink: NEXT CID: %g seconds\n" ,
362
359
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - start ));
360
+ #endif
363
361
/*
364
362
* Step 4: Activate the communicator
365
363
*/
@@ -426,15 +424,14 @@ static int ompi_comm_ishrink_check_agree(ompi_comm_request_t *request);
426
424
static int ompi_comm_ishrink_check_setrank (ompi_comm_request_t * request );
427
425
static int ompi_comm_ishrink_check_cid (ompi_comm_request_t * request );
428
426
static int ompi_comm_ishrink_check_activate (ompi_comm_request_t * request );
429
- static int ompi_comm_ishrink_check_finished (ompi_comm_request_t * request ) {
430
- return OMPI_SUCCESS ;
431
- }
432
427
433
428
int ompi_comm_ishrink_internal (ompi_communicator_t * comm , ompi_communicator_t * * newcomm , ompi_request_t * * req )
434
429
{
435
430
int rc ;
436
431
int flag = 1 ;
432
+ #if OPAL_ENABLE_DEBUG
437
433
double stop ;
434
+ #endif
438
435
ompi_comm_request_t * request ;
439
436
ompi_comm_ishrink_context_t * context ;
440
437
ompi_request_t * subreq [1 ];
@@ -466,13 +463,17 @@ int ompi_comm_ishrink_internal(ompi_communicator_t* comm, ompi_communicator_t**
466
463
OPAL_OUTPUT_VERBOSE ((5 , ompi_ftmpi_output_handle ,
467
464
"%s ompi: comm_ishrink: Agreement on failed processes" ,
468
465
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ) ));
469
- context -> start = MPI_Wtime ();
466
+ #if OPAL_ENABLE_DEBUG
467
+ context -> start = PMPI_Wtime ();
468
+ #endif
470
469
ompi_group_intersection (comm -> c_remote_group , ompi_group_all_failed_procs , & context -> failed_group );
471
- stop = MPI_Wtime ();
470
+ #if OPAL_ENABLE_DEBUG
471
+ stop = PMPI_Wtime ();
472
472
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
473
473
"%s ompi: comm_ishrink: group_inter: %g seconds" ,
474
474
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - context -> start ));
475
- context -> start = MPI_Wtime ();
475
+ context -> start = PMPI_Wtime ();
476
+ #endif
476
477
/* We need to create the list of alive processes. Thus, we don't care about
477
478
* the value of flag, instead we are only using the globally consistent
478
479
* return value.
@@ -505,15 +506,19 @@ static int ompi_comm_ishrink_check_agree(ompi_comm_request_t *request) {
505
506
(ompi_comm_ishrink_context_t * )request -> context ;
506
507
ompi_communicator_t * comm = context -> comm ;
507
508
ompi_request_t * subreq [1 ];
508
- int rc , mode , flag = 1 ;
509
- double stop ;
510
509
ompi_group_t * comm_group = NULL ;
510
+ int rc , flag = 1 ;
511
+ #if OPAL_ENABLE_DEBUG
512
+ double stop ;
513
+ #endif
511
514
512
- stop = MPI_Wtime ();
513
- rc = request -> super . req_status . MPI_ERROR ;
515
+ #if OPAL_ENABLE_DEBUG
516
+ stop = PMPI_Wtime () ;
514
517
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
515
518
"%s ompi: comm_ishrink: AGREE: %g seconds" ,
516
519
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - context -> start ));
520
+ #endif
521
+ rc = request -> super .req_status .MPI_ERROR ;
517
522
if ( (OMPI_SUCCESS != rc ) && (MPI_ERR_PROC_FAILED != rc ) ) {
518
523
opal_output (0 , "%s:%d Agreement failure: %d\n" , __FILE__ , __LINE__ , rc );
519
524
return rc ;
@@ -546,10 +551,11 @@ static int ompi_comm_ishrink_check_agree(ompi_comm_request_t *request) {
546
551
OPAL_OUTPUT_VERBOSE ((5 , ompi_ftmpi_output_handle ,
547
552
"%s ompi: comm_ishrink: Determine ranking for new communicator" ,
548
553
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ) ));
549
- context -> start = MPI_Wtime ();
554
+ #if OPAL_ENABLE_DEBUG
555
+ context -> start = PMPI_Wtime ();
556
+ #endif
550
557
551
558
/* Create 'alive' groups */
552
- mode = OMPI_COMM_CID_INTRA_FT ;
553
559
comm_group = comm -> c_local_group ;
554
560
rc = ompi_group_difference (comm_group , context -> failed_group , & context -> alive_group );
555
561
if ( OMPI_SUCCESS != rc ) {
@@ -558,7 +564,6 @@ static int ompi_comm_ishrink_check_agree(ompi_comm_request_t *request) {
558
564
return rc ;
559
565
}
560
566
if ( OMPI_COMM_IS_INTER (comm ) ) {
561
- mode = OMPI_COMM_CID_INTER_FT ;
562
567
comm_group = comm -> c_remote_group ;
563
568
rc = ompi_group_difference (comm_group , context -> failed_group , & context -> alive_rgroup );
564
569
if ( OMPI_SUCCESS != rc ) {
@@ -579,9 +584,9 @@ static int ompi_comm_ishrink_check_agree(ompi_comm_request_t *request) {
579
584
NULL , /* remote_ranks */
580
585
comm -> c_keyhash , /* attrs */
581
586
comm -> error_handler , /* error handler */
582
- false, /* topo component */
583
587
context -> alive_group , /* local group */
584
588
context -> alive_rgroup , /* remote group */
589
+ 0 , /* flags */
585
590
subreq
586
591
);
587
592
if ( OMPI_SUCCESS != rc ) {
@@ -602,7 +607,9 @@ static int ompi_comm_ishrink_check_setrank(ompi_comm_request_t *request) {
602
607
(ompi_comm_ishrink_context_t * )request -> context ;
603
608
ompi_request_t * subreq [1 ];
604
609
int rc , mode ;
610
+ #if OPAL_ENABLE_DEBUG
605
611
double stop ;
612
+ #endif
606
613
607
614
/* cleanup temporary groups */
608
615
OBJ_RELEASE (context -> alive_group );
@@ -620,10 +627,12 @@ static int ompi_comm_ishrink_check_setrank(ompi_comm_request_t *request) {
620
627
return rc ;
621
628
}
622
629
623
- stop = MPI_Wtime ();
630
+ #if OPAL_ENABLE_DEBUG
631
+ stop = PMPI_Wtime ();
624
632
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
625
633
"%s ompi: comm_ishrink: GRP COMPUTATION: %g seconds\n" ,
626
634
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - context -> start ));
635
+ #endif
627
636
628
637
/*
629
638
* Step 3: Determine context id
@@ -636,7 +645,9 @@ static int ompi_comm_ishrink_check_setrank(ompi_comm_request_t *request) {
636
645
OPAL_OUTPUT_VERBOSE ((5 , ompi_ftmpi_output_handle ,
637
646
"%s ompi: comm_ishrink: Determine context id" ,
638
647
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ) ));
639
- context -> start = MPI_Wtime ();
648
+ #if OPAL_ENABLE_DEBUG
649
+ context -> start = PMPI_Wtime ();
650
+ #endif
640
651
rc = ompi_comm_nextcid_nb ( * context -> newcomm , /* new communicator */
641
652
context -> comm , /* old comm */
642
653
NULL , /* bridge comm */
@@ -661,7 +672,9 @@ static int ompi_comm_ishrink_check_cid(ompi_comm_request_t *request) {
661
672
(ompi_comm_ishrink_context_t * )request -> context ;
662
673
ompi_request_t * subreq [1 ];
663
674
int rc , mode ;
675
+ #if OPAL_ENABLE_DEBUG
664
676
double stop ;
677
+ #endif
665
678
666
679
rc = request -> super .req_status .MPI_ERROR ;
667
680
if ( OMPI_SUCCESS != rc ) {
@@ -672,10 +685,13 @@ static int ompi_comm_ishrink_check_cid(ompi_comm_request_t *request) {
672
685
OBJ_RELEASE (* context -> newcomm );
673
686
return rc ;
674
687
}
675
- stop = MPI_Wtime ();
688
+ #if OPAL_ENABLE_DEBUG
689
+ stop = PMPI_Wtime ();
676
690
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
677
691
"%s ompi: comm_ishrink: NEXT CID: %g seconds\n" ,
678
692
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - context -> start ));
693
+ #endif
694
+
679
695
/*
680
696
* Step 4: Activate the communicator
681
697
*/
@@ -687,8 +703,11 @@ static int ompi_comm_ishrink_check_cid(ompi_comm_request_t *request) {
687
703
/* Set name for debugging purposes */
688
704
ompi_communicator_t * newcomp = * context -> newcomm ;
689
705
snprintf (newcomp -> c_name , MPI_MAX_OBJECT_NAME , "MPI COMMUNICATOR %d SHRUNK FROM %d" ,
690
- newcomp -> c_contextid , context -> comm -> c_contextid );
691
- context -> start = MPI_Wtime ();
706
+ ompi_comm_get_local_cid (newcomp ),
707
+ ompi_comm_get_local_cid (context -> comm ));
708
+ #if OPAL_ENABLE_DEBUG
709
+ context -> start = PMPI_Wtime ();
710
+ #endif
692
711
/* activate communicator and init coll-module */
693
712
rc = ompi_comm_activate_nb ( context -> newcomm , /* new communicator */
694
713
context -> comm ,
@@ -711,18 +730,21 @@ static int ompi_comm_ishrink_check_cid(ompi_comm_request_t *request) {
711
730
static int ompi_comm_ishrink_check_activate (ompi_comm_request_t * request ) {
712
731
ompi_comm_ishrink_context_t * context =
713
732
(ompi_comm_ishrink_context_t * )request -> context ;
714
- double stop ;
715
733
int rc ;
734
+ #if OPAL_ENABLE_DEBUG
735
+ double stop ;
736
+ #endif
716
737
717
738
rc = request -> super .req_status .MPI_ERROR ;
718
739
if ( OMPI_SUCCESS != rc ) {
719
740
return rc ;
720
741
}
721
-
742
+ #if OPAL_ENABLE_DEBUG
722
743
stop = MPI_Wtime ();
723
744
OPAL_OUTPUT_VERBOSE ((10 , ompi_ftmpi_output_handle ,
724
745
"%s ompi: comm_ishrink: COLL SELECT: %g seconds\n" ,
725
746
OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), stop - context -> start ));
747
+ #endif
726
748
727
749
return OMPI_SUCCESS ;
728
750
}
0 commit comments