0.9.3 installation problems on GNU/Linux with lam-mpi

Raimondo Giammanco rongten at member.fsf.org
Tue Feb 3 09:53:47 CST 2004


Hello,

 The errors that I have in testing are the following,

###################
make[1]: Entering directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test'
cd nc_test && make testing
make[2]: Entering directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test/nc_test'
./nc_test -c
Error: Unsupported datatype passed to ADIOI_Count_contiguous_blocks
rm -f scratch.nc
./nc_test
*** Testing ncmpi_strerror ... ok
*** Testing ncmpi_open ...  0: MPI_File_open error = MPI_Error_string:
unknown error

        FAILURE at line 94 of test_read.c: ncmpi_open of nonexistent
file should have returned system error
        ### 1 FAILURES TESTING ncmpi_open! ###
*** Testing ncmpi_close ... ok
*** Testing ncmpi_inq ... ok
*** Testing ncmpi_inq_dimid ... ok
*** Testing ncmpi_inq_dim ...
        FAILURE at line 486 of test_read.c: size expected: 2, got: 0
        FAILURE at line 496 of test_read.c: size expected: 2, got: 0
        ### 2 FAILURES TESTING ncmpi_inq_dim! ###
*** Testing ncmpi_inq_dimlen ...
        FAILURE at line 526 of test_read.c: size expected: 2, got: 0
        ### 1 FAILURES TESTING ncmpi_inq_dimlen! ###
*** Testing ncmpi_inq_dimname ... ok
*** Testing ncmpi_inq_varid ... ok
*** Testing ncmpi_inq_var ... ok
*** Testing ncmpi_inq_natts ... ok
*** Testing ncmpi_inq_ndims ... ok
*** Testing ncmpi_inq_nvars ... ok
*** Testing ncmpi_inq_unlimdim ... ok
*** Testing ncmpi_inq_vardimid ... ok
*** Testing ncmpi_inq_varname ... ok
*** Testing ncmpi_inq_varnatts ... ok
*** Testing ncmpi_inq_varndims ... ok
*** Testing ncmpi_inq_vartype ... ok
*** Testing ncmpi_get_var_text ...
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
        FAILURE at line 559 of test_get.c: value read not that expected
1 good comparisons.
        ### 178 FAILURES TESTING ncmpi_get_var_text! ###
*** Testing ncmpi_get_var_short ...
        FAILURE at line 649 of test_get.c: value read not that expected
        FAILURE at line 649 of test_get.c: value read not that expected
        FAILURE at line 649 of test_get.c: value read not that expected
        FAILURE at line 649 of test_get.c: value read not that expected
        FAILURE at line 639 of test_get.c: Range error: status = 0
        FAILURE at line 639 of test_get.c: Range error: status = 0
        FAILURE at line 639 of test_get.c: Range error: status = 0
        FAILURE at line 649 of test_get.c: value read not that expected
5 good comparisons.
        ### 715 FAILURES TESTING ncmpi_get_var_short! ###
*** Testing ncmpi_get_var_int ...
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 739 of test_get.c: value read not that expected
        FAILURE at line 729 of test_get.c: Range error: status = 0
        FAILURE at line 729 of test_get.c: Range error: status = 0
5 good comparisons.
        ### 1192 FAILURES TESTING ncmpi_get_var_int! ###
*** Testing ncmpi_get_var_long ...
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 829 of test_get.c: value read not that expected
        FAILURE at line 819 of test_get.c: Range error: status = 0
        FAILURE at line 819 of test_get.c: Range error: status = 0
5 good comparisons.
        ### 1192 FAILURES TESTING ncmpi_get_var_long! ###
*** Testing ncmpi_get_var_float ...
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
        FAILURE at line 919 of test_get.c: value read not that expected
5 good comparisons.
        ### 1189 FAILURES TESTING ncmpi_get_var_float! ###
*** Testing ncmpi_get_var_double ...
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
        FAILURE at line 1009 of test_get.c: value read not that expected
5 good comparisons.
        ### 1202 FAILURES TESTING ncmpi_get_var_double! ###
