Skip to content

Commit 69db1c9

Browse files
Merge pull request open-mpi#5 from markalle/romio341_refresh_mpich_additions
mpich additions for Romio341 refresh
2 parents 078ba8b + d6998de commit 69db1c9

File tree

19 files changed

+131
-60
lines changed

19 files changed

+131
-60
lines changed

3rd-party/romio341/adio/ad_gpfs/ad_gpfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#ifndef AD_GPFS_H_INCLUDED
1212
#define AD_GPFS_H_INCLUDED
1313

14+
#include "adio.h"
1415
#include <unistd.h>
1516
#include <stdlib.h>
1617
#include <sys/types.h>
1718
#include <fcntl.h>
18-
#include "adio.h"
1919

2020
#ifdef HAVE_SIGNAL_H
2121
#include <signal.h>

3rd-party/romio341/adio/ad_gpfs/ad_gpfs_aggrs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
705705
} else {
706706
others_req[i].count = 0;
707707
others_req[i].offsets = NULL;
708+
others_req[i].mem_ptrs = NULL;
708709
others_req[i].lens = NULL;
709710
}
710711
}

3rd-party/romio341/adio/ad_gpfs/ad_gpfs_rdcoll.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,12 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
425425
GPFSMPIO_T_CIO_REPORT(0, fd, myrank, nprocs);
426426

427427
/* free all memory allocated for collective I/O */
428-
ADIOI_Free(others_req[0].offsets);
429-
ADIOI_Free(others_req[0].mem_ptrs);
428+
if (others_req[0].offsets) {
429+
ADIOI_Free(others_req[0].offsets);
430+
}
431+
if (others_req[0].mem_ptrs) {
432+
ADIOI_Free(others_req[0].mem_ptrs);
433+
}
430434
ADIOI_Free(others_req);
431435

432436
ADIOI_Free(buf_idx);

3rd-party/romio341/adio/ad_gpfs/ad_gpfs_wrcoll.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
360360
ADIOI_OneSidedWriteAggregation(fd, offset_list, len_list, contig_access_count, buf,
361361
datatype, error_code, firstFileOffset, lastFileOffset,
362362
currentValidDataIndex, fd_start, fd_end, &holeFound,
363-
noStripeParms);
363+
&noStripeParms);
364364
romio_onesided_no_rmw = prev_romio_onesided_no_rmw;
365365
GPFSMPIO_T_CIO_REPORT(1, fd, myrank, nprocs);
366366
ADIOI_Free(offset_list);
@@ -447,8 +447,12 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
447447
GPFSMPIO_T_CIO_REPORT(1, fd, myrank, nprocs);
448448

449449
/* free all memory allocated for collective I/O */
450-
ADIOI_Free(others_req[0].offsets);
451-
ADIOI_Free(others_req[0].mem_ptrs);
450+
if (others_req[0].offsets) {
451+
ADIOI_Free(others_req[0].offsets);
452+
}
453+
if (others_req[0].mem_ptrs) {
454+
ADIOI_Free(others_req[0].mem_ptrs);
455+
}
452456
ADIOI_Free(others_req);
453457

