[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-231-g42056d4

Service Account noreply at mpich.org
Tue May 6 14:13:41 CDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  42056d485bd213fbbf0fb3c8ba9ae9b0350d62ea (commit)
       via  e0154ed8e4048c2b8421362489da6f97f8204e2e (commit)
      from  e3813c2e9e7816c0baa750883d984e0f9110a2a7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/42056d485bd213fbbf0fb3c8ba9ae9b0350d62ea

commit 42056d485bd213fbbf0fb3c8ba9ae9b0350d62ea
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Mon May 5 16:26:55 2014 -0500

    ROMIO: Consolidate errno processing
    
    not every file system lives in a posix-like environment, but many do.
    for those file systems, open and delete will return -1 and set errno.
    The translation from unix erno to MPI error class was haphazard.  Get
    all aplicable file systems using ADIOI_Err_create_code so we have one
    place to update error code conversion.
    
    Closes: #2075
    
    Signed-off-by: Wei-keng Liao <wkliao at ece.northwestern.edu>

diff --git a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_open.c b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_open.c
index c3edd84..99b2c1b 100644
--- a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_open.c
+++ b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_open.c
@@ -104,50 +104,7 @@ void ADIOI_GPFS_Open(ADIO_File fd, int *error_code)
     }
 
   if (fd->fd_sys == -1)  {
-    if (errno == ENAMETOOLONG)
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE, myname,
-                                         __LINE__, MPI_ERR_BAD_FILE,
-                                         "**filenamelong",
-                                         "**filenamelong %s %d",
-                                         fd->filename,
-                                         strlen(fd->filename));
-    else if (errno == ENOENT)
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE, myname,
-                                         __LINE__, MPI_ERR_NO_SUCH_FILE,
-                                         "**filenoexist",
-                                         "**filenoexist %s",
-                                         fd->filename);
-    else if (errno == ENOTDIR || errno == ELOOP)
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE,
-                                         myname, __LINE__,
-                                         MPI_ERR_BAD_FILE,
-                                         "**filenamedir",
-                                         "**filenamedir %s",
-                                         fd->filename);
-    else if (errno == EACCES)    {
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE, myname,
-                                         __LINE__, MPI_ERR_ACCESS,
-                                         "**fileaccess",
-                                         "**fileaccess %s", 
-                                         fd->filename );
-    }
-    else if (errno == EROFS)    {
-      /* Read only file or file system and write access requested */
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE, myname,
-                                         __LINE__, MPI_ERR_READ_ONLY,
-                                         "**ioneedrd", 0 );
-    }
-    else    {
-      *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                         MPIR_ERR_RECOVERABLE, myname,
-                                         __LINE__, MPI_ERR_IO, "**io",
-                                         "**io %s", strerror(errno));
-    }
+      *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
   }
   else *error_code = MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
index 0c664ac..e06cb24 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
@@ -105,50 +105,7 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
     /* --BEGIN ERROR HANDLING-- */
     if (fd->fd_sys == -1 || ((fd->fd_direct == -1) && 
 		(fd->direct_write || fd->direct_read))) {
-	if (errno == ENAMETOOLONG)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_BAD_FILE,
-					       "**filenamelong",
-					       "**filenamelong %s %d",
-					       fd->filename,
-					       strlen(fd->filename));
-	else if (errno == ENOENT)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_NO_SUCH_FILE,
-					       "**filenoexist",
-					       "**filenoexist %s",
-					       fd->filename);
-	else if (errno == ENOTDIR || errno == ELOOP)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE,
-					       myname, __LINE__,
-					       MPI_ERR_BAD_FILE,
-					       "**filenamedir",
-					       "**filenamedir %s",
-					       fd->filename);
-	else if (errno == EACCES) {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_ACCESS,
-					       "**fileaccess",
-					       "**fileaccess %s", 
-					       fd->filename );
-	}
-	else if (errno == EROFS) {
-	    /* Read only file or file system and write access requested */
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_READ_ONLY,
-					       "**ioneedrd", 0 );
-	}
-	else {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_IO, "**io",
-					       "**io %s", strerror(errno));
-	}
+	*error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
     }
     /* --END ERROR HANDLING-- */
     else *error_code = MPI_SUCCESS;
