[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-67-gbb70789

Service Account noreply at mpich.org
Tue Aug 4 11:02:37 CDT 2015


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  bb707893aa7fe5d0741abd306698fe7397763c36 (commit)
       via  3e968df88eeeb8d1a7865af2ff020032a76c537b (commit)
       via  9d4d43f1562e2c0cd9ac42d8da3d45ce6e06d075 (commit)
      from  5fb28f76adbf88aa5f27fcfbe9d0a48109d7a149 (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/bb707893aa7fe5d0741abd306698fe7397763c36

commit bb707893aa7fe5d0741abd306698fe7397763c36
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Fri Jul 31 10:05:47 2015 -0500

    configure-time check for newer PanFS features
    
    recent versions of PanFS provide a 'RADID N', instead of classic RADID0,
    RAID5, etc.
    
    Tested-by: Ron Victorelli <rvictorelli at panasas.com>
    No Reviewer

diff --git a/src/mpi/romio/adio/ad_panfs/Makefile.mk b/src/mpi/romio/adio/ad_panfs/Makefile.mk
index 68e92d5..ad412d9 100644
--- a/src/mpi/romio/adio/ad_panfs/Makefile.mk
+++ b/src/mpi/romio/adio/ad_panfs/Makefile.mk
@@ -5,13 +5,20 @@
 ##     See COPYRIGHT in top-level directory.
 ##
 
+if BUILD_PANFS_OPEN6
+# override open with one that uses newer features
+panfs_open = adio/ad_panfs/ad_panfs_open6.c
+else
+panfs_open = adio/ad_panfs/ad_panfs_open.c
+endif
+
 if BUILD_AD_PANFS
 
 noinst_HEADERS += adio/ad_panfs/ad_panfs.h
 
 romio_other_sources +=              \
     adio/ad_panfs/ad_panfs.c        \
-    adio/ad_panfs/ad_panfs_open.c   \
+    $(panfs_open)                   \
     adio/ad_panfs/ad_panfs_hints.c  \
     adio/ad_panfs/ad_panfs_read.c   \
     adio/ad_panfs/ad_panfs_resize.c \
diff --git a/src/mpi/romio/adio/ad_panfs/ad_panfs.c b/src/mpi/romio/adio/ad_panfs/ad_panfs.c
index fc75f7d..8bc14fc 100644
--- a/src/mpi/romio/adio/ad_panfs/ad_panfs.c
+++ b/src/mpi/romio/adio/ad_panfs/ad_panfs.c
@@ -11,8 +11,18 @@
 /* adioi.h has the ADIOI_Fns_struct define */
 #include "adioi.h"
 
+#ifndef ROMIOCONF_H_INCLUDED
+#include "romioconf.h"
+#define ROMIOCONF_H_INCLUDED
+#endif
+
+
 struct ADIOI_Fns_struct ADIO_PANFS_operations = {
-    ADIOI_PANFS_Open, /* Open */
+#ifdef HAVE_PAN_FS_CLIENT_RAIDN_ENCODING_T
+    ADIOI_PANFS_Open6, /* Open, using newer Panasas features */
+#else
+    ADIOI_PANFS_Open,  /* open, but using Panasas5 and earlier features */
+#endif
     ADIOI_GEN_OpenColl,
     ADIOI_PANFS_ReadContig, /* ReadContig */
     ADIOI_PANFS_WriteContig, /* WriteContig */
diff --git a/src/mpi/romio/configure.ac b/src/mpi/romio/configure.ac
index 5753856..598e790 100644
--- a/src/mpi/romio/configure.ac
+++ b/src/mpi/romio/configure.ac
@@ -792,7 +792,10 @@ if test -n "$file_system_panfs"; then
 	AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS]),
 	AC_MSG_ERROR([PANFS support requested but cannot find pan_fs_client_cw_mode.h header file])
     )