*** Testing ncmpi_get_var1_text ...
        FAILURE at line 61 of test_get.c: Index exceeds dimension bound
        FAILURE at line 61 of test_get.c: Index exceeds dimension bound
        FAILURE at line 64 of test_get.c: expected: -128, got: 0
        FAILURE at line 64 of test_get.c: expected: -128, got: 0
        FAILURE at line 64 of test_get.c: expected: 127, got: 0
        FAILURE at line 64 of test_get.c: expected: -128, got: 0
        FAILURE at line 64 of test_get.c: expected: 127, got: 0
        FAILURE at line 64 of test_get.c: expected: 65, got: 0
1 good comparisons.
        ### 178 FAILURES TESTING ncmpi_get_var1_text! ###
*** Testing ncmpi_get_var1_short ...
        FAILURE at line 141 of test_get.c: Index exceeds dimension bound
        FAILURE at line 141 of test_get.c: Index exceeds dimension bound
        FAILURE at line 141 of test_get.c: Index exceeds dimension bound
        FAILURE at line 141 of test_get.c: Index exceeds dimension bound
        FAILURE at line 152 of test_get.c: Range error: status = -40
        FAILURE at line 152 of test_get.c: Range error: status = -40
        FAILURE at line 152 of test_get.c: Range error: status = -40
        FAILURE at line 152 of test_get.c: Range error: status = -40
5 good comparisons.
        ### 1202 FAILURES TESTING ncmpi_get_var1_short! ###
*** Testing ncmpi_get_var1_int ...
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 221 of test_get.c: Index exceeds dimension bound
        FAILURE at line 232 of test_get.c: Range error: status = -40
        FAILURE at line 232 of test_get.c: Range error: status = -40
5 good comparisons.
        ### 1202 FAILURES TESTING ncmpi_get_var1_int! ###
*** Testing ncmpi_get_var1_long ...
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 301 of test_get.c: Index exceeds dimension bound
        FAILURE at line 312 of test_get.c: Range error: status = -40
        FAILURE at line 312 of test_get.c: Range error: status = -40
5 good comparisons.
        ### 1202 FAILURES TESTING ncmpi_get_var1_long! ###
*** Testing ncmpi_get_var1_float ...
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 396 of test_get.c: OK or Range error: status =
-40
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
        FAILURE at line 381 of test_get.c: Index exceeds dimension bound
5 good comparisons.
        ### 1192 FAILURES TESTING ncmpi_get_var1_float! ###
*** Testing ncmpi_get_var1_double ...
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
        FAILURE at line 461 of test_get.c: Index exceeds dimension bound
5 good comparisons.
        ### 1202 FAILURES TESTING ncmpi_get_var1_double! ###
*** Testing ncmpi_get_vara_text ...
        FAILURE at line 1085 of test_get.c: bad edge: status = -40
        FAILURE at line 1112 of test_get.c: Index exceeds dimension
bound
        FAILURE at line 1163 of test_get.c: Index exceeds dimension
bound
        FAILURE at line 1176 of test_get.c: value read not that expected
        FAILURE at line 1163 of test_get.c: Index exceeds dimension
bound
        FAILURE at line 1176 of test_get.c: value read not that
