13
13
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
14
14
ADIO_EXPLICIT_OFFSET, writebuf_off, \
15
15
&status1, error_code); \
16
- if (!( fd->atomicity)) \
16
+ if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
17
17
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
18
18
if (*error_code != MPI_SUCCESS) { \
19
19
*error_code = MPIO_Err_create_code(*error_code, \
30
30
writebuf_len = (unsigned ) MPL_MIN (end_offset - writebuf_off + 1 , \
31
31
(writebuf_off / stripe_size + 1 ) * \
32
32
stripe_size - writebuf_off ); \
33
- if (!( fd -> atomicity )) \
33
+ if (!fd -> atomicity && fd -> hints -> ds_write == ADIOI_HINT_DISABLE ) \
34
34
ADIOI_WRITE_LOCK (fd , writebuf_off , SEEK_SET , writebuf_len ); \
35
35
ADIO_ReadContig (fd , writebuf , writebuf_len , MPI_BYTE , \
36
36
ADIO_EXPLICIT_OFFSET , \
53
53
while (write_sz != req_len ) { \
54
54
ADIO_WriteContig (fd , writebuf , writebuf_len , MPI_BYTE , \
55
55
ADIO_EXPLICIT_OFFSET , writebuf_off , & status1 , error_code ); \
56
- if (!( fd -> atomicity )) \
56
+ if (!fd -> atomicity && fd -> hints -> ds_write == ADIOI_HINT_DISABLE ) \
57
57
ADIOI_UNLOCK (fd , writebuf_off , SEEK_SET , writebuf_len ); \
58
58
if (* error_code != MPI_SUCCESS ) { \
59
59
* error_code = MPIO_Err_create_code (* error_code , \
70
70
writebuf_len = (unsigned ) MPL_MIN (end_offset - writebuf_off + 1 , \
71
71
(writebuf_off / stripe_size + 1 ) * \
72
72
stripe_size - writebuf_off ); \
73
- if (!( fd -> atomicity )) \
73
+ if (!fd -> atomicity && fd -> hints -> ds_write == ADIOI_HINT_DISABLE ) \
74
74
ADIOI_WRITE_LOCK (fd , writebuf_off , SEEK_SET , writebuf_len ); \
75
75
ADIO_ReadContig (fd , writebuf , writebuf_len , MPI_BYTE , \
76
76
ADIO_EXPLICIT_OFFSET , \
@@ -213,8 +213,9 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
213
213
writebuf_off = 0 ;
214
214
writebuf_len = 0 ;
215
215
216
- /* if atomicity is true, lock the region to be accessed */
217
- if (fd -> atomicity )
216
+ /* if atomicity is true or data sieving is not disable, lock the region
217
+ * to be accessed */
218
+ if (fd -> atomicity || fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
218
219
ADIOI_WRITE_LOCK (fd , start_off , SEEK_SET , bufsize );
219
220
220
221
for (j = 0 ; j < count ; j ++ ) {
@@ -231,7 +232,7 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
231
232
ADIO_WriteContig (fd , writebuf , writebuf_len , MPI_BYTE ,
232
233
ADIO_EXPLICIT_OFFSET , writebuf_off , & status1 , error_code );
233
234
234
- if (fd -> atomicity )
235
+ if (fd -> atomicity || fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
235
236
ADIOI_UNLOCK (fd , start_off , SEEK_SET , bufsize );
236
237
if (* error_code != MPI_SUCCESS ) {
237
238
ADIOI_Free (writebuf );
@@ -311,8 +312,12 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
311
312
userbuf_off = 0 ;
312
313
ADIOI_BUFFERED_WRITE_WITHOUT_READ ;
313
314
/* write the buffer out finally */
315
+ if (fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
316
+ ADIOI_WRITE_LOCK (fd , writebuf_off , SEEK_SET , writebuf_len );
314
317
ADIO_WriteContig (fd , writebuf , writebuf_len , MPI_BYTE ,
315
318
ADIO_EXPLICIT_OFFSET , writebuf_off , & status1 , error_code );
319
+ if (fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
320
+ ADIOI_UNLOCK (fd , writebuf_off , SEEK_SET , writebuf_len );
316
321
317
322
if (file_ptr_type == ADIO_INDIVIDUAL ) {
318
323
/* update MPI-IO file pointer to point to the first byte
@@ -362,8 +367,9 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
362
367
fwr_size = MPL_MIN (flat_file -> blocklens [j ], bufsize - i_offset );
363
368
}
364
369
365
- /* if atomicity is true, lock the region to be accessed */
366
- if (fd -> atomicity )
370
+ /* if atomicity is true or data sieving is not disable, lock the region
371
+ * to be accessed */
372
+ if (fd -> atomicity || fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
367
373
ADIOI_WRITE_LOCK (fd , start_off , SEEK_SET , end_offset - start_off + 1 );
368
374
369
375
writebuf_off = 0 ;
@@ -481,12 +487,12 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
481
487
if (writebuf_len ) {
482
488
ADIO_WriteContig (fd , writebuf , writebuf_len , MPI_BYTE ,
483
489
ADIO_EXPLICIT_OFFSET , writebuf_off , & status1 , error_code );
484
- if (!( fd -> atomicity ) )
490
+ if (!fd -> atomicity && fd -> hints -> ds_write == ADIOI_HINT_DISABLE )
485
491
ADIOI_UNLOCK (fd , writebuf_off , SEEK_SET , writebuf_len );
486
492
if (* error_code != MPI_SUCCESS )
487
493
return ;
488
494
}
489
- if (fd -> atomicity )
495
+ if (fd -> atomicity || fd -> hints -> ds_write != ADIOI_HINT_DISABLE )
490
496
ADIOI_UNLOCK (fd , start_off , SEEK_SET , end_offset - start_off + 1 );
491
497
492
498
ADIOI_Free (writebuf );
0 commit comments