1
1

replace the switch-case statement on the basic datatypes by a series of

if-elseif statements to make it compile with OpenMPi again.

Fixes trac:2808

This commit was SVN r24768.

The following Trac tickets were found above:
  Ticket 2808 --> https://svn.open-mpi.org/trac/ompi/ticket/2808
Этот коммит содержится в:
Edgar Gabriel 2011-06-09 15:35:35 +00:00
родитель 8cd5280299
Коммит 0173a00f6b

Просмотреть файл

@ -578,84 +578,94 @@ int convert_named(MPI_Datatype *mpi_dtype,
fprintf(stderr, "NAMED"); fprintf(stderr, "NAMED");
#endif #endif
switch (*mpi_dtype) if (MPI_CHAR == *mpi_dtype)
{ {
case MPI_CHAR:
ret = PVFS_Request_contiguous(1, PVFS_CHAR, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_CHAR, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_CHAR\n"); fprintf(stderr, "-MPI_CHAR\n");
#endif #endif
break; }
case MPI_BYTE: else if ( MPI_BYTE == *mpi_dtype )
ret = PVFS_Request_contiguous(1, PVFS_BYTE, pvfs_dtype); {
ret = PVFS_Request_contiguous(1, PVFS_BYTE, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_BYTE\n"); fprintf(stderr, "-MPI_BYTE\n");
#endif #endif
break; }
case MPI_SHORT: else if ( MPI_SHORT == *mpi_dtype )
ret = PVFS_Request_contiguous(1, PVFS_SHORT, pvfs_dtype); {
ret = PVFS_Request_contiguous(1, PVFS_SHORT, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_SHORT\n"); fprintf(stderr, "-MPI_SHORT\n");
#endif #endif
break; }
case MPI_INT: else if ( MPI_INT == *mpi_dtype )
ret = PVFS_Request_contiguous(1, PVFS_INT, pvfs_dtype); {
ret = PVFS_Request_contiguous(1, PVFS_INT, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_INT\n"); fprintf(stderr, "-MPI_INT\n");
#endif #endif
break; }
case MPI_LONG: else if ( MPI_LONG == *mpi_dtype )
ret = PVFS_Request_contiguous(1, PVFS_LONG, pvfs_dtype); {
ret = PVFS_Request_contiguous(1, PVFS_LONG, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_LONG\n"); fprintf(stderr, "-MPI_LONG\n");
#endif #endif
break; }
case MPI_FLOAT: else if ( MPI_FLOAT == *mpi_dtype )
ret = PVFS_Request_contiguous(1, PVFS_FLOAT, pvfs_dtype); {
ret = PVFS_Request_contiguous(1, PVFS_FLOAT, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_FLOAT\n"); fprintf(stderr, "-MPI_FLOAT\n");
#endif #endif
break; }
case MPI_DOUBLE: else if ( MPI_DOUBLE == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_DOUBLE, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_DOUBLE, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_DOUBLE\n"); fprintf(stderr, "-MPI_DOUBLE\n");
#endif #endif
break; }
case MPI_UNSIGNED_CHAR: else if ( MPI_UNSIGNED_CHAR == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_CHAR, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_CHAR, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_UNSIGNED_CHAR\n"); fprintf(stderr, "-MPI_UNSIGNED_CHAR\n");
#endif #endif
break; }
case MPI_UNSIGNED_SHORT: else if ( MPI_UNSIGNED_SHORT == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_UNSIGNED_SHORT\n"); fprintf(stderr, "-MPI_UNSIGNED_SHORT\n");
#endif #endif
break; }
case MPI_UNSIGNED: else if ( MPI_UNSIGNED == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_SHORT\n"); fprintf(stderr, "-MPI_SHORT\n");
#endif #endif
break; }
case MPI_UNSIGNED_LONG: else if ( MPI_UNSIGNED_LONG == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_LONG, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_LONG, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_UNSIGNED_LONG\n"); fprintf(stderr, "-MPI_UNSIGNED_LONG\n");
#endif #endif
break; }
case MPI_LONG_DOUBLE: else if ( MPI_LONG_DOUBLE == *mpi_dtype )
{
ret = PVFS_Request_contiguous(1, PVFS_LONG_DOUBLE, pvfs_dtype); ret = PVFS_Request_contiguous(1, PVFS_LONG_DOUBLE, pvfs_dtype);
#ifdef DEBUG_DTYPE #ifdef DEBUG_DTYPE
fprintf(stderr, "-MPI_LONG_DOUBLE\n"); fprintf(stderr, "-MPI_LONG_DOUBLE\n");
#endif #endif
break; }
default: else
{
fprintf(stderr, "convert_named: predefined type not found"); fprintf(stderr, "convert_named: predefined type not found");
return -1; return -1;
break;
} }
if (ret != 0) if (ret != 0)
fprintf(stderr, "convert_named: Datatype creation failed\n"); fprintf(stderr, "convert_named: Datatype creation failed\n");