expectedError: Unsupported datatype passed to
ADIOI_Count_contiguous_blocks
make[2]: Leaving directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test/nc_test'
if [ yes = yes ] ; then cd nf_test && make testing ; fi
make[2]: Entering directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test/nf_test'
m4 -B10000 test_get.m4 >test_get.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib test_get.F
m4 -B10000 test_put.m4 >test_put.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib test_put.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib nf_error.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib nf_test.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib test_read.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib test_write.F
+ /usr/bin/mpif77 -c -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib util.F
/usr/bin/mpicc -c -g -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-I. -I./../../src/libf -I./../../src/lib -I../../src/lib   fortlib.c
/usr/bin/mpif77 -o nf_test -I. -I./../../src/libf -I./../../src/lib
-I../../src/lib   test_get.o test_put.o nf_error.o nf_test.o test_read.o
test_write.o util.o fortlib.o ../../src/lib/libpnetcdf.a  -lm
./nf_test -c
Rank (0, MPI_COMM_WORLD): Call stack within LAM:
Rank (0, MPI_COMM_WORLD):  - MPI_Comm_rank()
Rank (0, MPI_COMM_WORLD):  - main()
make[2]: *** [test.nc] Error 22
make[2]: Leaving directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test/nf_test'
make[1]: *** [testing] Error 2
make[1]: Leaving directory
`/mnt/disposable/TMP_giamma/parallel-netcdf-0.9.3/test'
make: *** [testing] Error 2

###########################

However these errors have been generated with my version of 
mpinetcdf.c; I am including a patch file, but I am not
sure It is correct...



On Tue, 2004-02-03 at 16:25, Rob Ross wrote:
> I'm basically doing the same if conversion here, so if you want to submit 
> your other errors in the mean time, we can go ahead and have a look at 
> those too.
> 
> Thanks,
> 
> Rob
> 
> On Tue, 3 Feb 2004, Raimondo Giammanco wrote:
> 
> > Hello,
> > 
> > I tried to install 0.9.3 on a GNU/Linux PC with lam-mpi-7.0.2,
> > and I am having the following problem:
> > 
> > 1) autoconf
> > 
> > 2) ./configure --prefix=SOME_PATH --with-mpi=/usr
> > 
> > 3) make all
> > 
> > It returns in src/lib
> > 
> > ################
> > mpinetcdf.c: In function `length_of_mpitype':
> > mpinetcdf.c:382: switch quantity not an integer
> > mpinetcdf.c:383: pointers are not permitted as case values
> > mpinetcdf.c:383: case label does not reduce to an integer constant
> > mpinetcdf.c:384: pointers are not permitted as case values
> > mpinetcdf.c:384: case label does not reduce to an integer constant
> > mpinetcdf.c:386: pointers are not permitted as case values
> > mpinetcdf.c:386: case label does not reduce to an integer constant
> > mpinetcdf.c:388: pointers are not permitted as case values
> > mpinetcdf.c:388: case label does not reduce to an integer constant
> > mpinetcdf.c:390: pointers are not permitted as case values
> > mpinetcdf.c:390: case label does not reduce to an integer constant
> > mpinetcdf.c:392: pointers are not permitted as case values
> > mpinetcdf.c:392: case label does not reduce to an integer constant
> > mpinetcdf.c:394: pointers are not permitted as case values
> > mpinetcdf.c:394: case label does not reduce to an integer constant
> > ###############
> > etc. etc. where there is the swith(datatype) command.
> > 
> > I looked a little in /usr/include mpi.h of lam, and
> > I tried to substitute the switches with a series of ifs.
> > 
> > I was able to compile, but I received a series of errors
> > in make testing.
> > 
> > Before submitting the details, I was wondering if this
> > is an implementation problem of lam, or there is some
> > other reason behind this strange behavior.
> > 
> > Is there anybody using lam-mpi and that can give me some pointers?
> > 
> > Best Regards
> > -- 
> > Raimondo Giammanco <rongten at member.fsf.org>
> > 
> > 
-------------- next part --------------
--- mpinetcdf.c	2003-12-12 21:56:41.000000000 +0100
+++ mpinetcdf.c.new	2004-02-03 16:50:52.000000000 +0100
@@ -379,23 +379,36 @@
 
 static int
 length_of_mpitype(MPI_Datatype datatype) {
-  switch(datatype) {
-    case MPI_BYTE:
-    case MPI_CHAR:
-	return ((int)sizeof(char));
-    case MPI_SHORT:
-	return (int)(sizeof(short));
-    case MPI_INT:
-	return((int)sizeof(int)); 
-    case MPI_LONG:
-	return((int)sizeof(long)); 
-    case MPI_FLOAT:
-	return((int)sizeof(float));
-    case MPI_DOUBLE:
-	return((int)sizeof(double));
-    default:
-	fprintf(stderr, "FIXME: unknown type passed to length_of_mpitype\n");
-  }
+
+  if ( (datatype == MPI_BYTE) || (datatype == MPI_CHAR) ) 
+    {
+      return ((int)sizeof(char));
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      return (int)(sizeof(short));
+    }
+  else if (datatype == MPI_INT)
+    {
+      return (int)(sizeof(int));
+    }
+  else if (datatype == MPI_LONG)
+    {
+      return (int)(sizeof(long));
+    }
+  else if (datatype == MPI_FLOAT)
+    {
+      return (int)(sizeof(float));
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      return (int)(sizeof(double));
+    }
+  else
+    {
+      fprintf(stderr, "FIXME: unknown type passed to length_of_mpitype\n");
+    }
+  
 
   return -1;
 }