+    AC_CHECK_TYPES([pan_fs_client_raidn_encoding_t], , ,
+		   [[#include <pan_fs_client_cw_mode.h>]])
 fi
+AM_CONDITIONAL([BUILD_PANFS_OPEN6], [test "X$ac_cv_type_pan_fs_client_raidn_encoding_t" = "Xyes"])
 
 if test -n "$file_system_ufs"; then
     AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])

http://git.mpich.org/mpich.git/commitdiff/3e968df88eeeb8d1a7865af2ff020032a76c537b

commit 3e968df88eeeb8d1a7865af2ff020032a76c537b
Author: Ron Victorelli <rvictorelli at pgh-octal-9-1.palab.panasas.com>
Date:   Fri Jul 31 16:16:10 2015 -0500

    Remove RAID0 support and add RAIDN to MPICH
    
    Signed-off-by: Rob Latham <robl at mcs.anl.gov>

diff --git a/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c b/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c
index 8457793..6906ff0 100644
--- a/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c
+++ b/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c
@@ -32,7 +32,9 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
         unsigned long int layout_parity_stripe_width = 0;
         unsigned long int layout_parity_stripe_depth = 0;
         unsigned long int layout_total_num_comps = 0;
+        unsigned long int layout_max_faults = 2;
         pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN;
+        pan_fs_client_raidn_encoding_t layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS;
         int myrank;
 
         MPI_Comm_rank(fd->comm, &myrank);
@@ -61,33 +63,84 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
         if (flag) {
             layout_parity_stripe_depth = strtoul(value, NULL, 10);
         }
+        ADIOI_Info_get(fd->info, "panfs_layout_max_faults", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_max_faults = strtoul(value, NULL, 10);
+        }
         ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, value, &flag);
         if (flag) {
             layout_visit_policy = strtoul(value, NULL, 10);
         }
+        ADIOI_Info_get(fd->info, "panfs_layout_encoding", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_encoding = strtoul(value, NULL, 10);
+        }
         ADIOI_Free(value);
 
         amode = amode | O_CREAT;
