@@ -445,7 +445,19 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
445
445
ITT_BEGIN (MPI_TASK_GATHERV );
446
446
result = PMPI_Gatherv (sendbuf , sendcount , sendtype , recvbuf ,
447
447
recvcounts , displs , recvtype , root , comm );
448
- ITT_END (MPI_TASK_GATHERV );
448
+ int curr_rank ;
449
+ PMPI_Comm_rank (comm , & curr_rank );
450
+ if (curr_rank == root ) {
451
+ int no_of_element = 0 ;
452
+ int size = 0 ;
453
+ PMPI_Comm_size (comm , & size );
454
+ for (int i = 0 ; i < size ; ++ i ) {
455
+ no_of_element += recvcounts [i ];
456
+ }
457
+ ITT_END_MPI_EX_INFO (MPI_TASK_GATHER , sendcount * sizeof (sendtype ), -1 , -1 , no_of_element * sizeof (recvtype ), root , -1 );
458
+ } else {
459
+ ITT_END_MPI_EX_INFO (MPI_TASK_GATHER , sendcount * sizeof (sendtype ), root , -1 , 0 , -1 , -1 );
460
+ }
449
461
return result ;
450
462
}
451
463
@@ -475,7 +487,20 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
475
487
ITT_BEGIN (MPI_TASK_SCATTERV );
476
488
result = PMPI_Scatterv (sendbuf , sendcounts , displs ,
477
489
sendtype , recvbuf , recvcount , recvtype , root , comm );
478
- ITT_END (MPI_TASK_SCATTERV );
490
+
491
+ int curr_rank ;
492
+ PMPI_Comm_rank (comm , & curr_rank );
493
+ if (curr_rank != root ){
494
+ ITT_END_MPI_EX_INFO (MPI_TASK_SCATTERV , 0 , -1 , -1 , recvcount * sizeof (recvtype ), root , -1 );
495
+ }else {
496
+ int no_of_element = 0 ;
497
+ int size = 0 ;
498
+ PMPI_Comm_size (comm , & size );
499
+ for (int i = 0 ; i < size ; ++ i ) {
500
+ no_of_element += sendcounts [i ];
501
+ }
502
+ ITT_END_MPI_EX_INFO (MPI_TASK_SCATTERV , no_of_element * sizeof (sendtype ), curr_rank , -1 , recvcount * sizeof (recvtype ), curr_rank , -1 );
503
+ }
479
504
return result ;
480
505
}
481
506
@@ -496,7 +521,16 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, vo
496
521
ITT_BEGIN (MPI_TASK_ALLGATHERV );
497
522
result = PMPI_Allgatherv (sendbuf , sendcount , sendtype , recvbuf ,
498
523
recvcounts , displs , recvtype , comm );
499
- ITT_END (MPI_TASK_ALLGATHERV );
524
+
525
+ int no_of_element = 0 ;
526
+ int size = 0 ;
527
+ PMPI_Comm_size (comm , & size );
528
+ for (int i = 0 ; i < size ; ++ i ) {
529
+ no_of_element += recvcounts [i ];
530
+ }
531
+ int curr_rank ;
532
+ PMPI_Comm_rank (comm , & curr_rank );
533
+ ITT_END_MPI_EX_INFO (MPI_TASK_ALLGATHERV , sendcount * sizeof (sendtype ), curr_rank , -1 , no_of_element * sizeof (recvtype ), curr_rank , -1 );
500
534
return result ;
501
535
}
502
536
@@ -518,7 +552,17 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
518
552
ITT_BEGIN (MPI_TASK_ALLTOALLV );
519
553
result = PMPI_Alltoallv (sendbuf , sendcounts , sdispls , sendtype , recvbuf ,
520
554
recvcounts , rdispls , recvtype , comm );
521
- ITT_END (MPI_TASK_ALLTOALLV );
555
+ int no_of_recv_element = 0 ;
556
+ int no_of_send_element = 0 ;
557
+ int size = 0 ;
558
+ PMPI_Comm_size (comm , & size );
559
+ for (int i = 0 ; i < size ; ++ i ) {
560
+ no_of_recv_element += recvcounts [i ];
561
+ no_of_send_element += sendcounts [i ];
562
+ }
563
+ int curr_rank ;
564
+ PMPI_Comm_rank (comm , & curr_rank );
565
+ ITT_END_MPI_EX_INFO (MPI_TASK_ALLTOALLV , no_of_send_element * sizeof (sendtype ), curr_rank , -1 , no_of_recv_element * sizeof (recvtype ), curr_rank , -1 );
522
566
return result ;
523
567
}
524
568
@@ -584,7 +628,15 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
584
628
ITT_BEGIN (MPI_TASK_IALLGATHERV );
585
629
result = PMPI_Iallgatherv (sendbuf , sendcount , sendtype , recvbuf ,
586
630
recvcounts , displs , recvtype , comm , request );
587
- ITT_END (MPI_TASK_IALLGATHERV );
631
+ int no_of_recv_element = 0 ;
632
+ int size = 0 ;
633
+ PMPI_Comm_size (comm , & size );
634
+ for (int i = 0 ; i < size ; ++ i ) {
635
+ no_of_recv_element += recvcounts [i ];
636
+ }
637
+ int curr_rank ;
638
+ PMPI_Comm_rank (comm , & curr_rank );
639
+ ITT_END_MPI_EX_INFO (MPI_TASK_IALLGATHERV , sendcount * sizeof (sendtype ), curr_rank , -1 , no_of_recv_element * sizeof (recvtype ), curr_rank , -1 );
588
640
return result ;
589
641
}
590
642
@@ -616,7 +668,18 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
616
668
ITT_BEGIN (MPI_TASK_IALLTOALLV );
617
669
result = PMPI_Ialltoallv (sendbuf , sendcounts , sdispls , sendtype , recvbuf ,
618
670
recvcounts , rdispls , recvtype , comm , request );
619
- ITT_END (MPI_TASK_IALLTOALLV );
671
+
672
+ int no_of_recv_element = 0 ;
673
+ int no_of_send_element = 0 ;
674
+ int size = 0 ;
675
+ PMPI_Comm_size (comm , & size );
676
+ for (int i = 0 ; i < size ; ++ i ) {
677
+ no_of_recv_element += recvcounts [i ];
678
+ no_of_send_element += sendcounts [i ];
679
+ }
680
+ int curr_rank ;
681
+ PMPI_Comm_rank (comm , & curr_rank );
682
+ ITT_END_MPI_EX_INFO (MPI_TASK_IALLTOALLV , no_of_send_element * sizeof (sendtype ), curr_rank , -1 , no_of_recv_element * sizeof (recvtype ), curr_rank , -1 );
620
683
return result ;
621
684
}
622
685
0 commit comments