@@ -451,26 +464,32 @@
   xp = (void *) xbuf;
   data = (void *) buf;
 
-  switch (datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-        break;
-    case MPI_SHORT:
-	status = ncmpix_putn_schar_short(&xp, nelems, (const short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_putn_schar_int(&xp, nelems, (const int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_putn_schar_long(&xp, nelems, (const long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_putn_schar_float(&xp, nelems, (const float *)data);
-        break;
-    case MPI_DOUBLE:
-	status = ncmpix_putn_schar_double(&xp, nelems, (const double *)data);
-        break;
-  }
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_putn_schar_short(&xp, nelems, (const short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_putn_schar_int(&xp, nelems, (const int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_putn_schar_long(&xp, nelems, (const long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_putn_schar_float(&xp, nelems, (const float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_putn_schar_double(&xp, nelems, (const double *)data);
+    }
+  
+
 
   return status;
 }
@@ -485,26 +504,35 @@
   data = (void *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch (datatype) {
-    case MPI_CHAR:
-	status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_putn_short_short(&xp, nelems, (const short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_putn_short_int(&xp, nelems, (const int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_putn_short_long(&xp, nelems, (const long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_putn_short_float(&xp, nelems, (const float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_putn_short_double(&xp, nelems, (const double *)data);
-        break;
-  }
+
+
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_putn_short_short(&xp, nelems, (const short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_putn_short_int(&xp, nelems, (const int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_putn_short_long(&xp, nelems, (const long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_putn_short_float(&xp, nelems, (const float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_putn_short_double(&xp, nelems, (const double *)data);
+    }
+
+
 
   return status;
 } 
@@ -519,26 +547,33 @@
   data = (void *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch (datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_putn_int_short(&xp, nelems, (const short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_putn_int_int(&xp, nelems, (const int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_putn_int_long(&xp, nelems, (const long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_putn_int_float(&xp, nelems, (const float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_putn_int_double(&xp, nelems, (const double *)data);
-        break;
-  }
+
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_putn_int_short(&xp, nelems, (const short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_putn_int_int(&xp, nelems, (const int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_putn_int_long(&xp, nelems, (const long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_putn_int_float(&xp, nelems, (const float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_putn_int_double(&xp, nelems, (const double *)data);
+    }
+
 
   return status;
 } 
@@ -553,26 +588,31 @@
   data = (void *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch (datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_putn_float_short(&xp, nelems, (const short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_putn_float_int(&xp, nelems, (const int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_putn_float_long(&xp, nelems, (const long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_putn_float_float(&xp, nelems, (const float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_putn_float_double(&xp, nelems, (const double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_putn_float_short(&xp, nelems, (const short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_putn_float_int(&xp, nelems, (const int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_putn_float_long(&xp, nelems, (const long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_putn_float_float(&xp, nelems, (const float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_putn_float_double(&xp, nelems, (const double *)data);
+    }
 
   return status;
 } 
@@ -587,26 +627,33 @@
   data = (void *) buf;
   datainc = length_of_mpitype(datatype);  
 
-  switch (datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_putn_double_short(&xp, nelems, (const short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_putn_double_int(&xp, nelems, (const int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_putn_double_long(&xp, nelems, (const long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_putn_double_float(&xp, nelems, (const float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_putn_double_double(&xp, nelems, (const double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_putn_double_short(&xp, nelems, (const short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_putn_double_int(&xp, nelems, (const int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_putn_double_long(&xp, nelems, (const long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_putn_double_float(&xp, nelems, (const float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_putn_double_double(&xp, nelems, (const double *)data);
+    }
+
+
 
   return status;
 } 
@@ -619,26 +666,32 @@
   xp = (void *) xbuf;
   data = (void *) buf;
 
-  switch (datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-        break;
-    case MPI_SHORT:
-        status = ncmpix_getn_schar_short((const void **)&xp, nelems, (short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_getn_schar_int((const void **)&xp, nelems, (int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_getn_schar_long((const void **)&xp, nelems, (long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_getn_schar_float((const void **)&xp, nelems, (float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_getn_schar_double((const void **)&xp, nelems, (double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_getn_schar_short((const void **)&xp, nelems, (short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_getn_schar_int((const void **)&xp, nelems, (int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_getn_schar_long((const void **)&xp, nelems, (long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_getn_schar_float((const void **)&xp, nelems, (float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_getn_schar_double((const void **)&xp, nelems, (double *)data);
+    }
+
 
   return status;
 }
@@ -653,26 +706,33 @@
   data = (char *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch(datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_getn_short_short((const void **)&xp, nelems, (short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_getn_short_int((const void **)&xp, nelems, (int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_getn_short_long((const void **)&xp, nelems, (long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_getn_short_float((const void **)&xp, nelems, (float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_getn_short_double((const void **)&xp, nelems, (double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_getn_short_short((const void **)&xp, nelems, (short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_getn_short_int((const void **)&xp, nelems, (int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_getn_short_long((const void **)&xp, nelems, (long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_getn_short_float((const void **)&xp, nelems, (float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_getn_short_double((const void **)&xp, nelems, (double *)data);
+    }
+
+
 
   return status;
 } 
@@ -687,26 +747,31 @@
   data = (char *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch(datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_getn_int_short((const void **)&xp, nelems, (short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_getn_int_int((const void **)&xp, nelems, (int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_getn_int_long((const void **)&xp, nelems, (long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_getn_int_float((const void **)&xp, nelems, (float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_getn_int_double((const void **)&xp, nelems, (double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_getn_int_short((const void **)&xp, nelems, (short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_getn_int_int((const void **)&xp, nelems, (int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_getn_int_long((const void **)&xp, nelems, (long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_getn_int_float((const void **)&xp, nelems, (float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_getn_int_double((const void **)&xp, nelems, (double *)data);
+    }
 
   return status;
 } 
@@ -721,26 +786,32 @@
   data = (char *) buf;
   datainc = length_of_mpitype(datatype);
  
-  switch(datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_getn_float_short((const void **)&xp, nelems, (short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_getn_float_int((const void **)&xp, nelems, (int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_getn_float_long((const void **)&xp, nelems, (long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_getn_float_float((const void **)&xp, nelems, (float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_getn_float_double((const void **)&xp, nelems, (double *)data);
-        break;
-  }
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_getn_float_short((const void **)&xp, nelems, (short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_getn_float_int((const void **)&xp, nelems, (int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_getn_float_long((const void **)&xp, nelems, (long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_getn_float_float((const void **)&xp, nelems, (float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_getn_float_double((const void **)&xp, nelems, (double *)data);
+    }
+
+
 
   return status;
 }
@@ -755,26 +826,32 @@
   data = (char *) buf;
   datainc = length_of_mpitype(datatype);
                                                                                     
-  switch(datatype) {
-    case MPI_CHAR:
-        status = NC_ECHAR;
-	break;
-    case MPI_SHORT:
-        status = ncmpix_getn_double_short((const void **)&xp, nelems, (short *)data);
-        break;
-    case MPI_INT:
-        status = ncmpix_getn_double_int((const void **)&xp, nelems, (int *)data);
-        break;
-    case MPI_LONG:
-        status = ncmpix_getn_double_long((const void **)&xp, nelems, (long *)data);
-        break;
-    case MPI_FLOAT:
-        status = ncmpix_getn_double_float((const void **)&xp, nelems, (float *)data);
-        break;
-    case MPI_DOUBLE:
-        status = ncmpix_getn_double_double((const void **)&xp, nelems, (double *)data);
-        break;
-  }
+
+  if (datatype == MPI_CHAR)
+    {
+      status = NC_ECHAR;
+    }
+  else if (datatype == MPI_SHORT)
+    {
+      status = ncmpix_getn_double_short((const void **)&xp, nelems, (short *)data);
+    }
+  else if (datatype == MPI_INT)
+    {
+      status = ncmpix_getn_double_int((const void **)&xp, nelems, (int *)data);
+    }
+  else if (datatype == MPI_LONG)
+    {
+      status = ncmpix_getn_double_long((const void **)&xp, nelems, (long *)data);
+    }  
+  else if (datatype == MPI_FLOAT)
+    {
+      status = ncmpix_getn_double_float((const void **)&xp, nelems, (float *)data);
+    }
+  else if (datatype == MPI_DOUBLE)
+    {
+      status = ncmpix_getn_double_double((const void **)&xp, nelems, (double *)data);
+    }
+
 
   return status;
 }


More information about the parallel-netcdf mailing list