@@ -38,12 +38,12 @@ int PNCIO_File_close(PNCIO_File *fh)
3838 NCI_Free (fh -> io_buf );
3939
4040#if defined(PNETCDF_PROFILING ) && (PNETCDF_PROFILING == 1 )
41- int i , rank ;
41+ int i , world_rank ;
4242 double timing [NMEASURES * 2 ], max_t [NMEASURES * 2 ], pread_t ;
4343 MPI_Count max_ntimes , counter [NMEASURES * 2 ], max_c [NMEASURES * 2 ];
4444
4545 /* print two-phase I/O timing breakdown */
46- MPI_Comm_rank (fh -> comm , & rank );
46+ MPI_Comm_rank (MPI_COMM_WORLD , & world_rank );
4747 for (i = 0 ; i < NMEASURES ; i ++ ) {
4848 timing [i ] = fh -> write_timing [i ];
4949 counter [i ] = fh -> write_counter [i ];
@@ -56,7 +56,7 @@ int PNCIO_File_close(PNCIO_File *fh)
5656 pread_t = max_t [NMEASURES + 2 ];
5757 max_ntimes = max_c [0 ];
5858
59- if (rank == 0 && max_ntimes > 0 ) {
59+ if (world_rank == 0 && max_ntimes > 0 ) {
6060 printf ("%s: TWO-PHASE write init %5.2f pwrite %5.2f pread %5.2f post %5.2f hsort %5.2f comm %5.2f collw %5.2f\n" ,
6161 __func__ , max_t [1 ], max_t [2 ], pread_t , max_t [4 ], max_t [5 ], max_t [3 ], max_t [0 ]);
6262 printf ("%s: TWO-PHASE write ntimes %lld check_hole %lld (total_num %lld nrecv %lld) no check %lld (total_num %lld nrecv %lld)\n" ,
@@ -65,7 +65,7 @@ int PNCIO_File_close(PNCIO_File *fh)
6565
6666 max_ntimes = max_c [NMEASURES ];
6767
68- if (rank == 0 && max_ntimes > 0 )
68+ if (world_rank == 0 && max_ntimes > 0 )
6969 printf ("%s: TWO-PHASE read init %5.2f pread %5.2f post %5.2f wait %5.2f collr %5.2f ntimes %lld\n" ,
7070 __func__ , max_t [NMEASURES + 1 ], max_t [NMEASURES + 2 ], max_t [NMEASURES + 4 ], max_t [NMEASURES + 3 ], max_t [NMEASURES + 0 ], max_ntimes );
7171#endif
0 commit comments