From b4ec81a9fd4ee79bb902bb80070725f9a855aee0 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 21 Feb 2008 20:35:34 +0000 Subject: [PATCH] Fix the Panasas support in ROMIO so it builds without complaints. Required a patch from Brian, plus a few edits by me to remove warnings. NOTE: the code provided by PANASAS includes a "switch" that they left incomplete - it doesn't cover all possibilities. Since the value being switched is an enum, this causes problems for the compiler. I added the missing values, but - since Panasas felt they could be ignored - had the switch generate an error if those cases ever occurred. This commit was SVN r17543. --- .../romio/romio/adio/ad_panfs/ad_panfs_hints.c | 18 +++++++++--------- .../romio/romio/adio/ad_panfs/ad_panfs_open.c | 8 +++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_hints.c b/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_hints.c index 782b3f8a20..d1f320e97d 100644 --- a/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_hints.c +++ b/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_hints.c @@ -6,13 +6,13 @@ * See COPYRIGHT notice in top-level directory. */ +#include "opal/mca/base/mca_base_param.h" #include "ad_panfs.h" #include -#include "opal/mca/base/mca_base_param.h" void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { - static char myname[] = "ADIOI_PANFS_SETINFO"; +/* static char myname[] = "ADIOI_PANFS_SETINFO"; */ char* value; int flag, tmp_val = -1; unsigned long int concurrent_write = 0; @@ -48,7 +48,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) concurrent_write = strtoul(value,NULL,10); tmp_val = concurrent_write; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != concurrent_write) { + if (tmp_val != (int)concurrent_write) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_concurrent_write\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -67,7 +67,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_type = strtoul(value,NULL,10); tmp_val = layout_type; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_type) { + if (tmp_val != (int)layout_type) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_type\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -80,7 +80,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_stripe_unit = strtoul(value,NULL,10); tmp_val = layout_stripe_unit; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_stripe_unit) { + if (tmp_val != (int)layout_stripe_unit) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_stripe_unit\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -93,7 +93,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_parity_stripe_width = strtoul(value,NULL,10); tmp_val = layout_parity_stripe_width; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_parity_stripe_width) { + if (tmp_val != (int)layout_parity_stripe_width) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_parity_stripe_width\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -106,7 +106,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_parity_stripe_depth = strtoul(value,NULL,10); tmp_val = layout_parity_stripe_depth; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_parity_stripe_depth) { + if (tmp_val != (int)layout_parity_stripe_depth) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_parity_stripe_depth\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -119,7 +119,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_total_num_comps = strtoul(value,NULL,10); tmp_val = layout_total_num_comps; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_total_num_comps) { + if (tmp_val != (int)layout_total_num_comps) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_total_num_comps\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } @@ -132,7 +132,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) layout_visit_policy = strtoul(value,NULL,10); tmp_val = layout_visit_policy; MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - if (tmp_val != layout_visit_policy) { + if (tmp_val != (int)layout_visit_policy) { FPRINTF(stderr, "ADIOI_PANFS_SetInfo: the value for key \"panfs_layout_visit_policy\" must be the same on all processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); } diff --git a/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_open.c b/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_open.c index 4e50836c80..0a2d4d2a53 100644 --- a/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_open.c +++ b/ompi/mca/io/romio/romio/adio/ad_panfs/ad_panfs_open.c @@ -133,7 +133,8 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) char* slash; struct stat stat_buf; int err; - char *value, *path, *file_name_ptr; +/* char *value, *path, *file_name_ptr; */ + char *path; /* Check that the file does not exist before * trying to create it. The ioctl itself should @@ -279,6 +280,11 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.layout_visit_policy); MPI_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: + case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10: + MPI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID"); + break; } } }