Skip to content

Commit 39ae93b

Browse files
committed
modify the fcoll components to use the common/ompio print queues
1 parent fe17410 commit 39ae93b

10 files changed

+73
-65
lines changed

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
104104
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
105105
double rcomm_time = 0.0, start_rcomm_time = 0.0, end_rcomm_time = 0.0;
106106
double read_exch = 0.0, start_rexch = 0.0, end_rexch = 0.0;
107-
mca_io_ompio_print_entry nentry;
107+
mca_common_ompio_print_entry nentry;
108108
#endif
109109

110110
/**************************************************************************
@@ -866,9 +866,9 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
866866
else
867867
nentry.aggregator = 0;
868868
nentry.nprocs_for_coll = dynamic_num_io_procs;
869-
if (!fh->f_full_print_queue(READ_PRINT_QUEUE)){
870-
fh->f_register_print_entry(READ_PRINT_QUEUE,
871-
nentry);
869+
if (!mca_common_ompio_full_print_queue(fh->f_coll_read_time)){
870+
mca_common_ompio_register_print_entry(fh->f_coll_read_time,
871+
nentry);
872872
}
873873
#endif
874874

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
108108
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
109109
double comm_time = 0.0, start_comm_time = 0.0, end_comm_time = 0.0;
110110
double exch_write = 0.0, start_exch = 0.0, end_exch = 0.0;
111-
mca_io_ompio_print_entry nentry;
111+
mca_common_ompio_print_entry nentry;
112112
#endif
113113

114114
opal_datatype_type_size ( &datatype->super, &ftype_size );
@@ -979,9 +979,9 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
979979
else
980980
nentry.aggregator = 0;
981981
nentry.nprocs_for_coll = dynamic_num_io_procs;
982-
if (!fh->f_full_print_queue(WRITE_PRINT_QUEUE)){
983-
fh->f_register_print_entry(WRITE_PRINT_QUEUE,
984-
nentry);
982+
if (!mca_common_ompio_full_print_queue(fh->f_coll_write_time)){
983+
mca_common_ompio_register_print_entry(fh->f_coll_write_time,
984+
nentry);
985985
}
986986
#endif
987987

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_read_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh,
104104
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
105105
double rcomm_time = 0.0, start_rcomm_time = 0.0, end_rcomm_time = 0.0;
106106
double read_exch = 0.0, start_rexch = 0.0, end_rexch = 0.0;
107-
mca_io_ompio_print_entry nentry;
107+
mca_common_ompio_print_entry nentry;
108108
#endif
109109

110110
/**************************************************************************
@@ -866,9 +866,9 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh,
866866
else
867867
nentry.aggregator = 0;
868868
nentry.nprocs_for_coll = dynamic_gen2_num_io_procs;
869-
if (!fh->f_full_print_queue(READ_PRINT_QUEUE)){
870-
fh->f_register_print_entry(READ_PRINT_QUEUE,
871-
nentry);
869+
if (!mca_common_ompio_full_print_queue(fh->f_coll_read_time)){
870+
mca_common_ompio_register_print_entry(fh->f_coll_read_time,
871+
nentry);
872872
}
873873
#endif
874874

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
152152
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
153153
double comm_time = 0.0, start_comm_time = 0.0, end_comm_time = 0.0;
154154
double exch_write = 0.0, start_exch = 0.0, end_exch = 0.0;
155-
mca_io_ompio_print_entry nentry;
155+
mca_common_ompio_print_entry nentry;
156156
#endif
157157

158158

@@ -470,7 +470,7 @@ int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
470470

471471

472472
#if DEBUG_ON
473-
if (my_aggregator == fh->f_rank) {
473+
if (aggregators[i] == fh->f_rank) {
474474
uint32_t tv=0;
475475
for (tv=0 ; tv<total_fview_count ; tv++) {
476476
printf("%d: OFFSET: %lld LENGTH: %ld\n",
@@ -591,10 +591,17 @@ int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
591591

592592
/* Write data for iteration i-1 */
593593
for ( i=0; i<dynamic_gen2_num_io_procs; i++ ) {
594+
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
595+
start_write_time = MPI_Wtime();
596+
#endif
594597
ret = write_init (fh, aggregators[i], aggr_data[i], write_chunksize );
595598
if (OMPI_SUCCESS != ret){
596599
goto exit;
597600
}
601+
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
602+
end_write_time = MPI_Wtime();
603+
write_time += end_write_time - start_write_time;
604+
#endif
598605

599606
if (!aggr_data[i]->prev_sendbuf_is_contiguous && aggr_data[i]->prev_bytes_sent) {
600607
free (aggr_data[i]->prev_send_buf);
@@ -617,10 +624,17 @@ int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
617624

618625
/* Write data for iteration i=cycles-1 */
619626
for ( i=0; i<dynamic_gen2_num_io_procs; i++ ) {
627+
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
628+
start_write_time = MPI_Wtime();
629+
#endif
620630
ret = write_init (fh, aggregators[i], aggr_data[i], write_chunksize );
621631
if (OMPI_SUCCESS != ret){
622632
goto exit;
623633
}
634+
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
635+
end_write_time = MPI_Wtime();
636+
write_time += end_write_time - start_write_time;
637+
#endif
624638

625639
if (!aggr_data[i]->prev_sendbuf_is_contiguous && aggr_data[i]->prev_bytes_sent) {
626640
free (aggr_data[i]->prev_send_buf);
@@ -635,14 +649,15 @@ int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
635649
nentry.time[0] = write_time;
636650
nentry.time[1] = comm_time;
637651
nentry.time[2] = exch_write;
638-
if (my_aggregator == fh->f_rank)
652+
nentry.aggregator = 0;
653+
for ( i=0; i<dynamic_gen2_num_io_procs; i++ ) {
654+
if (aggregators[i] == fh->f_rank)
639655
nentry.aggregator = 1;
640-
else
641-
nentry.aggregator = 0;
656+
}
642657
nentry.nprocs_for_coll = dynamic_gen2_num_io_procs;
643-
if (!fh->f_full_print_queue(WRITE_PRINT_QUEUE)){
644-
fh->f_register_print_entry(WRITE_PRINT_QUEUE,
645-
nentry);
658+
if (!mca_common_ompio_full_print_queue(fh->f_coll_write_time)){
659+
mca_common_ompio_register_print_entry(fh->f_coll_write_time,
660+
nentry);
646661
}
647662
#endif
648663

@@ -725,19 +740,12 @@ static int write_init (mca_io_ompio_file_t *fh, int aggregator, mca_io_ompio_agg
725740
aggr_data->prev_num_io_entries,
726741
&last_array_pos, &last_pos,
727742
write_chunksize );
728-
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
729-
start_write_time = MPI_Wtime();
730-
#endif
731743
if ( 0 > fh->f_fbtl->fbtl_pwritev (fh)) {
732744
free ( aggr_data->prev_io_array);
733745
opal_output (1, "dynamic_gen2_write_all: fbtl_pwritev failed\n");
734746
ret = OMPI_ERROR;
735747
goto exit;
736748
}
737-
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
738-
end_write_time = MPI_Wtime();
739-
write_time += end_write_time - start_write_time;
740-
#endif
741749
}
742750
free ( fh->f_io_array );
743751
free ( aggr_data->prev_io_array);
@@ -1087,9 +1095,9 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
10871095
printf("%d : global_count : %ld, bytes_sent : %d\n",
10881096
rank,global_count, bytes_sent);
10891097
#endif
1090-
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
1091-
start_comm_time = MPI_Wtime();
1092-
#endif
1098+
//#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
1099+
// start_comm_time = MPI_Wtime();
1100+
//#endif
10931101
/*************************************************************************
10941102
*** 7e. Perform the actual communication
10951103
*************************************************************************/
@@ -1198,10 +1206,10 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
11981206
}
11991207
#endif
12001208

1201-
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
1202-
end_comm_time = MPI_Wtime();
1203-
comm_time += (end_comm_time - start_comm_time);
1204-
#endif
1209+
//#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
1210+
// end_comm_time = MPI_Wtime();
1211+
// comm_time += (end_comm_time - start_comm_time);
1212+
//#endif
12051213
/**********************************************************
12061214
*** 7f. Create the io array, and pass it to fbtl
12071215
*********************************************************/

ompi/mca/fcoll/static/fcoll_static_file_read_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
103103
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
104104
double rcomm_time = 0.0, start_rcomm_time = 0.0, end_rcomm_time = 0.0;
105105
double read_exch = 0.0, start_rexch = 0.0, end_rexch = 0.0;
106-
mca_io_ompio_print_entry nentry;
106+
mca_common_ompio_print_entry nentry;
107107
#endif
108108
#if DEBUG_ON
109109
MPI_Aint gc_in;
@@ -919,9 +919,9 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
919919
else
920920
nentry.aggregator = 0;
921921
nentry.nprocs_for_coll = static_num_io_procs;
922-
if (!fh->f_full_print_queue(READ_PRINT_QUEUE)){
923-
fh->f_register_print_entry(READ_PRINT_QUEUE,
924-
nentry);
922+
if (!mca_common_ompio_full_print_queue(fh->f_coll_read_time)){
923+
mca_common_ompio_register_print_entry(fh->f_coll_read_time,
924+
nentry);
925925
}
926926
#endif
927927

ompi/mca/fcoll/static/fcoll_static_file_write_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
104104
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
105105
double comm_time = 0.0, start_comm_time = 0.0, end_comm_time = 0.0;
106106
double exch_write = 0.0, start_exch = 0.0, end_exch = 0.0;
107-
mca_io_ompio_print_entry nentry;
107+
mca_common_ompio_print_entry nentry;
108108
#endif
109109

110110

@@ -952,9 +952,9 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
952952
else
953953
nentry.aggregator = 0;
954954
nentry.nprocs_for_coll = static_num_io_procs;
955-
if (!fh->f_full_print_queue(WRITE_PRINT_QUEUE)){
956-
fh->f_register_print_entry(WRITE_PRINT_QUEUE,
957-
nentry);
955+
if (!mca_common_ompio_full_print_queue(fh->f_coll_write_time)){
956+
mca_common_ompio_register_print_entry(fh->f_coll_write_time,
957+
nentry);
958958
}
959959
#endif
960960

ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh,
140140
Flatlist_node *flat_buf=NULL;
141141
mca_io_ompio_access_array_t *my_req=NULL, *others_req=NULL;
142142
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
143-
mca_io_ompio_print_entry nentry;
143+
mca_common_ompio_print_entry nentry;
144144
#endif
145145
// if (opal_datatype_is_predefined(&datatype->super)) {
146146
// fh->f_flags = fh->f_flags | OMPIO_CONTIGUOUS_MEMORY;
@@ -479,9 +479,9 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh,
479479
nentry.nprocs_for_coll = two_phase_num_io_procs;
480480

481481

482-
if (!fh->f_full_print_queue(READ_PRINT_QUEUE)){
483-
fh->f_register_print_entry(READ_PRINT_QUEUE,
484-
nentry);
482+
if (!mca_common_ompio_full_print_queue(fh->f_coll_read_time)){
483+
mca_common_ompio_register_print_entry(fh->f_coll_read_time,
484+
nentry);
485485
}
486486
#endif
487487

ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh,
168168
mca_io_ompio_access_array_t *my_req=NULL, *others_req=NULL;
169169
MPI_Aint send_buf_addr;
170170
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
171-
mca_io_ompio_print_entry nentry;
171+
mca_common_ompio_print_entry nentry;
172172
#endif
173173

174174

@@ -543,9 +543,9 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh,
543543
nentry.aggregator = 0;
544544
}
545545
nentry.nprocs_for_coll = two_phase_num_io_procs;
546-
if (!fh->f_full_print_queue(WRITE_PRINT_QUEUE)){
547-
fh->f_register_print_entry(WRITE_PRINT_QUEUE,
548-
nentry);
546+
if (!mca_common_ompio_full_print_queue(fh->f_coll_write_time)){
547+
mca_common_ompio_register_print_entry(fh->f_coll_write_time,
548+
nentry);
549549
}
550550
#endif
551551

ompi/mca/io/ompio/io_ompio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
6464

6565
#define QUEUESIZE 2048
6666
#define MCA_IO_DEFAULT_FILE_VIEW_SIZE 4*1024*1024
67-
#define OMPIO_FCOLL_WANT_TIME_BREAKDOWN 0
67+
#define OMPIO_FCOLL_WANT_TIME_BREAKDOWN 1
6868

6969
#define OMPIO_MIN(a, b) (((a) < (b)) ? (a) : (b))
7070
#define OMPIO_MAX(a, b) (((a) < (b)) ? (b) : (a))
@@ -289,8 +289,8 @@ struct mca_io_ompio_file_t {
289289
mca_sharedfp_base_module_t *f_sharedfp;
290290

291291
/* Timing information */
292-
mca_common_ompio_print_queue *f_coll_write_queue;
293-
mca_common_ompio_print_queue *f_coll_read_queue;
292+
mca_common_ompio_print_queue *f_coll_write_time;
293+
mca_common_ompio_print_queue *f_coll_read_time;
294294

295295
/*initial list of aggregators and groups*/
296296
int *f_init_aggr_list;

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
131131
ompio_fh->f_split_coll_in_use = false;
132132

133133
/*Initialize the print_queues queues here!*/
134-
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_write_queue);
135-
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_read_queue);
134+
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_write_time);
135+
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_read_time);
136136

137137
/* set some function pointers required for fcoll, fbtls and sharedfp modules*/
138138
ompio_fh->f_decode_datatype=ompi_io_ompio_decode_datatype;
@@ -286,8 +286,8 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
286286

287287
if(mca_io_ompio_coll_timing_info){
288288
strcpy (name, "WRITE");
289-
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_write_queue)){
290-
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_write_queue,
289+
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_write_time)){
290+
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_write_time,
291291
name,
292292
ompio_fh);
293293
if (OMPI_SUCCESS != ret){
@@ -296,8 +296,8 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
296296

297297
}
298298
strcpy (name, "READ");
299-
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_read_queue)){
300-
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_read_queue,
299+
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_read_time)){
300+
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_read_time,
301301
name,
302302
ompio_fh);
303303
if (OMPI_SUCCESS != ret){
@@ -368,14 +368,14 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
368368
}
369369

370370

371-
if ( NULL != ompio_fh->f_coll_write_queue ) {
372-
free ( ompio_fh->f_coll_write_queue );
373-
ompio_fh->f_coll_write_queue = NULL;
371+
if ( NULL != ompio_fh->f_coll_write_time ) {
372+
free ( ompio_fh->f_coll_write_time );
373+
ompio_fh->f_coll_write_time = NULL;
374374
}
375375

376-
if ( NULL != ompio_fh->f_coll_read_queue ) {
377-
free ( ompio_fh->f_coll_read_queue );
378-
ompio_fh->f_coll_read_queue = NULL;
376+
if ( NULL != ompio_fh->f_coll_read_time ) {
377+
free ( ompio_fh->f_coll_read_time );
378+
ompio_fh->f_coll_read_time = NULL;
379379
}
380380

381381
if (MPI_DATATYPE_NULL != ompio_fh->f_iov_type) {

0 commit comments

Comments
 (0)