diff --git a/src/mpi/romio/adio/ad_nfs/ad_nfs_open.c b/src/mpi/romio/adio/ad_nfs/ad_nfs_open.c
index f8dac56..d876329 100644
--- a/src/mpi/romio/adio/ad_nfs/ad_nfs_open.c
+++ b/src/mpi/romio/adio/ad_nfs/ad_nfs_open.c
@@ -52,64 +52,7 @@ void ADIOI_NFS_Open(ADIO_File fd, int *error_code)
     }
 
     if (fd->fd_sys == -1) {
-	/* Check for special error codes for those MPI error 
-	   classes that relate to particular problems */
-	if (errno == ENAMETOOLONG)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_BAD_FILE,
-					       "**filenamelong",
-					       "**filenamelong %s %d",
-					       fd->filename,
-					       strlen(fd->filename));
-	else if (errno == ENOENT)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_NO_SUCH_FILE,
-					       "**filenoexist",
-					       "**filenoexist %s",
-					       fd->filename);
-	else if (errno == ENOTDIR || errno == ELOOP)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_BAD_FILE,
-					       "**filenamedir",
-					       "**filenamedir %s",
-					       fd->filename);
-	else if (errno == EACCES) {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_ACCESS,
-					       "**fileaccess",
-					       "**fileaccess %s", 
-					       fd->filename);
-	}
-	else if (errno == EROFS) {
-	    /* Read only file or file system and write access requested */
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_READ_ONLY,
-					       "**ioneedrd", 0);
-	}
-    else if(errno == EISDIR) {
-        *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                           MPIR_ERR_RECOVERABLE, myname,
-                           __LINE__, MPI_ERR_BAD_FILE,
-                           "**filename", 0);
-    }
-    else if(errno == EEXIST) {
-        *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                           MPIR_ERR_RECOVERABLE, myname,
-                           __LINE__, MPI_ERR_FILE_EXISTS,
-                           "**fileexist", 0);
-
-    }
-	else {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_IO, "**io",
-					       "**io %s", strerror(errno));
-	}
+	*error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
     }
     else *error_code = MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/ad_panfs/ad_panfs_open.c b/src/mpi/romio/adio/ad_panfs/ad_panfs_open.c
index 161fd48..d5374eb 100644
--- a/src/mpi/romio/adio/ad_panfs/ad_panfs_open.c
+++ b/src/mpi/romio/adio/ad_panfs/ad_panfs_open.c
@@ -342,50 +342,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code)
 	fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
 
     if (fd->fd_sys == -1) {
-	if (errno == ENAMETOOLONG)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_BAD_FILE,
-					       "**filenamelong",
-					       "**filenamelong %s %d",
-					       fd->filename,
-					       strlen(fd->filename));
-	else if (errno == ENOENT)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_NO_SUCH_FILE,
-					       "**filenoexist",
-					       "**filenoexist %s",
-					       fd->filename);
-	else if (errno == ENOTDIR || errno == ELOOP)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE,
-					       myname, __LINE__,
-					       MPI_ERR_BAD_FILE,
-					       "**filenamedir",
-					       "**filenamedir %s",
-					       fd->filename);
-	else if (errno == EACCES) {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_ACCESS,
-					       "**fileaccess",
-					       "**fileaccess %s", 
-					       fd->filename );
-	}
-	else if (errno == EROFS) {
-	    /* Read only file or file system and write access requested */
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_READ_ONLY,
-					       "**ioneedrd", 0 );
-	}
-	else {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_IO, "**io",
-					       "**io %s", strerror(errno));
-	}
+	*error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
     }
     else *error_code = MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/ad_ufs/ad_ufs_open.c b/src/mpi/romio/adio/ad_ufs/ad_ufs_open.c