-        /* Check for valid set of hints */
-        if ((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT) ||
-            (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) {
+        /* Check for valid set of hints
+         *
+         * Note that RAID0 has been dropped.  In the event PAN_FS_CLIENT_LAYOUT_TYPE__RAID0
+         * enumeraion no longer exists, the following check will still be correct.
+         *
+         * The enumerations looks as follows:
+         *
+         * enum pan_fs_client_layout_agg_type_e {
+         * PAN_FS_CLIENT_LAYOUT_TYPE__INVALID                 = 0,    - *INVALID
+         * PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT                 = 1,    - VALID
+         * PAN_FS_CLIENT_LAYOUT_TYPE__RAID0                   = 2,    - *INVALID
+         * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE   = 3,    - VALID
+         * PAN_FS_CLIENT_LAYOUT_TYPE__RAID10                  = 4,    - VALID
+         * PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE     = 5     - VALID
+         * };
+         */
+        if (((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) &&
+             (layout_type != PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT)) ||
+            (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) {
             FPRINTF(stderr, "%s: panfs_layout_type is not a valid value: %u.\n", myname,
                     layout_type);
             MPI_Abort(MPI_COMM_WORLD, 1);
         }
-        if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) &&
-            ((layout_stripe_unit == 0) || (layout_total_num_comps == 0))) {
-            if (layout_stripe_unit == 0) {
+        if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) {
+            if ((layout_stripe_unit == 0) ||
+                (layout_parity_stripe_width == 0) ||
+                (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) {
+                if (layout_stripe_unit == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_total_num_comps == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_parity_stripe_width == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_parity_stripe_depth == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+            /* as of 6.0.x release, we only support max_faults == 2 */
+            if (layout_max_faults != 2) {
                 FPRINTF(stderr,
-                        "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                        "%s: panfs_layout_max_faults is not a valid value. Setting default of 2\n",
                         myname);
+                layout_max_faults = 2;
             }
-            if (layout_total_num_comps == 0) {
+            /* as of 6.0.x release, we only support RS enconding */
+            if (layout_encoding != PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS) {
                 FPRINTF(stderr,
-                        "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
-                        myname);
+                        "%s: panfs_layout_encoding is not a valid value: %u. Setting to default of %u\n",
+                        myname, layout_encoding, PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS);
+                layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS;
             }
-            MPI_Abort(MPI_COMM_WORLD, 1);
         }
         if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
             if ((layout_stripe_unit == 0) ||
@@ -149,9 +202,9 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
          * already optimizes performance by only calling this function with
          * ADIO_CREATE on rank 0.  Therefore, we don't need to worry about
          * implementing that optimization here. */
-        if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) ||
-            (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE)
-            || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) {
+        if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) ||
+            (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) ||
+            (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) {
             pan_fs_client_layout_create_args_t file_create_args;
             int fd_dir;
             char *slash;
@@ -173,10 +226,13 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
                 MPI_Abort(MPI_COMM_WORLD, 1);
             }
             else if (err == 0) {
+                /* ensure that we have the same semantics here and in the call to creat(). In the latter, we do not
+                 * use O_EXCL so a create on an existing file should not fail.
+                 */
                 FPRINTF(stderr,
-                        "%s: Cannot create PanFS file with ioctl when file already exists.\n",
+                        "%s: Cannot create PanFS file with ioctl when file already exists, using open() syscall.\n",
                         myname);
-                MPI_Abort(MPI_COMM_WORLD, 1);
+                goto use_open_syscall;
             }
             else {
                 /* (err == -1) && (errno == ENOENT) */
@@ -216,7 +272,20 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
                                   strlen(fd->filename) + 1);
                     file_create_args.layout.agg_type = layout_type;
                     file_create_args.layout.layout_is_valid = 1;
-                    if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
+                    if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) {
+                        file_create_args.layout.u.raidn_parity_stripe.total_num_comps =
+                            layout_total_num_comps;
+                        file_create_args.layout.u.raidn_parity_stripe.parity_stripe_width =
+                            layout_parity_stripe_width;
+                        file_create_args.layout.u.raidn_parity_stripe.parity_stripe_depth =
+                            layout_parity_stripe_depth;
+                        file_create_args.layout.u.raidn_parity_stripe.stripe_unit =
+                            layout_stripe_unit;
+                        file_create_args.layout.u.raidn_parity_stripe.max_faults =
+                            layout_max_faults;
+                        file_create_args.layout.u.raidn_parity_stripe.encoding = layout_encoding;
+                    }
+                    else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
                         file_create_args.layout.u.raid1_5_parity_stripe.total_num_comps =
                             layout_total_num_comps;
                         file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_width =
@@ -228,10 +297,6 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
                         file_create_args.layout.u.raid1_5_parity_stripe.layout_visit_policy =
                             layout_visit_policy;
                     }
-                    else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) {
-                        file_create_args.layout.u.raid0.total_num_comps = layout_total_num_comps;
-                        file_create_args.layout.u.raid0.stripe_unit = layout_stripe_unit;
-                    }
                     else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) {
                         file_create_args.layout.u.raid10.total_num_comps = layout_total_num_comps;
                         file_create_args.layout.u.raid10.stripe_unit = layout_stripe_unit;
@@ -250,6 +315,7 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
             }
         }
         else {
+          use_open_syscall:;
             int create_fd = open(fd->filename, amode, perm);
             if (create_fd != -1) {
                 close(create_fd);
@@ -299,13 +365,27 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
             ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
             if (file_query_args.layout.layout_is_valid == 1) {
                 switch (file_query_args.layout.agg_type) {
-                case PAN_FS_CLIENT_LAYOUT_TYPE__RAID0:
+                case PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE:
                     ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
-                                   file_query_args.layout.u.raid0.stripe_unit);
+                                   file_query_args.layout.u.raidn_parity_stripe.stripe_unit);
                     ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
                     ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
-                                   file_query_args.layout.u.raid0.total_num_comps);
+                                   file_query_args.layout.u.raidn_parity_stripe.
+                                   parity_stripe_width);
+                    ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raidn_parity_stripe.
+                                   parity_stripe_depth);
+                    ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raidn_parity_stripe.total_num_comps);
                     ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raidn_parity_stripe.max_faults);
+                    ADIOI_Info_set(fd->info, "panfs_layout_max_faults", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raidn_parity_stripe.encoding);
+                    ADIOI_Info_set(fd->info, "panfs_layout_encoding", temp_buffer);
                     break;
                 case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
                     ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",

http://git.mpich.org/mpich.git/commitdiff/9d4d43f1562e2c0cd9ac42d8da3d45ce6e06d075