454458
ADIOI_Free(buf_idx);
@@ -1541,7 +1545,7 @@ static void ADIOI_W_Exchange_data_alltoallv(ADIO_File fd, const void *buf, char
15411545
for (i = 0; i < nprocs; i++) {
15421546
if (send_size[i]) {
15431547
sbuf_ptr = all_send_buf + sdispls[i];
1544-
memcpy(sbuf_ptr, buf + buf_idx[i], send_size[i]);
1548+
memcpy(sbuf_ptr, (char *) buf + buf_idx[i], send_size[i]);
15451549
buf_idx[i] += send_size[i];
15461550
}
15471551
}

3rd-party/romio341/adio/ad_lustre/ad_lustre.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* temp*/
1010
#define HAVE_ASM_TYPES_H 1
1111

12+
#include "adio.h"
1213
#define _GNU_SOURCE 1
1314
#include <stdlib.h>
1415
#include <sys/types.h>
@@ -30,7 +31,6 @@
3031

3132
#include <sys/ioctl.h>
3233

33-
#include "adio.h"
3434
#include "ad_tuning.h"
3535

3636
#ifdef HAVE_LUSTRE_LUSTRE_USER_H

3rd-party/romio341/adio/ad_lustre/ad_lustre_wrstr.c

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
1414
ADIO_EXPLICIT_OFFSET, writebuf_off, \
1515
&status1, error_code); \
16-
if (!(fd->atomicity)) \
16+
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
1717
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
1818
if (*error_code != MPI_SUCCESS) { \
1919
*error_code = MPIO_Err_create_code(*error_code, \
@@ -30,7 +30,7 @@
3030
writebuf_len = (unsigned) MPL_MIN(end_offset - writebuf_off + 1, \
3131
(writebuf_off / stripe_size + 1) * \
3232
stripe_size - writebuf_off); \
33-
if (!(fd->atomicity)) \
33+
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
3434
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
3535
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
3636
ADIO_EXPLICIT_OFFSET, \
@@ -53,7 +53,7 @@
5353
while (write_sz != req_len) { \
5454
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
5555
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
56-
if (!(fd->atomicity)) \
56+
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
5757
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
5858
if (*error_code != MPI_SUCCESS) { \
5959
*error_code = MPIO_Err_create_code(*error_code, \
@@ -70,7 +70,7 @@
7070
writebuf_len = (unsigned) MPL_MIN(end_offset - writebuf_off + 1, \
7171
(writebuf_off / stripe_size + 1) * \
7272
stripe_size - writebuf_off); \
73-
if (!(fd->atomicity)) \
73+
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE) \
7474
ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
7575
ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
7676
ADIO_EXPLICIT_OFFSET, \
@@ -213,8 +213,9 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
213213
writebuf_off = 0;
214214
writebuf_len = 0;
215215

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)
218219
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, bufsize);
219220

220221
for (j = 0; j < count; j++) {
@@ -231,7 +232,7 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
231232
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
232233
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code);
233234

234-
if (fd->atomicity)
235+
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
235236
ADIOI_UNLOCK(fd, start_off, SEEK_SET, bufsize);
236237
if (*error_code != MPI_SUCCESS) {
237238
ADIOI_Free(writebuf);
@@ -311,8 +312,12 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
311312
userbuf_off = 0;
312313
ADIOI_BUFFERED_WRITE_WITHOUT_READ;
313314
/* 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);
314317
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
315318
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);
316321

317322
if (file_ptr_type == ADIO_INDIVIDUAL) {
318323
/* 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,
362367
fwr_size = MPL_MIN(flat_file->blocklens[j], bufsize - i_offset);
363368
}
364369

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)
367373
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset - start_off + 1);
368374

369375
writebuf_off = 0;
@@ -481,12 +487,12 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
481487
if (writebuf_len) {
482488
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
483489
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code);
484-
if (!(fd->atomicity))
490+
if (!fd->atomicity && fd->hints->ds_write == ADIOI_HINT_DISABLE)
485491
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
486492
if (*error_code != MPI_SUCCESS)
487493
return;
488494
}
489-
if (fd->atomicity)
495+
if (fd->atomicity || fd->hints->ds_write != ADIOI_HINT_DISABLE)
490496
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset - start_off + 1);
491497

492498
ADIOI_Free(writebuf);

3rd-party/romio341/adio/ad_panfs/ad_panfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#ifndef AD_PANFS_H_INCLUDED
77
#define AD_PANFS_H_INCLUDED
88

9+
#include "adio.h"
910
#include <unistd.h>
1011
#include <sys/types.h>
1112
#include <fcntl.h>
12-
#include "adio.h"
1313

1414
#ifndef NO_AIO
1515
#ifdef AIO_SUN

3rd-party/romio341/adio/ad_pvfs2/ad_pvfs2_io_dtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* See COPYRIGHT in top-level directory
44
*/
55

6-
#include <assert.h>
76
#include "adio.h"
7+
#include <assert.h>
88
#include "adio_extern.h"
99
#include "ad_pvfs2.h"
1010
#include "ad_pvfs2_io.h"

3rd-party/romio341/adio/ad_pvfs2/ad_pvfs2_io_list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* See COPYRIGHT in top-level directory
44
*/
55

6-
#include <assert.h>
76
#include "adio.h"
7+
#include <assert.h>
88
#include "adio_extern.h"
99
#include "ad_pvfs2.h"
1010
#include "ad_pvfs2_io.h"

3rd-party/romio341/adio/ad_xfs/ad_xfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#ifndef AD_XFS_H_INCLUDED
77
#define AD_XFS_H_INCLUDED
88

9+
#include "adio.h"
910
#include <unistd.h>
1011
#include <sys/types.h>
1112
#include <fcntl.h>
12-
#include "adio.h"
1313

1414
#if defined(MPISGI)
1515
#include "xfs/xfs_fs.h"

0 commit comments

Comments
 (0)