index a615778..9d5a2a1 100644
--- a/src/mpi/romio/adio/ad_ufs/ad_ufs_open.c
+++ b/src/mpi/romio/adio/ad_ufs/ad_ufs_open.c
@@ -51,66 +51,8 @@ void ADIOI_UFS_Open(ADIO_File fd, int *error_code)
 #endif
     }
 
-    /* --BEGIN ERROR HANDLING-- */
     if (fd->fd_sys == -1) {
-	if (errno == ENAMETOOLONG)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_BAD_FILE,
-					       "**filenamelong",
-					       "**filenamelong %s %d",
-					       fd->filename,
-					       strlen(fd->filename));
-	else if (errno == ENOENT)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_NO_SUCH_FILE,
-					       "**filenoexist",
-					       "**filenoexist %s",
-					       fd->filename);
-	else if (errno == ENOTDIR || errno == ELOOP)
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE,
-					       myname, __LINE__,
-					       MPI_ERR_BAD_FILE,
-					       "**filenamedir",
-					       "**filenamedir %s",
-					       fd->filename);
-	else if (errno == EACCES) {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_ACCESS,
-					       "**fileaccess",
-					       "**fileaccess %s", 
-					       fd->filename );
-	}
-	else if (errno == EROFS) {
-	    /* Read only file or file system and write access requested */
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_READ_ONLY,
-					       "**ioneedrd", 0 );
-	}
-        else if(errno == EISDIR) {
-            *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                               MPIR_ERR_RECOVERABLE, myname,
-                                               __LINE__, MPI_ERR_BAD_FILE,
-                                               "**filename", 0);
-        }
-        else if(errno == EEXIST) {
-            *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-                                               MPIR_ERR_RECOVERABLE, myname,
-                                               __LINE__, MPI_ERR_FILE_EXISTS,
-                                               "**fileexist", 0);
-
-        }
-	else {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS,
-					       MPIR_ERR_RECOVERABLE, myname,
-					       __LINE__, MPI_ERR_IO, "**io",
-					       "**io %s", strerror(errno));
-	}
+	*error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
     }
-    /* --END ERROR HANDLING-- */
     else *error_code = MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/ad_xfs/ad_xfs_open.c b/src/mpi/romio/adio/ad_xfs/ad_xfs_open.c
index eba5093..5c0a9a2 100644
--- a/src/mpi/romio/adio/ad_xfs/ad_xfs_open.c
+++ b/src/mpi/romio/adio/ad_xfs/ad_xfs_open.c
@@ -105,9 +105,7 @@ void ADIOI_XFS_Open(ADIO_File fd, int *error_code)
     fd->fp_sys_posn = -1; /* set it to null because we use pread/pwrite */
 
     if ((fd->fd_sys == -1) || (fd->fd_direct == -1)) {
-	*error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
-					   myname, __LINE__, MPI_ERR_IO, "**io",
-					   "**io %s", strerror(errno));
+	*error_code = ADIOI_Err_create_code(mymame, fd->filename, errno);
     }
     else *error_code = MPI_SUCCESS;
 }
diff --git a/src/mpi/romio/adio/common/ad_delete.c b/src/mpi/romio/adio/common/ad_delete.c
index 5e960ba..ae78d7e 100644
--- a/src/mpi/romio/adio/common/ad_delete.c
+++ b/src/mpi/romio/adio/common/ad_delete.c
@@ -18,10 +18,7 @@ void ADIOI_GEN_Delete(const char *filename, int *error_code)
 
     err = unlink(filename);
     if (err == -1) {
-	*error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
-					   myname, __LINE__, MPI_ERR_IO, "**io",
-					   "**io %s", strerror(errno));
-	return;
+	*error_code = ADIOI_Err_create_code(myname, filename, errno);
     }
     else *error_code = MPI_SUCCESS;
 }

http://git.mpich.org/mpich.git/commitdiff/e0154ed8e4048c2b8421362489da6f97f8204e2e

