Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_aggrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
others_req[i].count = 0;
others_req[i].offsets = NULL;
others_req[i].lens = NULL;
others_req[i].mem_ptrs = NULL;
}
}

Expand Down
10 changes: 5 additions & 5 deletions ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_rdcoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
ADIOI_Free(count_my_req_per_proc);
for (i=0; i<nprocs; i++) {
if (my_req[i].count) {
ADIOI_Free(my_req[i].offsets);
ADIOI_Free(my_req[i].lens);
if (my_req[i].offsets) { ADIOI_Free(my_req[i].offsets); }
if (my_req[i].lens) { ADIOI_Free(my_req[i].lens); }
}
}
ADIOI_Free(my_req);
Expand All @@ -469,9 +469,9 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
/* free all memory allocated for collective I/O */
for (i=0; i<nprocs; i++) {
if (others_req[i].count) {
ADIOI_Free(others_req[i].offsets);
ADIOI_Free(others_req[i].lens);
ADIOI_Free(others_req[i].mem_ptrs);
if (others_req[i].offsets) { ADIOI_Free(others_req[i].offsets); }
if (others_req[i].lens) { ADIOI_Free(others_req[i].lens); }
if (others_req[i].mem_ptrs) { ADIOI_Free(others_req[i].mem_ptrs); }
}
}
ADIOI_Free(others_req);
Expand Down
10 changes: 5 additions & 5 deletions ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
ADIOI_Free(count_my_req_per_proc);
for (i=0; i < nprocs; i++) {
if (my_req[i].count) {
ADIOI_Free(my_req[i].offsets);
ADIOI_Free(my_req[i].lens);
if (my_req[i].offsets) { ADIOI_Free(my_req[i].offsets); }
if (my_req[i].lens) { ADIOI_Free(my_req[i].lens); }
}
}
ADIOI_Free(my_req);
Expand All @@ -475,9 +475,9 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,

for (i=0; i<nprocs; i++) {
if (others_req[i].count) {
ADIOI_Free(others_req[i].offsets);
ADIOI_Free(others_req[i].lens);
ADIOI_Free(others_req[i].mem_ptrs);
if (others_req[i].offsets) { ADIOI_Free(others_req[i].offsets); }
if (others_req[i].lens) { ADIOI_Free(others_req[i].lens); }
if (others_req[i].mem_ptrs) { ADIOI_Free(others_req[i].mem_ptrs); }
}
}
ADIOI_Free(others_req);
Expand Down
28 changes: 17 additions & 11 deletions ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, \
&status1, error_code); \
if (!(fd->atomicity)) \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (*error_code != MPI_SUCCESS) { \
*error_code = MPIO_Err_create_code(*error_code, \
Expand All @@ -35,7 +35,7 @@
writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
(writebuf_off / stripe_size + 1) * \
stripe_size - writebuf_off); \
if (!(fd->atomicity)) \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, \
Expand All @@ -58,7 +58,7 @@
while (write_sz != req_len) { \
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
if (!(fd->atomicity)) \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (*error_code != MPI_SUCCESS) { \
*error_code = MPIO_Err_create_code(*error_code, \
Expand All @@ -75,7 +75,7 @@
writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
(writebuf_off / stripe_size + 1) * \
stripe_size - writebuf_off); \
if (!(fd->atomicity)) \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, \
Expand Down Expand Up @@ -221,8 +221,9 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
writebuf_off = 0;
writebuf_len = 0;

/* if atomicity is true, lock the region to be accessed */
if (fd->atomicity)
/* if atomicity is true or data sieving is not disable, lock the region
* to be accessed */
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, bufsize);

for (j = 0; j < count; j++) {
Expand All @@ -241,7 +242,7 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1,
error_code);

if (fd->atomicity)
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, bufsize);
if (*error_code != MPI_SUCCESS) {
ADIOI_Free(writebuf);
Expand Down Expand Up @@ -325,9 +326,13 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
userbuf_off = 0;
ADIOI_BUFFERED_WRITE_WITHOUT_READ
/* write the buffer out finally */
if (fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1,
error_code);
if (fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);

if (file_ptr_type == ADIO_INDIVIDUAL) {
/* update MPI-IO file pointer to point to the first byte
Expand Down Expand Up @@ -378,8 +383,9 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset);
}

/* if atomicity is true, lock the region to be accessed */
if (fd->atomicity)
/* if atomicity is true or data sieving is not disable, lock the region
* to be accessed */
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);

writebuf_off = 0;
Expand Down Expand Up @@ -502,11 +508,11 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
ADIO_EXPLICIT_OFFSET,
writebuf_off, &status1, error_code);
if (!(fd->atomicity))
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
if (*error_code != MPI_SUCCESS) return;
}
if (fd->atomicity)
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);

