[mpich2-commits] r7926 - in mpich2/trunk/src/mpi/romio: adio/ad_lustre adio/ad_nfs adio/common adio/include mpi-io
robl at mcs.anl.gov
robl at mcs.anl.gov
Thu Feb 10 14:34:53 CST 2011
Author: robl
Date: 2011-02-10 14:34:52 -0600 (Thu, 10 Feb 2011)
New Revision: 7926
Modified:
mpich2/trunk/src/mpi/romio/adio/ad_lustre/ad_lustre_wrstr.c
mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_read.c
mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_write.c
mpich2/trunk/src/mpi/romio/adio/common/ad_read_str.c
mpich2/trunk/src/mpi/romio/adio/common/ad_write_str.c
mpich2/trunk/src/mpi/romio/adio/include/adioi.h
mpich2/trunk/src/mpi/romio/mpi-io/iwrite_sh.c
mpich2/trunk/src/mpi/romio/mpi-io/read_sh.c
mpich2/trunk/src/mpi/romio/mpi-io/write_sh.c
Log:
partial revert and redo of r7923: as daveg point's out better approach to fix
the macro instead of the N places macro gets used..
Modified: mpich2/trunk/src/mpi/romio/adio/ad_lustre/ad_lustre_wrstr.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_lustre/ad_lustre_wrstr.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/ad_lustre/ad_lustre_wrstr.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -18,9 +18,8 @@
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
ADIO_EXPLICIT_OFFSET, writebuf_off, \
&status1, error_code); \
- if (!(fd->atomicity)) { \
+ if (!(fd->atomicity)) \
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, \
@@ -36,9 +35,8 @@
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)) \
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); \
@@ -60,9 +58,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)) { \
+ if (!(fd->atomicity)) \
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, \
@@ -78,9 +75,8 @@
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)) \
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); \
@@ -226,9 +222,8 @@
writebuf_len = 0;
/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, bufsize);
- }
for (j = 0; j < count; j++) {
for (i = 0; i < flat_buf->count; i++) {
@@ -246,9 +241,8 @@
ADIO_EXPLICIT_OFFSET, writebuf_off, &status1,
error_code);
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, bufsize);
- }
if (*error_code != MPI_SUCCESS) {
ADIOI_Free(writebuf);
return;
@@ -385,9 +379,8 @@
}
/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
writebuf_off = 0;
writebuf_len = 0;
@@ -512,14 +505,12 @@
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
ADIO_EXPLICIT_OFFSET,
writebuf_off, &status1, error_code);
- if (!(fd->atomicity)) {
+ if (!(fd->atomicity))
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
- }
if (*error_code != MPI_SUCCESS) return;
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
ADIOI_Free(writebuf);
Modified: mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_read.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_read.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_read.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -28,9 +28,9 @@
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
- } else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
+ else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
#endif
@@ -53,9 +53,9 @@
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
- } else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
+ else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
#endif
@@ -132,9 +132,9 @@
readbuf_off = req_off; \
readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));\
lseek(fd->fd_sys, readbuf_off, SEEK_SET);\
- if (!(fd->atomicity)) {ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);} \
+ if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
err = read(fd->fd_sys, readbuf, readbuf_len);\
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
if (err == -1) err_flag = 1; \
} \
while (req_len > readbuf_off + readbuf_len - req_off) { \
@@ -149,9 +149,9 @@
readbuf_len = (int) (partial_read + ADIOI_MIN(max_bufsize, \
end_offset-readbuf_off+1)); \
lseek(fd->fd_sys, readbuf_off+partial_read, SEEK_SET);\
- if (!(fd->atomicity)) {ADIOI_READ_LOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);} \
+ if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
err = read(fd->fd_sys, readbuf+partial_read, readbuf_len-partial_read);\
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
if (err == -1) err_flag = 1; \
} \
memcpy((char *)buf + userbuf_off, readbuf+req_off-readbuf_off, req_len); \
@@ -224,9 +224,8 @@
readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));
/* if atomicity is true, lock (exclusive) the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
@@ -235,7 +234,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);}
+ if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
#endif
@@ -243,7 +242,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);}
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);
if (err == -1) err_flag = 1;
for (j=0; j<count; j++)
@@ -255,9 +254,8 @@
off += flat_buf->blocklens[i];
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
@@ -385,9 +383,8 @@
}
/* if atomicity is true, lock (exclusive) the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
/* initial read into readbuf */
readbuf_off = offset;
@@ -401,7 +398,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_READ_LOCK(fd, offset, SEEK_SET, readbuf_len);}
+ if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, offset, SEEK_SET, readbuf_len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
#endif
@@ -409,7 +406,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, offset, SEEK_SET, readbuf_len);}
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, offset, SEEK_SET, readbuf_len);
if (err == -1) err_flag = 1;
@@ -522,9 +519,8 @@
}
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
Modified: mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_write.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_write.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/ad_nfs/ad_nfs_write.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -152,11 +152,11 @@
if (req_off >= writebuf_off + writebuf_len) { \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
writebuf_off = req_off; \
writebuf_len = (int) (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)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
err = read(fd->fd_sys, writebuf, writebuf_len); \
if (err == -1) { \
@@ -172,13 +172,13 @@
while (write_sz != req_len) { \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
req_len -= write_sz; \
userbuf_off += write_sz; \
writebuf_off += writebuf_len; \
writebuf_len = (int) (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)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
err = read(fd->fd_sys, writebuf, writebuf_len); \
if (err == -1) { \
@@ -203,11 +203,11 @@
MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
writebuf_off = req_off; \
writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
@@ -218,11 +218,11 @@
MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
req_len -= write_sz; \
userbuf_off += write_sz; \
@@ -237,9 +237,9 @@
{ \
if (req_off >= writebuf_off + writebuf_len) { \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
writebuf_off = req_off; \
writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
@@ -248,9 +248,9 @@
memcpy(writebuf+req_off-writebuf_off, (char *)buf +userbuf_off, write_sz);\
while (write_sz != req_len) { \
lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
if (err == -1) err_flag = 1; \
req_len -= write_sz; \
userbuf_off += write_sz; \
@@ -327,9 +327,8 @@
writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));
/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
for (j=0; j<count; j++)
for (i=0; i<flat_buf->count; i++) {
@@ -348,7 +347,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);}
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
#endif
@@ -356,12 +355,11 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);}
+ if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
if (err == -1) err_flag = 1;
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
ADIOI_Free(writebuf); /* malloced in the buffered_write macro */
@@ -488,15 +486,14 @@
}
/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
/* initial read for the read-modify-write */
writebuf_off = offset;
writebuf = (char *) ADIOI_Malloc(max_bufsize);
writebuf_len = (int)(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)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
#endif
@@ -638,7 +635,7 @@
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
#endif
- if (!(fd->atomicity)) {ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);}
+ if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
#ifdef ADIOI_MPE_LOGGING
MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
#endif
Modified: mpich2/trunk/src/mpi/romio/adio/common/ad_read_str.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/common/ad_read_str.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/common/ad_read_str.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -126,9 +126,8 @@
readbuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));
/* if atomicity is true, lock (exclusive) the region to be accessed */
- if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) {
+ if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS))
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
ADIO_ReadContig(fd, readbuf, readbuf_len, MPI_BYTE,
ADIO_EXPLICIT_OFFSET, readbuf_off, &status1, error_code);
@@ -145,9 +144,8 @@
}
}
- if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) {
+ if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS))
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
@@ -267,9 +265,8 @@
}
/* if atomicity is true, lock (exclusive) the region to be accessed */
- if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) {
+ if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS))
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
readbuf_off = 0;
readbuf_len = 0;
@@ -385,9 +382,8 @@
}
}
- if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) {
+ if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS))
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
Modified: mpich2/trunk/src/mpi/romio/adio/common/ad_write_str.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/common/ad_write_str.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/common/ad_write_str.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -14,7 +14,7 @@
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)) 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, \
@@ -25,7 +25,7 @@
} \
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)) 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) { \
@@ -42,7 +42,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)) {ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);} \
+ if (!(fd->atomicity)) 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, \
@@ -54,7 +54,7 @@
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)) 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) { \
@@ -191,9 +191,8 @@
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) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
for (j=0; j<count; j++)
{
@@ -210,9 +209,8 @@
ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
writebuf_off, &status1, error_code);
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
if (*error_code != MPI_SUCCESS) return;
@@ -336,9 +334,8 @@
}
/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
writebuf_off = 0;
writebuf_len = 0;
@@ -460,14 +457,12 @@
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))
ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
- }
if (*error_code != MPI_SUCCESS) return;
}
- if (fd->atomicity) {
+ if (fd->atomicity)
ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
- }
ADIOI_Free(writebuf);
Modified: mpich2/trunk/src/mpi/romio/adio/include/adioi.h
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/include/adioi.h 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/adio/include/adioi.h 2011-02-10 20:34:52 UTC (rev 7926)
@@ -664,19 +664,19 @@
#if (defined(ROMIO_HFS) || defined(ROMIO_XFS))
# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \
- if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
+ do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_WRLCK, offset, whence, len);\
- else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len)
+ else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len) } while (0)
# define ADIOI_READ_LOCK(fd, offset, whence, len) \
- if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
+ do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_RDLCK, offset, whence, len);\
- else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len)
+ else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len) while (0)
# define ADIOI_UNLOCK(fd, offset, whence, len) \
- if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
+ do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \
ADIOI_Set_lock64((fd)->fd_sys, F_SETLK64, F_UNLCK, offset, whence, len); \
- else ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len)
+ else ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len) while (0)
#elif (defined(ROMIO_NTFS))
Modified: mpich2/trunk/src/mpi/romio/mpi-io/iwrite_sh.c
===================================================================
--- mpich2/trunk/src/mpi/romio/mpi-io/iwrite_sh.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/mpi-io/iwrite_sh.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -93,16 +93,14 @@
/* to maintain strict atomicity semantics with other concurrent
operations, lock (exclusive) and call blocking routine */
- if (fh->file_system != ADIO_NFS) {
+ if (fh->file_system != ADIO_NFS)
ADIOI_WRITE_LOCK(fh, off, SEEK_SET, bufsize);
- }
ADIO_WriteContig(fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET,
off, &status, &error_code);
- if (fh->file_system != ADIO_NFS) {
+ if (fh->file_system != ADIO_NFS)
ADIOI_UNLOCK(fh, off, SEEK_SET, bufsize);
- }
MPIO_Completed_request_create(&fh, bufsize, &error_code, request);
}
Modified: mpich2/trunk/src/mpi/romio/mpi-io/read_sh.c
===================================================================
--- mpich2/trunk/src/mpi/romio/mpi-io/read_sh.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/mpi-io/read_sh.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -106,16 +106,14 @@
could be a concurrent noncontiguous request. On NFS, locking
is done in the ADIO_ReadContig.*/
- if ((fh->atomicity) && (fh->file_system != ADIO_NFS)) {
+ if ((fh->atomicity) && (fh->file_system != ADIO_NFS))
ADIOI_WRITE_LOCK(fh, off, SEEK_SET, bufsize);
- }
ADIO_ReadContig(fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET,
off, status, &error_code);
- if ((fh->atomicity) && (fh->file_system != ADIO_NFS)) {
+ if ((fh->atomicity) && (fh->file_system != ADIO_NFS))
ADIOI_UNLOCK(fh, off, SEEK_SET, bufsize);
- }
}
else
{
Modified: mpich2/trunk/src/mpi/romio/mpi-io/write_sh.c
===================================================================
--- mpich2/trunk/src/mpi/romio/mpi-io/write_sh.c 2011-02-10 20:30:04 UTC (rev 7925)
+++ mpich2/trunk/src/mpi/romio/mpi-io/write_sh.c 2011-02-10 20:34:52 UTC (rev 7926)
@@ -106,16 +106,14 @@
could be a concurrent noncontiguous request. On NFS, locking is
done in the ADIO_WriteContig.*/
- if ((fh->atomicity) && (fh->file_system != ADIO_NFS)) {
+ if ((fh->atomicity) && (fh->file_system != ADIO_NFS))
ADIOI_WRITE_LOCK(fh, off, SEEK_SET, bufsize);
- }
ADIO_WriteContig(fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET,
off, status, &error_code);
- if ((fh->atomicity) && (fh->file_system != ADIO_NFS)) {
+ if ((fh->atomicity) && (fh->file_system != ADIO_NFS))
ADIOI_UNLOCK(fh, off, SEEK_SET, bufsize);
- }
}
else
{
More information about the mpich2-commits
mailing list