commit e0154ed8e4048c2b8421362489da6f97f8204e2e
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Mon May 5 16:23:06 2014 -0500

    Deal with more errno values
    
    In preparation for using ADIOI_Err_create_code everywhere,
    ADIOI_Err_create_code did not handle some errno values that fs-specific
    drivers were handling.
    
    Signed-off-by: Wei-keng Liao <wkliao at ece.northwestern.edu>

diff --git a/src/mpi/romio/adio/common/error.c b/src/mpi/romio/adio/common/error.c
index 15f2376..e990a5e 100644
--- a/src/mpi/romio/adio/common/error.c
+++ b/src/mpi/romio/adio/common/error.c
@@ -35,14 +35,16 @@ int ADIOI_Error(ADIO_File fd, int error_code, char *string)
 
     return error_code;
 }
-
-/* Returns an MPI error code corresponding to "my_errno", for function "myname"
+/* Check for special error codes for those MPI error
+   classes that relate to particular problems.
+   Returns an MPI error code corresponding to "my_errno", for function "myname"
  * and the given file, "filename".  */
 int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno)
 {
     int error_code = MPI_SUCCESS;
     if(!my_errno) return MPI_SUCCESS;
 
+    /* --BEGIN ERROR HANDLING-- */
     switch(my_errno) {
         case EACCES:
             error_code = MPIO_Err_create_code(MPI_SUCCESS,
@@ -79,6 +81,7 @@ int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno
                                               filename);
             break;
         case EROFS:
+	    /* Read only file or file system and write access requested */
             error_code = MPIO_Err_create_code(MPI_SUCCESS,
                                               MPIR_ERR_RECOVERABLE, myname,
                                               __LINE__, MPI_ERR_READ_ONLY,
@@ -90,12 +93,35 @@ int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno
                                               __LINE__, MPI_ERR_FILE_EXISTS,
                                               "**fileexist", 0);
             break;
+	case ENOTDIR:
+	case ELOOP:
+	    error_code = MPIO_Err_create_code(MPI_SUCCESS,
+					       MPIR_ERR_RECOVERABLE,
+					       myname, __LINE__,
+					       MPI_ERR_BAD_FILE,
+					       "**filenamedir",
+					       "**filenamedir %s",
+					       filename);
+            break;
+	case ENOSPC:
+	    error_code = MPIO_Err_create_code(MPI_SUCCESS,
+		    MPIR_ERR_RECOVERABLE, myname, __LINE__,
+		    MPI_ERR_NO_SPACE,
+		    "**filenospace", 0);
+	    break;
+	case EDQUOT:
+	    error_code = MPIO_Err_create_code(MPI_SUCCESS,
+		    MPIR_ERR_RECOVERABLE, myname, __LINE__,
+		    MPI_ERR_QUOTA,
+		    "**filequota", 0);
+
         default:
             error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
                                               myname, __LINE__, MPI_ERR_IO, "**io",
                                               "**io %s", strerror(my_errno));
             break;
     }
+    /* --END ERROR HANDLING-- */
 
     return error_code;
 }

-----------------------------------------------------------------------

Summary of changes:
 src/mpi/romio/adio/ad_gpfs/ad_gpfs_open.c     |   45 +------------------
 src/mpi/romio/adio/ad_lustre/ad_lustre_open.c |   45 +------------------
 src/mpi/romio/adio/ad_nfs/ad_nfs_open.c       |   59 +------------------------
 src/mpi/romio/adio/ad_panfs/ad_panfs_open.c   |   45 +------------------
 src/mpi/romio/adio/ad_ufs/ad_ufs_open.c       |   60 +------------------------
 src/mpi/romio/adio/ad_xfs/ad_xfs_open.c       |    4 +-
 src/mpi/romio/adio/common/ad_delete.c         |    5 +--
 src/mpi/romio/adio/common/error.c             |   30 +++++++++++-
 8 files changed, 35 insertions(+), 258 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list