ADIOI_Free(writebuf);
Expand Down
14 changes: 14 additions & 0 deletions ompi/mca/io/romio321/romio/adio/common/ad_darray.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs
/* in terms of no. of elements of type oldtype in this dimension */
if (mysize == 0) *st_offset = 0;

MPI_Aint ex;
MPI_Type_extent(type_old, &ex);
MPI_Datatype type_tmp;
MPI_Type_create_resized(*type_new, 0, array_of_gsizes[dim] * ex, &type_tmp);
MPI_Type_free(type_new);
*type_new = type_tmp;

return MPI_SUCCESS;
}

Expand Down Expand Up @@ -287,5 +294,12 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc

if (local_size == 0) *st_offset = 0;

MPI_Aint ex;
MPI_Type_extent(type_old, &ex);
MPI_Datatype type_tmp2;
MPI_Type_create_resized(*type_new, 0, array_of_gsizes[dim] * ex, &type_tmp2);
MPI_Type_free(type_new);
*type_new = type_tmp2;

return MPI_SUCCESS;
}
34 changes: 21 additions & 13 deletions ompi/mca/io/romio321/romio/adio/common/ad_write_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
if (writebuf_len) { \
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (*error_code != MPI_SUCCESS) { \
*error_code = MPIO_Err_create_code(*error_code, \
MPIR_ERR_RECOVERABLE, myname, \
Expand All @@ -25,7 +26,8 @@
} \
writebuf_off = req_off; \
writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
if (*error_code != MPI_SUCCESS) { \
Expand All @@ -42,7 +44,8 @@
while (write_sz != req_len) { \
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (*error_code != MPI_SUCCESS) { \
*error_code = MPIO_Err_create_code(*error_code, \
MPIR_ERR_RECOVERABLE, myname, \
Expand All @@ -54,7 +57,8 @@
userbuf_off += write_sz; \
writebuf_off += writebuf_len; \
writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
if (*error_code != MPI_SUCCESS) { \
Expand Down Expand Up @@ -191,9 +195,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
writebuf = (char *) ADIOI_Malloc(max_bufsize);
writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-writebuf_off+1));

/* if atomicity is true, lock the region to be accessed */
if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
/* if atomicity is true or data sieving is not disable, lock the region
* to be accessed */
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset - start_off + 1);

for (j=0; j<count; j++)
{
Expand All @@ -210,7 +215,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
writebuf_off, &status1, error_code);

if (fd->atomicity)
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);

if (*error_code != MPI_SUCCESS) goto fn_exit;
Expand Down Expand Up @@ -287,8 +292,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
* datatypes, instead of a count of bytes (which might overflow)
* Other WriteContig calls in this path are operating on data
* sieving buffer */
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, bufsize);
ADIO_WriteContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET,
offset, status, error_code);
ADIOI_UNLOCK(fd, offset, SEEK_SET, bufsize);

if (file_ptr_type == ADIO_INDIVIDUAL) {
/* update MPI-IO file pointer to point to the first byte
Expand Down Expand Up @@ -338,9 +345,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset);
}

/* if atomicity is true, lock the region to be accessed */
if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
/* if atomicity is true or data sieving is not disable, lock the region
* to be accessed */
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset - start_off + 1);

writebuf_off = 0;
writebuf_len = 0;
Expand Down Expand Up @@ -460,11 +468,11 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
if (writebuf_len) {
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
writebuf_off, &status1, error_code);
if (!(fd->atomicity))
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
if (*error_code != MPI_SUCCESS) goto fn_exit;
}
if (fd->atomicity)
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);

if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
Expand Down
Loading