Skip to content

Commit a4f8a7a

Browse files
committed
rename hint variables used internally
cb_read -> romio_cb_read cb_write -> romio_cb_write ds_read -> romio_ds_read ds_write -> romio_ds_write no_indep_rw -> romio_no_indep_rw
1 parent 0dfc68e commit a4f8a7a

File tree

8 files changed

+66
-65
lines changed

8 files changed

+66
-65
lines changed

src/drivers/pncio/pncio.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,25 @@ enum {
110110
typedef struct {
111111
int striping_factor;
112112
int striping_unit;
113-
int cb_read;
114-
int cb_write;
113+
int start_iodevice;
115114
int cb_nodes;
116115
int cb_buffer_size;
117-
int ds_read;
118-
int ds_write;
119-
int no_indep_rw;
120116
int ind_rd_buffer_size;
121117
int ind_wr_buffer_size;
122-
int start_iodevice;
118+
119+
int romio_cb_read;
120+
int romio_cb_write;
121+
int romio_ds_read;
122+
int romio_ds_write;
123+
int romio_no_indep_rw;
124+
125+
/* Hints for Lustre file system */
126+
int lustre_overstriping_ratio;
127+
128+
/* Hints set by PnetCDF internally */
129+
int lustre_num_osts;
123130
int *ranklist;
124131

125-
union {
126-
struct {
127-
int num_osts;
128-
int overstriping_ratio;
129-
} lustre;
130-
} fs_hints;
131132
} PNCIO_Hints;
132133

133134
typedef struct {

src/drivers/pncio/pncio_lustre_open.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ assert(mpi_io_mode & MPI_MODE_CREATE);
826826
str_unit = fd->hints->striping_unit;
827827
str_factor = fd->hints->striping_factor;
828828
start_iodev = fd->hints->start_iodevice;
829-
overstriping_ratio = fd->hints->fs_hints.lustre.overstriping_ratio;
829+
overstriping_ratio = fd->hints->lustre_overstriping_ratio;
830830

831831
/* obtain the total number of OSTs available */
832832
total_num_OSTs = get_total_avail_osts(fd->filename);
@@ -847,7 +847,7 @@ assert(mpi_io_mode & MPI_MODE_CREATE);
847847
* fd->hints->striping_factor = 0;
848848
* fd->hints->striping_unit = 0;
849849
* fd->hints->start_iodevice = -1;
850-
* fd->hints->fs_hints.lustre.overstriping_ratio = 1;
850+
* fd->hints->lustre_overstriping_ratio = 1;
851851
*/
852852

853853
/* In many cases, the Lustre striping configuration of the file to be
@@ -1017,8 +1017,8 @@ assert(mpi_io_mode & MPI_MODE_CREATE);
10171017
fd->hints->striping_factor = stripin_info[1];
10181018
fd->hints->start_iodevice = stripin_info[2];
10191019
if (fd->file_system == PNCIO_LUSTRE) {
1020-
fd->hints->fs_hints.lustre.num_osts = stripin_info[3];
1021-
fd->hints->fs_hints.lustre.overstriping_ratio = stripin_info[1] / stripin_info[3];
1020+
fd->hints->lustre_num_osts = stripin_info[3];
1021+
fd->hints->lustre_overstriping_ratio = stripin_info[1] / stripin_info[3];
10221022
}
10231023

10241024
if (rank > 0) { /* non-root processes */
@@ -1035,10 +1035,10 @@ assert(mpi_io_mode & MPI_MODE_CREATE);
10351035

10361036
MPI_Info_set(fd->info, "romio_filesystem_type", "LUSTRE:");
10371037

1038-
snprintf(int_str, 16, "%d", fd->hints->fs_hints.lustre.num_osts);
1038+
snprintf(int_str, 16, "%d", fd->hints->lustre_num_osts);
10391039
MPI_Info_set(fd->info, "lustre_num_osts", int_str);
10401040

1041-
snprintf(int_str, 16, "%d", fd->hints->fs_hints.lustre.overstriping_ratio);
1041+
snprintf(int_str, 16, "%d", fd->hints->lustre_overstriping_ratio);
10421042
MPI_Info_set(fd->info, "lustre_overstriping_ratio", int_str);
10431043

10441044
return err;
@@ -1119,18 +1119,18 @@ static int wkl=0; if (wkl == 0 && rank == 0) { printf("\nxxxx %s at %d: %s ----
11191119
fd->hints->striping_unit = stripin_info[0];
11201120
fd->hints->striping_factor = stripin_info[1];
11211121
fd->hints->start_iodevice = stripin_info[2];
1122-
fd->hints->fs_hints.lustre.num_osts = stripin_info[3];
1123-
fd->hints->fs_hints.lustre.overstriping_ratio = stripin_info[1] / stripin_info[3];
1122+
fd->hints->lustre_num_osts = stripin_info[3];
1123+
fd->hints->lustre_overstriping_ratio = stripin_info[1] / stripin_info[3];
11241124

11251125
/* construct cb_nodes rank list */
11261126
Lustre_set_cb_node_list(fd);
11271127

11281128
MPI_Info_set(fd->info, "romio_filesystem_type", "LUSTRE:");
11291129

1130-
snprintf(int_str, 16, "%d", fd->hints->fs_hints.lustre.num_osts);
1130+
snprintf(int_str, 16, "%d", fd->hints->lustre_num_osts);
11311131
MPI_Info_set(fd->info, "lustre_num_osts", int_str);
11321132

1133-
snprintf(int_str, 16, "%d", fd->hints->fs_hints.lustre.overstriping_ratio);
1133+
snprintf(int_str, 16, "%d", fd->hints->lustre_overstriping_ratio);
11341134
MPI_Info_set(fd->info, "lustre_overstriping_ratio", int_str);
11351135

11361136
return err;

src/drivers/pncio/pncio_lustre_wrcoll.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ double curT = MPI_Wtime();
638638
if (buf_view.count > 1)
639639
buf_view.rem = buf_view.len[0];
640640

641-
if (fd->hints->cb_write == PNCIO_HINT_DISABLE) {
641+
if (fd->hints->romio_cb_write == PNCIO_HINT_DISABLE) {
642642
/* collective write is explicitly disabled by user */
643643
do_collect = 0;
644644
}
@@ -700,14 +700,14 @@ double curT = MPI_Wtime();
700700
NCI_Free(st_end_all);
701701

702702
// if (myrank==0) printf("%s %d: do_collect=%d is_interleaved=%d buf_view size=%lld count=%lld is_contig=%d start_offset=%lld end_offset=%lld\n",__func__,__LINE__, do_collect,is_interleaved,buf_view.size,buf_view.count,buf_view.is_contig, start_offset,end_offset);
703-
if (fd->hints->cb_write == PNCIO_HINT_ENABLE) {
703+
if (fd->hints->romio_cb_write == PNCIO_HINT_ENABLE) {
704704
/* explicitly enabled by user */
705705
do_collect = 1;
706706
}
707-
else if (fd->hints->cb_write == PNCIO_HINT_AUTO) {
707+
else if (fd->hints->romio_cb_write == PNCIO_HINT_AUTO) {
708708
// if (myrank==0) printf("%s %d: large_indv_req=%d cb_nodes=%d striping_factor=%d\n",__func__,__LINE__, large_indv_req,fd->hints->cb_nodes , fd->hints->striping_factor);
709709
/* Check if collective write is actually necessary, only when
710-
* cb_write hint is set to PNCIO_HINT_AUTO.
710+
* romio_cb_write hint is set to PNCIO_HINT_AUTO.
711711
*
712712
* Two typical access patterns can benefit from collective write.
713713
* 1) access file regions of all processes are interleaved, and
@@ -811,7 +811,7 @@ double curT = MPI_Wtime();
811811
*/
812812
LUSTRE_Calc_my_req(fd, buf_view.is_contig, &my_req, buf_idx);
813813

814-
if (fd->hints->ds_write != PNCIO_HINT_DISABLE) {
814+
if (fd->hints->romio_ds_write != PNCIO_HINT_DISABLE) {
815815
/* When data sieving is considered, below check the current file size
816816
* first. If the aggregate access region of this collective write is
817817
* beyond the current file size, then we can safely skip the read of
@@ -1952,12 +1952,12 @@ int Exchange_data_recv(
19521952
#endif
19531953
srt_off_len->off[0] = others_req[j].offsets[start_pos[j]];
19541954
srt_off_len->len[0] = others_req[j].lens[start_pos[j]];
1955-
} else if (fd->hints->ds_write == PNCIO_HINT_ENABLE) {
1955+
} else if (fd->hints->romio_ds_write == PNCIO_HINT_ENABLE) {
19561956
/* skip building of srt_off_len and proceed to read-modify-write */
19571957
build_srt_off_len = 0;
19581958
/* assuming there are holes */
19591959
hole = 1;
1960-
} else if (fd->hints->ds_write == PNCIO_HINT_AUTO) {
1960+
} else if (fd->hints->romio_ds_write == PNCIO_HINT_AUTO) {
19611961
if (DO_HEAP_MERGE(nprocs_recv, srt_off_len->num)) {
19621962
/* When the number of sorted offset-length lists or the total
19631963
* number of offset-length pairs are too large, the heap-merge sort
@@ -1983,7 +1983,7 @@ int Exchange_data_recv(
19831983
fd->write_counter[6] = MAX(fd->write_counter[6], nprocs_recv);
19841984
}
19851985
#endif
1986-
} else { /* if (fd->hints->ds_write == PNCIO_HINT_DISABLE) */
1986+
} else { /* if (fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) */
19871987
/* User explicitly disable data sieving to skip read-modify-write.
19881988
* Whether or not there is a hole is not important. However,
19891989
* srt_off_len must be constructed to merge all others_req[] into a
@@ -2027,11 +2027,11 @@ int Exchange_data_recv(
20272027
hole = (srt_off_len->num > 1);
20282028
}
20292029

2030-
// printf("%s at %d: ds_write=%s build_srt_off_len=%d hole=%d skip_read=%d srt_off_len->num=%lld\n",__func__,__LINE__, (fd->hints->ds_write == PNCIO_HINT_ENABLE)?"ENABLE": (fd->hints->ds_write == PNCIO_HINT_DISABLE)?"DISABLE":"AUTO", build_srt_off_len,hole,fd->skip_read,srt_off_len->num);
2031-
// printf("%s at %d: ds_write=%s build_srt_off_len=%d hole=%d nprocs_recv=%d(PNCIO_DS_WR_NAGGRS_LB=%d) numx=%lld(PNCIO_DS_WR_NPAIRS_LB=%d)\n",__func__,__LINE__, (fd->hints->ds_write == PNCIO_HINT_ENABLE)?"ENABLE": (fd->hints->ds_write == PNCIO_HINT_DISABLE)?"DISABLE":"AUTO", build_srt_off_len,hole,nprocs_recv,PNCIO_DS_WR_NAGGRS_LB,numx,PNCIO_DS_WR_NPAIRS_LB);
2030+
// printf("%s at %d: romio_ds_write=%s build_srt_off_len=%d hole=%d skip_read=%d srt_off_len->num=%lld\n",__func__,__LINE__, (fd->hints->romio_ds_write == PNCIO_HINT_ENABLE)?"ENABLE": (fd->hints->romio_ds_write == PNCIO_HINT_DISABLE)?"DISABLE":"AUTO", build_srt_off_len,hole,fd->skip_read,srt_off_len->num);
2031+
// printf("%s at %d: romio_ds_write=%s build_srt_off_len=%d hole=%d nprocs_recv=%d(PNCIO_DS_WR_NAGGRS_LB=%d) numx=%lld(PNCIO_DS_WR_NPAIRS_LB=%d)\n",__func__,__LINE__, (fd->hints->romio_ds_write == PNCIO_HINT_ENABLE)?"ENABLE": (fd->hints->romio_ds_write == PNCIO_HINT_DISABLE)?"DISABLE":"AUTO", build_srt_off_len,hole,nprocs_recv,PNCIO_DS_WR_NAGGRS_LB,numx,PNCIO_DS_WR_NPAIRS_LB);
20322032

20332033
/* data sieving */
2034-
if (fd->hints->ds_write != PNCIO_HINT_DISABLE && hole) {
2034+
if (fd->hints->romio_ds_write != PNCIO_HINT_DISABLE && hole) {
20352035
if (fd->skip_read)
20362036
memset(write_buf, 0, range_size);
20372037
else {

src/drivers/pncio/pncio_lustre_wrstr.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if (writebuf_len) { \
1616
w_len = PNCIO_WriteContig(fd, writebuf, writebuf_len, \
1717
writebuf_off); \
18-
if (!fd->atomicity && fd->hints->ds_write == PNCIO_HINT_DISABLE) \
18+
if (!fd->atomicity && fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) \
1919
PNCIO_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
2020
if (w_len < 0) { \
2121
NCI_Free(writebuf); \
@@ -29,7 +29,7 @@
2929
writebuf_len = MIN(end_offset - writebuf_off + 1, \
3030
(writebuf_off / stripe_size + 1) * stripe_size \
3131
- writebuf_off); \
32-
if (!fd->atomicity && fd->hints->ds_write == PNCIO_HINT_DISABLE) \
32+
if (!fd->atomicity && fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) \
3333
PNCIO_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
3434
r_len = PNCIO_ReadContig(fd, writebuf, writebuf_len, writebuf_off); \
3535
if (r_len < 0) { \
@@ -42,7 +42,7 @@
4242
write_sz); \
4343
while (write_sz != req_len) { \
4444
w_len = PNCIO_WriteContig(fd, writebuf, writebuf_len, writebuf_off); \
45-
if (!fd->atomicity && fd->hints->ds_write == PNCIO_HINT_DISABLE) \
45+
if (!fd->atomicity && fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) \
4646
PNCIO_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
4747
if (w_len < 0) { \
4848
NCI_Free(writebuf); \
@@ -56,7 +56,7 @@
5656
writebuf_len = MIN(end_offset - writebuf_off + 1, \
5757
(writebuf_off / stripe_size + 1) * stripe_size \
5858
- writebuf_off); \
59-
if (!fd->atomicity && fd->hints->ds_write == PNCIO_HINT_DISABLE) \
59+
if (!fd->atomicity && fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) \
6060
PNCIO_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
6161
r_len = PNCIO_ReadContig(fd, writebuf, writebuf_len, writebuf_off); \
6262
if (r_len < 0) { \
@@ -127,7 +127,7 @@ MPI_Offset PNCIO_LUSTRE_WriteStrided(PNCIO_File *fd,
127127

128128
// printf("%s at %d:\n",__func__,__LINE__);
129129

130-
if (fd->hints->ds_write == PNCIO_HINT_DISABLE) {
130+
if (fd->hints->romio_ds_write == PNCIO_HINT_DISABLE) {
131131
/* if user has disabled data sieving on writes, use naive
132132
* approach instead.
133133
*/
@@ -162,7 +162,7 @@ if (fd->flat_file.count > 0) assert(offset == 0); /* not whole file visible */
162162
/* if atomicity is true or data sieving is not disable, lock the region
163163
* to be accessed
164164
*/
165-
if (fd->atomicity || fd->hints->ds_write != PNCIO_HINT_DISABLE)
165+
if (fd->atomicity || fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
166166
PNCIO_WRITE_LOCK(fd, start_off, SEEK_SET, bufsize);
167167

168168
for (i = 0; i < buf_view.count; i++) {
@@ -176,7 +176,7 @@ if (fd->flat_file.count > 0) assert(offset == 0); /* not whole file visible */
176176
/* write the buffer out the last round */
177177
w_len = PNCIO_WriteContig(fd, writebuf, writebuf_len, writebuf_off);
178178

179-
if (fd->atomicity || fd->hints->ds_write != PNCIO_HINT_DISABLE)
179+
if (fd->atomicity || fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
180180
PNCIO_UNLOCK(fd, start_off, SEEK_SET, bufsize);
181181

182182
NCI_Free(writebuf);
@@ -223,13 +223,13 @@ assert(disp == 0);
223223
BUFFERED_WRITE_WITHOUT_READ;
224224

225225
/* write the buffer out the last round */
226-
if (fd->hints->ds_write != PNCIO_HINT_DISABLE)
226+
if (fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
227227
PNCIO_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
228228

229229
w_len = PNCIO_WriteContig(fd, writebuf, writebuf_len, writebuf_off);
230230
if (w_len > 0) total_w_len += w_len;
231231

232-
if (fd->hints->ds_write != PNCIO_HINT_DISABLE)
232+
if (fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
233233
PNCIO_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
234234

235235
NCI_Free(writebuf);
@@ -255,7 +255,7 @@ assert(j < fd->flat_file.count);
255255

256256
/* if atomicity is true or data sieving is not disable, lock the region
257257
* to be accessed */
258-
if (fd->atomicity || fd->hints->ds_write != PNCIO_HINT_DISABLE)
258+
if (fd->atomicity || fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
259259
PNCIO_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
260260

261261
writebuf_off = 0;
@@ -348,12 +348,12 @@ assert(k < buf_view.count);
348348
/* write the buffer out the last round */
349349
if (writebuf_len) {
350350
w_len = PNCIO_WriteContig(fd, writebuf, writebuf_len, writebuf_off);
351-
if (!fd->atomicity && fd->hints->ds_write == PNCIO_HINT_DISABLE)
351+
if (!fd->atomicity && fd->hints->romio_ds_write == PNCIO_HINT_DISABLE)
352352
PNCIO_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
353353
if (w_len < 0) return w_len;
354354
total_w_len += w_len;
355355
}
356-
if (fd->atomicity || fd->hints->ds_write != PNCIO_HINT_DISABLE)
356+
if (fd->atomicity || fd->hints->romio_ds_write != PNCIO_HINT_DISABLE)
357357
PNCIO_UNLOCK(fd, start_off, SEEK_SET, end_offset - start_off + 1);
358358

359359
NCI_Free(writebuf);

src/drivers/pncio/pncio_read_coll.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ double curT = MPI_Wtime();
8383
/* number of aggregators, cb_nodes, is stored in the hints */
8484
nprocs_for_coll = fd->hints->cb_nodes;
8585

86-
/* only check for interleaving if cb_read isn't disabled */
87-
if (fd->hints->cb_read != PNCIO_HINT_DISABLE) {
86+
/* only check for interleaving if romio_cb_read isn't disabled */
87+
if (fd->hints->romio_cb_read != PNCIO_HINT_DISABLE) {
8888
/* For this process's request, calculate the file start and end
8989
* offsets. Note: end_offset points to the last byte-offset that will
9090
* be accessed, e.g., if start_offset=0 and 100 bytes to be read,
@@ -124,8 +124,8 @@ double curT = MPI_Wtime();
124124
interleave_count++;
125125
}
126126

127-
if (fd->hints->cb_read == PNCIO_HINT_DISABLE
128-
|| (!interleave_count && (fd->hints->cb_read == PNCIO_HINT_AUTO))) {
127+
if (fd->hints->romio_cb_read == PNCIO_HINT_DISABLE
128+
|| (!interleave_count && (fd->hints->romio_cb_read == PNCIO_HINT_AUTO))) {
129129
/* switch to independent read */
130130

131131
if (st_offsets != NULL) NCI_Free(st_offsets);

src/drivers/pncio/pncio_read_str.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ MPI_Offset PNCIO_GEN_ReadStrided(PNCIO_File *fd,
5555

5656
// printf("%s at %d:\n",__func__,__LINE__);
5757

58-
if (fd->hints->ds_read == PNCIO_HINT_DISABLE) {
58+
if (fd->hints->romio_ds_read == PNCIO_HINT_DISABLE) {
5959
/* if user has disabled data sieving on reads, use naive
6060
* approach instead.
6161
*/

src/drivers/pncio/pncio_write_coll.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ double curT = MPI_Wtime();
8383
*/
8484
nprocs_for_coll = fd->hints->cb_nodes;
8585

86-
/* only check for interleaving if cb_write isn't disabled */
87-
if (fd->hints->cb_write != PNCIO_HINT_DISABLE) {
86+
/* only check for interleaving if romio_cb_write isn't disabled */
87+
if (fd->hints->romio_cb_write != PNCIO_HINT_DISABLE) {
8888
/* For this process's request, calculate the file start and end
8989
* offsets. Note: end_offset points to the last byte-offset that will
9090
* be accessed, e.g., if start_offset=0 and 100 bytes to be read,
@@ -127,11 +127,11 @@ double curT = MPI_Wtime();
127127
interleave_count++;
128128
}
129129

130-
if (fd->hints->cb_write == PNCIO_HINT_DISABLE ||
131-
(!interleave_count && (fd->hints->cb_write == PNCIO_HINT_AUTO))) {
130+
if (fd->hints->romio_cb_write == PNCIO_HINT_DISABLE ||
131+
(!interleave_count && (fd->hints->romio_cb_write == PNCIO_HINT_AUTO))) {
132132

133133
/* use independent accesses */
134-
if (fd->hints->cb_write != PNCIO_HINT_DISABLE)
134+
if (fd->hints->romio_cb_write != PNCIO_HINT_DISABLE)
135135
NCI_Free(st_offsets);
136136
if (buf_view.size == 0) return 0;
137137

0 commit comments

Comments
 (0)