[mpich2-commits] r6663 - mpich2/trunk/src/mpi/romio/adio/ad_xfs
robl at mcs.anl.gov
robl at mcs.anl.gov
Mon May 17 13:16:27 CDT 2010
Author: robl
Date: 2010-05-17 13:16:27 -0500 (Mon, 17 May 2010)
New Revision: 6663
Removed:
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_done.c
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iread.c
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iwrite.c
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_wait.c
Modified:
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.c
mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.h
Log:
from Michael Raymond <mraymond at sgi.com>: "gets XFS compiling again": update XFS
driver to match the ROMIO changes over the last copule years.
Modified: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.c 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.c 2010-05-17 18:16:27 UTC (rev 6663)
@@ -12,6 +12,7 @@
struct ADIOI_Fns_struct ADIO_XFS_operations = {
ADIOI_XFS_Open, /* Open */
+ ADIOI_GEN_OpenColl, /* OpenColl */
ADIOI_XFS_ReadContig, /* ReadContig */
ADIOI_XFS_WriteContig, /* WriteContig */
ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
@@ -22,12 +23,17 @@
ADIOI_GEN_ReadStrided, /* ReadStrided */
ADIOI_GEN_WriteStrided, /* WriteStrided */
ADIOI_GEN_Close, /* Close */
- ADIOI_XFS_IreadContig, /* IreadContig */
- ADIOI_XFS_IwriteContig, /* IwriteContig */
- ADIOI_XFS_ReadDone, /* ReadDone */
- ADIOI_XFS_WriteDone, /* WriteDone */
- ADIOI_XFS_ReadComplete, /* ReadComplete */
- ADIOI_XFS_WriteComplete, /* WriteComplete */
+#if defined(ROMIO_HAVE_WORKING_AIO)
+ ADIOI_GEN_IreadContig, /* IreadContig */
+ ADIOI_GEN_IwriteContig, /* IwriteContig */
+#else
+ ADIOI_FAKE_IreadContig, /* IreadContig */
+ ADIOI_FAKE_IwriteContig, /* IwriteContig */
+#endif /* ROMIO_HAVE_WORKING_AIO */
+ ADIOI_GEN_IODone, /* ReadDone */
+ ADIOI_GEN_IODone, /* WriteDone */
+ ADIOI_GEN_IOComplete, /* ReadComplete */
+ ADIOI_GEN_IOComplete, /* WriteComplete */
ADIOI_GEN_IreadStrided, /* IreadStrided */
ADIOI_GEN_IwriteStrided, /* IwriteStrided */
ADIOI_GEN_Flush, /* Flush */
Modified: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.h
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.h 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs.h 2010-05-17 18:16:27 UTC (rev 6663)
@@ -8,20 +8,19 @@
#ifndef AD_XFS_INCLUDE
#define AD_XFS_INCLUDE
+#define _XOPEN_SOURCE 500
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "adio.h"
-#include <aio.h>
-int ADIOI_XFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, void *handle);
-
-#if (defined(HAVE_PREAD64) && (_ABIO32 == 1))
-# define pread pread64
-# define pwrite pwrite64
+#if defined(MPISGI)
+#include "xfs/xfs_fs.h"
+#ifndef __USE_LARGEFILE64
+#define __USE_LARGEFILE64
#endif
-/* above needed for IRIX 6.5 */
+typedef struct aiocb64 aiocb64_t;
+#endif
void ADIOI_XFS_Open(ADIO_File fd, int *error_code);
void ADIOI_XFS_Close(ADIO_File fd, int *error_code);
@@ -33,22 +32,6 @@
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
-void ADIOI_XFS_IwriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code);
-void ADIOI_XFS_IreadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code);
-int ADIOI_XFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-int ADIOI_XFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-void ADIOI_XFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-void ADIOI_XFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code);
void ADIOI_XFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
*error_code);
void ADIOI_XFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
Deleted: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_done.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_done.c 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_done.c 2010-05-17 18:16:27 UTC (rev 6663)
@@ -1,69 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_xfs.h"
-
-int ADIOI_XFS_ReadDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- int err, done=0;
- static char myname[] = "ADIOI_XFS_READDONE";
-
- if (*request == ADIO_REQUEST_NULL) {
- *error_code = MPI_SUCCESS;
- return 1;
- }
-
- if ((*request)->queued) {
- errno = aio_error64((const aiocb64_t *) (*request)->handle);
- if (errno == EINPROGRESS) {
- done = 0;
- *error_code = MPI_SUCCESS;
- }
- else {
- err = aio_return64((aiocb64_t *) (*request)->handle);
- (*request)->nbytes = err;
- errno = aio_error64((const aiocb64_t *) (*request)->handle);
-
- done = 1;
- if (err == -1) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- }
- else *error_code = MPI_SUCCESS;
- }
- } /* if ((*request)->queued) */
- else {
- done = 1;
- *error_code = MPI_SUCCESS;
- }
-#ifdef HAVE_STATUS_SET_BYTES
- if (done && ((*request)->nbytes != -1))
- MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
-#endif
-
- if (done) {
- /* if request is still queued in the system, it is also there
- on ADIOI_Async_list. Delete it from there. */
- if ((*request)->queued) ADIOI_Del_req_from_list(request);
-
- (*request)->fd->async_count--;
- if ((*request)->handle) ADIOI_Free((*request)->handle);
- ADIOI_Free_request((ADIOI_Req_node *) (*request));
- *request = ADIO_REQUEST_NULL;
- /* status to be filled */
- }
- return done;
-}
-
-
-int ADIOI_XFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code)
-{
- return ADIOI_XFS_ReadDone(request, status, error_code);
-}
Deleted: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iread.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iread.c 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iread.c 2010-05-17 18:16:27 UTC (rev 6663)
@@ -1,42 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_xfs.h"
-
-void ADIOI_XFS_IreadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int *error_code)
-{
- int len, typesize, aio_errno = 0;
- static char myname[] = "ADIOI_XFS_IREADCONTIG";
-
- (*request) = ADIOI_Malloc_request();
- (*request)->optype = ADIOI_READ;
- (*request)->fd = fd;
- (*request)->datatype = datatype;
-
- MPI_Type_size(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
- aio_errno = ADIOI_XFS_aio(fd, buf, len, offset, 0, &((*request)->handle));
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- (*request)->queued = 1;
- ADIOI_Add_req_to_list(request);
-
- fd->fp_sys_posn = -1;
-
- /* --BEGIN ERROR HANDLING-- */
- if (aio_errno != 0) {
- MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- *error_code = MPI_SUCCESS;
- fd->async_count++;
-}
Deleted: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iwrite.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iwrite.c 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_iwrite.c 2010-05-17 18:16:27 UTC (rev 6663)
@@ -1,145 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_xfs.h"
-
-void ADIOI_XFS_IwriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request,
- int *error_code)
-{
- int len, typesize, aio_errno = 0;
- static char myname[] = "ADIOI_XFS_IWRITECONTIG";
-
- *request = ADIOI_Malloc_request();
- (*request)->optype = ADIOI_WRITE;
- (*request)->fd = fd;
- (*request)->datatype = datatype;
-
- MPI_Type_size(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
- aio_errno = ADIOI_XFS_aio(fd, buf, len, offset, 1, &((*request)->handle));
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- (*request)->queued = 1;
- ADIOI_Add_req_to_list(request);
-
- fd->fp_sys_posn = -1;
-
- /* --BEGIN ERROR HANDLING-- */
- if (aio_errno != 0) {
- MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- *error_code = MPI_SUCCESS;
- fd->async_count++;
-}
-
-
-void ADIOI_XFS_IwriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code)
-{
- ADIO_Status status;
-#ifdef HAVE_STATUS_SET_BYTES
- int typesize;
-#endif
-
- *request = ADIOI_Malloc_request();
- (*request)->optype = ADIOI_WRITE;
- (*request)->fd = fd;
- (*request)->datatype = datatype;
- (*request)->queued = 0;
- (*request)->handle = 0;
-
-/* call the blocking version. It is faster because it does data sieving. */
- ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type,
- offset, &status, error_code);
-
- fd->async_count++;
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (*error_code == MPI_SUCCESS) {
- MPI_Type_size(datatype, &typesize);
- (*request)->nbytes = count * typesize;
- }
-#endif
-}
-
-
-/* This function is for implementation convenience. It is not user-visible.
- * It takes care of the differences in the interface for nonblocking I/O
- * on various Unix machines! If wr==1 write, wr==0 read.
- *
- * Returns 0 on success, -errno on failure.
- */
-int ADIOI_XFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, void *handle)
-{
- int err, error_code;
- aiocb64_t *aiocbp;
-
- aiocbp = (aiocb64_t *) ADIOI_Calloc(sizeof(aiocb64_t), 1);
-
- if (((wr && fd->direct_write) || (!wr && fd->direct_read))
- && !(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz) &&
- !(len % fd->d_miniosz) && (len >= fd->d_miniosz) &&
- (len <= fd->d_maxiosz))
- aiocbp->aio_fildes = fd->fd_direct;
- else aiocbp->aio_fildes = fd->fd_sys;
-
- aiocbp->aio_offset = offset;
- aiocbp->aio_buf = buf;
- aiocbp->aio_nbytes = len;
- aiocbp->aio_reqprio = 0;
-
-#ifdef AIO_SIGNOTIFY_NONE
-/* SGI IRIX 6 */
- aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE;
-#else
- aiocbp->aio_sigevent.sigev_signo = 0;
-#endif
-
- if (wr) err = aio_write64(aiocbp);
- else err = aio_read64(aiocbp);
-
- if (err != 0) {
- if (errno == EAGAIN) {
- /* exceeded the max. no. of outstanding requests.
- complete all previous async. requests and try again. */
-
- /* ADIOI_Complete_async(&error_code); */
- if (error_code != MPI_SUCCESS) return -EIO;
-
- if (wr) err = aio_write64(aiocbp);
- else err = aio_read64(aiocbp);
-
- while (err != 0) {
- if (errno == EAGAIN) {
- /* sleep and try again */
- sleep(1);
- if (wr) err = aio_write64(aiocbp);
- else err = aio_read64(aiocbp);
- }
- else {
- return -errno;
- }
- }
- }
- else {
- return -errno;
- }
- }
-
- *((aiocb64_t **) handle) = aiocbp;
- return 0;
-}
Deleted: mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_wait.c
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_wait.c 2010-05-17 17:57:59 UTC (rev 6662)
+++ mpich2/trunk/src/mpi/romio/adio/ad_xfs/ad_xfs_wait.c 2010-05-17 18:16:27 UTC (rev 6663)
@@ -1,73 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_xfs.h"
-
-void ADIOI_XFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_XFS_READCOMPLETE";
-
- if (*request == ADIO_REQUEST_NULL) {
- *error_code = MPI_SUCCESS;
- return;
- }
-
- if ((*request)->queued) {
- do {
- err = aio_suspend64((const aiocb64_t **) &((*request)->handle), 1, 0);
- } while ((err == -1) && (errno == EINTR));
-
- if (err != -1) {
- err = aio_return64((aiocb64_t *) (*request)->handle);
- (*request)->nbytes = err;
- errno = aio_error64((aiocb64_t *) (*request)->handle);
- }
- else (*request)->nbytes = -1;
-
- if (err == -1) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- }
- else *error_code = MPI_SUCCESS;
- } /* if ((*request)->queued) */
- else *error_code = MPI_SUCCESS;
-
-#ifdef HAVE_STATUS_SET_BYTES
- if ((*request)->nbytes != -1)
- MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
-#endif
-
- if ((*request)->queued != -1) {
-
- /* queued = -1 is an internal hack used when the request must
- be completed, but the request object should not be
- freed. This is used in ADIOI_Complete_async, because the user
- will call MPI_Wait later, which would require status to
- be filled. Ugly but works. queued = -1 should be used only
- in ADIOI_Complete_async.
- This should not affect the user in any way. */
-
- /* if request is still queued in the system, it is also there
- on ADIOI_Async_list. Delete it from there. */
- if ((*request)->queued) ADIOI_Del_req_from_list(request);
-
- (*request)->fd->async_count--;
- if ((*request)->handle) ADIOI_Free((*request)->handle);
- ADIOI_Free_request((ADIOI_Req_node *) (*request));
- *request = ADIO_REQUEST_NULL;
- }
-}
-
-
-void ADIOI_XFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code)
-{
- ADIOI_XFS_ReadComplete(request, status, error_code);
-}
More information about the mpich2-commits
mailing list