commit 9d4d43f1562e2c0cd9ac42d8da3d45ce6e06d075
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Fri Jul 31 16:09:32 2015 -0500

    Laying foundation for new features for Panasas
    
    New versions of Panasas (Panfs-6 and up) implement RAID0 and RAID5 in
    terms of newer RAIDN support, but Panfs-5 and older don't know what
    RAIDN is.  This new 'open6' will in subsequent patches make use of new
    features, but we'll keep the old open around in case sites have not
    upgraded.

diff --git a/src/mpi/romio/adio/ad_panfs/ad_panfs.h b/src/mpi/romio/adio/ad_panfs/ad_panfs.h
index 0f2e9f5..31a0f3d 100644
--- a/src/mpi/romio/adio/ad_panfs/ad_panfs.h
+++ b/src/mpi/romio/adio/ad_panfs/ad_panfs.h
@@ -32,6 +32,8 @@
 #endif
 
 void ADIOI_PANFS_Open(ADIO_File fd, int *error_code);
+/* Panasas 6 introduced some new features */
+void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code);
 void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
 void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, 
 			  MPI_Datatype datatype, int file_ptr_type,
diff --git a/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c b/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c
new file mode 100644
index 0000000..8457793
--- /dev/null
+++ b/src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c
@@ -0,0 +1,360 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *   ad_panfs_open.c
+ *
+ *   Copyright (C) 2001 University of Chicago.
+ *   See COPYRIGHT notice in top-level directory.
+ */
+
+#include "ad_panfs.h"
+#include <string.h>
+#include <pan_fs_client_cw_mode.h>
+#define TEMP_BUFFER_SIZE 64
+
+void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
+{
+    char *value;
+    int perm, old_mask, amode, flag;
+    static char myname[] = "ADIOI_PANFS_OPEN6";
+
+    if (fd->perm == ADIO_PERM_NULL) {
+        old_mask = umask(022);
+        umask(old_mask);
+        perm = ~old_mask & 0666;
+    }
+    else
+        perm = fd->perm;
+
+    amode = 0;
+    if (fd->access_mode & ADIO_CREATE) {
+        pan_fs_client_layout_agg_type_t layout_type = PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT;
+        unsigned long int layout_stripe_unit = 0;
+        unsigned long int layout_parity_stripe_width = 0;
+        unsigned long int layout_parity_stripe_depth = 0;
+        unsigned long int layout_total_num_comps = 0;
+        pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN;
+        int myrank;
+
+        MPI_Comm_rank(fd->comm, &myrank);
+
+        *error_code = MPI_SUCCESS;
+        value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
+        ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_type = strtoul(value, NULL, 10);
+        }
+        ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_stripe_unit = strtoul(value, NULL, 10);
+        }
+        ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_total_num_comps = strtoul(value, NULL, 10);
+        }
+        ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL,
+                       value, &flag);
+        if (flag) {
+            layout_parity_stripe_width = strtoul(value, NULL, 10);
+        }
+        ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL,
+                       value, &flag);
+        if (flag) {
+            layout_parity_stripe_depth = strtoul(value, NULL, 10);
+        }
+        ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, value, &flag);
+        if (flag) {
+            layout_visit_policy = strtoul(value, NULL, 10);
+        }
+        ADIOI_Free(value);
+
+        amode = amode | O_CREAT;
+        /* Check for valid set of hints */
+        if ((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT) ||
+            (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) {
+            FPRINTF(stderr, "%s: panfs_layout_type is not a valid value: %u.\n", myname,
+                    layout_type);
+            MPI_Abort(MPI_COMM_WORLD, 1);
+        }
+        if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) &&
+            ((layout_stripe_unit == 0) || (layout_total_num_comps == 0))) {
+            if (layout_stripe_unit == 0) {
+                FPRINTF(stderr,
+                        "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                        myname);
+            }
+            if (layout_total_num_comps == 0) {
+                FPRINTF(stderr,
+                        "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                        myname);
+            }
+            MPI_Abort(MPI_COMM_WORLD, 1);
+        }
+        if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
+            if ((layout_stripe_unit == 0) ||
+                (layout_parity_stripe_width == 0) ||
+                (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) {
+                if (layout_stripe_unit == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_total_num_comps == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_parity_stripe_width == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_parity_stripe_depth == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+            if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
+                (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
+            {
+                FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname,
+                        layout_visit_policy);
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+        }
+        if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) {
+            if ((layout_stripe_unit == 0) || (layout_total_num_comps == 0)) {
+                if (layout_stripe_unit == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                if (layout_total_num_comps == 0) {
+                    FPRINTF(stderr,
+                            "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
+                            myname);
+                }
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+            if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
+                (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
+            {
+                FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname,
+                        layout_visit_policy);
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+        }
+        /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller
+         * already optimizes performance by only calling this function with
+         * ADIO_CREATE on rank 0.  Therefore, we don't need to worry about
+         * implementing that optimization here. */
+        if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) ||
+            (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE)
+            || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) {
+            pan_fs_client_layout_create_args_t file_create_args;
+            int fd_dir;
+            char *slash;
+            struct stat stat_buf;
+            int err;
+            char *path;
+
+            /* Check that the file does not exist before
+             * trying to create it.  The ioctl itself should
+             * be able to handle this condition.  Currently,
+             * the ioctl will return successfully if the file
+             * has been previously created.  Filed bug 33862
+             * to track the problem.
+             */
+            err = stat(fd->filename, &stat_buf);
+            if ((err == -1) && (errno != ENOENT)) {
+                FPRINTF(stderr, "%s: Unexpected I/O Error calling stat() on PanFS file: %s.\n",
+                        myname, strerror(errno));
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+            else if (err == 0) {
+                FPRINTF(stderr,
+                        "%s: Cannot create PanFS file with ioctl when file already exists.\n",
+                        myname);
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+            else {
+                /* (err == -1) && (errno == ENOENT) */
+                /* File does not exist */
+                path = ADIOI_Strdup(fd->filename);
+                slash = strrchr(path, '/');
+                if (!slash)
+                    ADIOI_Strncpy(path, ".", 2);
+                else {
+                    if (slash == path)
+                        *(path + 1) = '\0';
+                    else
+                        *slash = '\0';
+                }
+
+                /* create PanFS object */
+                memset(&file_create_args, 0, sizeof(pan_fs_client_layout_create_args_t));
+                /* open directory */
+                fd_dir = open(path, O_RDONLY);
+                if (fd_dir < 0) {
+                    FPRINTF(stderr,
+                            "%s: I/O Error opening parent directory to create PanFS file using ioctl: %s.\n",
+                            myname, strerror(errno));
+                    MPI_Abort(MPI_COMM_WORLD, 1);
+                }
+                else {
+                    char *file_name_ptr = fd->filename;
+                    slash = strrchr(fd->filename, '/');
+                    if (slash) {
+                        file_name_ptr = slash + 1;
+                    }
+                    /* create file in the directory */
+                    file_create_args.mode = perm;
+                    file_create_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
+                    file_create_args.flags = PAN_FS_CLIENT_LAYOUT_CREATE_F__NONE;
+                    ADIOI_Strncpy(file_create_args.filename, file_name_ptr,
+                                  strlen(fd->filename) + 1);
+                    file_create_args.layout.agg_type = layout_type;
+                    file_create_args.layout.layout_is_valid = 1;
+                    if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
+                        file_create_args.layout.u.raid1_5_parity_stripe.total_num_comps =
+                            layout_total_num_comps;
+                        file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_width =
+                            layout_parity_stripe_width;
+                        file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_depth =
+                            layout_parity_stripe_depth;
+                        file_create_args.layout.u.raid1_5_parity_stripe.stripe_unit =
+                            layout_stripe_unit;
+                        file_create_args.layout.u.raid1_5_parity_stripe.layout_visit_policy =
+                            layout_visit_policy;
+                    }
+                    else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) {
+                        file_create_args.layout.u.raid0.total_num_comps = layout_total_num_comps;
+                        file_create_args.layout.u.raid0.stripe_unit = layout_stripe_unit;
+                    }
+                    else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) {
+                        file_create_args.layout.u.raid10.total_num_comps = layout_total_num_comps;
+                        file_create_args.layout.u.raid10.stripe_unit = layout_stripe_unit;
+                        file_create_args.layout.u.raid10.layout_visit_policy = layout_visit_policy;
+                    }
+                    err = ioctl(fd_dir, PAN_FS_CLIENT_LAYOUT_CREATE_FILE, &file_create_args);
+                    if (err < 0) {
+                        FPRINTF(stderr,
+                                "%s: I/O Error doing ioctl on parent directory to create PanFS file using ioctl: %s.\n",
+                                myname, strerror(errno));
+                        MPI_Abort(MPI_COMM_WORLD, 1);
+                    }
+                    err = close(fd_dir);
+                }
+                ADIOI_Free(path);
+            }
+        }
+        else {
+            int create_fd = open(fd->filename, amode, perm);
+            if (create_fd != -1) {
+                close(create_fd);
+            }
+            else {
+                FPRINTF(stderr, "%s: I/O Error creating PanFS file using open: %s.\n", myname,
+                        strerror(errno));
+                MPI_Abort(MPI_COMM_WORLD, 1);
+            }
+        }
+    }
+    if (fd->access_mode & ADIO_RDONLY)
+        amode = amode | O_RDONLY;
+    if (fd->access_mode & ADIO_WRONLY)
+        amode = amode | O_WRONLY;
+    if (fd->access_mode & ADIO_RDWR)
+        amode = amode | O_RDWR;
+    if (fd->access_mode & ADIO_EXCL)
+        amode = amode | O_EXCL;
+
+    value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
+    ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL, value, &flag);
+    if (flag) {
+        unsigned long int concurrent_write = strtoul(value, NULL, 10);
+        if (concurrent_write == 1) {
+            amode = amode | O_CONCURRENT_WRITE;
+        }
+    }
+    ADIOI_Free(value);
+
+    fd->fd_sys = open(fd->filename, amode, perm);
+    fd->fd_direct = -1;
+
+    if (fd->fd_sys != -1) {
+        int rc;
+        char temp_buffer[TEMP_BUFFER_SIZE];
+        pan_fs_client_layout_query_args_t file_query_args;
+        memset(&file_query_args, 0, sizeof(pan_fs_client_layout_query_args_t));
+        file_query_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
+        rc = ioctl(fd->fd_sys, PAN_FS_CLIENT_LAYOUT_QUERY_FILE, &file_query_args);
+        if (rc < 0) {
+            /* Error - set layout type to unknown */
+            ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
+        }
+        else {
+            ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
+            ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
+            if (file_query_args.layout.layout_is_valid == 1) {
+                switch (file_query_args.layout.agg_type) {
+                case PAN_FS_CLIENT_LAYOUT_TYPE__RAID0:
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid0.stripe_unit);
+                    ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid0.total_num_comps);
+                    ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
+                    break;
+                case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
+                    ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid1_5_parity_stripe.
+                                   parity_stripe_width);
+                    ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid1_5_parity_stripe.
+                                   parity_stripe_depth);
+                    ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps);
+                    ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid1_5_parity_stripe.
+                                   layout_visit_policy);
+                    ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
+                    break;
+                case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10:
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid10.stripe_unit);
+                    ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid10.total_num_comps);
+                    ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
+                    ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
+                                   file_query_args.layout.u.raid10.layout_visit_policy);
+                    ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
+                    break;
+                case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID:
+                case PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT:
+                    MPI_Info_set(fd->info, "panfs_layout_type",
+                                 "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
+                default:
+                    break;
+                }
+            }
+        }
+    }
+
+    if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
+        fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
+
+    if (fd->fd_sys == -1) {
+        *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
+    }
+    else
+        *error_code = MPI_SUCCESS;
+}

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

Summary of changes:
 src/mpi/romio/adio/ad_panfs/Makefile.mk      |    9 +-
 src/mpi/romio/adio/ad_panfs/ad_panfs.c       |   12 +-
 src/mpi/romio/adio/ad_panfs/ad_panfs.h       |    2 +
 src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c |  440 ++++++++++++++++++++++++++
 src/mpi/romio/configure.ac                   |    3 +
 5 files changed, 464 insertions(+), 2 deletions(-)
 create mode 100644 src/mpi/romio/adio/ad_panfs/ad_panfs_open6.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list