|
From: <sv...@va...> - 2006-03-08 20:41:54
|
Author: sewardj
Date: 2006-03-08 20:41:44 +0000 (Wed, 08 Mar 2006)
New Revision: 5728
Log:
Add showCombiner and move showTy to a better place.
Modified:
trunk/auxprogs/mpiwrap.c
Modified: trunk/auxprogs/mpiwrap.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/mpiwrap.c 2006-03-08 15:27:37 UTC (rev 5727)
+++ trunk/auxprogs/mpiwrap.c 2006-03-08 20:41:44 UTC (rev 5728)
@@ -183,6 +183,66 @@
exit(1);
}
=20
+/* Half-hearted type-showing function (for debugging). */
+static void showTy ( FILE* f, MPI_Datatype ty )
+{
+ if (ty =3D=3D MPI_DATATYPE_NULL) fprintf(f,"DATATYPE_NULL");
+ else if (ty =3D=3D MPI_BYTE) fprintf(f,"BYTE");
+ else if (ty =3D=3D MPI_PACKED) fprintf(f,"PACKED");
+ else if (ty =3D=3D MPI_CHAR) fprintf(f,"CHAR");
+ else if (ty =3D=3D MPI_SHORT) fprintf(f,"SHORT");
+ else if (ty =3D=3D MPI_INT) fprintf(f,"INT");
+ else if (ty =3D=3D MPI_LONG) fprintf(f,"LONG");
+ else if (ty =3D=3D MPI_FLOAT) fprintf(f,"FLOAT");
+ else if (ty =3D=3D MPI_DOUBLE) fprintf(f,"DOUBLE");
+ else if (ty =3D=3D MPI_LONG_DOUBLE) fprintf(f,"LONG_DOUBLE");
+ else if (ty =3D=3D MPI_UNSIGNED_CHAR) fprintf(f,"UNSIGNED_CHAR");
+ else if (ty =3D=3D MPI_UNSIGNED_SHORT) fprintf(f,"UNSIGNED_SHORT");
+ else if (ty =3D=3D MPI_UNSIGNED_LONG) fprintf(f,"UNSIGNED_LONG");
+ else if (ty =3D=3D MPI_UNSIGNED) fprintf(f,"UNSIGNED");
+ else if (ty =3D=3D MPI_FLOAT_INT) fprintf(f,"FLOAT_INT");
+ else if (ty =3D=3D MPI_DOUBLE_INT) fprintf(f,"DOUBLE_INT");
+ else if (ty =3D=3D MPI_LONG_DOUBLE_INT) fprintf(f,"LONG_DOUBLE_INT");
+ else if (ty =3D=3D MPI_LONG_INT) fprintf(f,"LONG_INT");
+ else if (ty =3D=3D MPI_SHORT_INT) fprintf(f,"SHORT_INT");
+ else if (ty =3D=3D MPI_2INT) fprintf(f,"2INT");
+ else if (ty =3D=3D MPI_UB) fprintf(f,"UB");
+ else if (ty =3D=3D MPI_LB) fprintf(f,"LB");
+# if defined(MPI_WCHAR)
+ else if (ty =3D=3D MPI_WCHAR) fprintf(f,"WCHAR");
+# endif
+ else if (ty =3D=3D MPI_LONG_LONG_INT) fprintf(f,"LONG_LONG_INT");
+ else if (ty =3D=3D MPI_LONG_LONG) fprintf(f,"LONG_LONG");
+ else if (ty =3D=3D MPI_UNSIGNED_LONG_LONG) fprintf(f,"UNSIGNED_LONG_L=
ONG");
+ else fprintf(f,"showTy:???");
+}
+
+static void showCombiner ( FILE* f, int combiner )
+{
+ switch (combiner) {
+ case MPI_COMBINER_NAMED: fprintf(f, "NAMED"); break;
+ case MPI_COMBINER_DUP: fprintf(f, "DUP"); break;
+ case MPI_COMBINER_CONTIGUOUS: fprintf(f, "CONTIGUOUS"); break;
+ case MPI_COMBINER_VECTOR: fprintf(f, "VECTOR"); break;
+ case MPI_COMBINER_HVECTOR_INTEGER: fprintf(f, "HVECTOR_INTEGER"); =
break;
+ case MPI_COMBINER_HVECTOR: fprintf(f, "HVECTOR"); break;
+ case MPI_COMBINER_INDEXED: fprintf(f, "INDEXED"); break;
+ case MPI_COMBINER_HINDEXED_INTEGER: fprintf(f, "HINDEXED_INTEGER")=
; break;
+ case MPI_COMBINER_HINDEXED: fprintf(f, "HINDEXED"); break;
+ case MPI_COMBINER_INDEXED_BLOCK: fprintf(f, "INDEXED_BLOCK"); brea=
k;
+ case MPI_COMBINER_STRUCT_INTEGER: fprintf(f, "STRUCT_INTEGER"); br=
eak;
+ case MPI_COMBINER_STRUCT: fprintf(f, "STRUCT"); break;
+ case MPI_COMBINER_SUBARRAY: fprintf(f, "SUBARRAY"); break;
+ case MPI_COMBINER_DARRAY: fprintf(f, "DARRAY"); break;
+ case MPI_COMBINER_F90_REAL: fprintf(f, "F90_REAL"); break;
+ case MPI_COMBINER_F90_COMPLEX: fprintf(f, "F90_COMPLEX"); break;
+ case MPI_COMBINER_F90_INTEGER: fprintf(f, "F90_INTEGER"); break;
+ case MPI_COMBINER_RESIZED: fprintf(f, "RESIZED"); break;
+ default: fprintf(f, "showCombiner:??"); break;
+ }
+}
+
+
/* ------ Get useful bits of info ------ */
=20
/* Note, PMPI_Comm_rank/size are themselves wrapped. Should work
@@ -255,40 +315,6 @@
}
}
=20
-/* Half-hearted type-showing function (for debugging). */
-static void showTy ( FILE* f, MPI_Datatype ty )
-{
- if (ty =3D=3D MPI_DATATYPE_NULL) fprintf(f,"DATATYPE_NULL");
- else if (ty =3D=3D MPI_BYTE) fprintf(f,"BYTE");
- else if (ty =3D=3D MPI_PACKED) fprintf(f,"PACKED");
- else if (ty =3D=3D MPI_CHAR) fprintf(f,"CHAR");
- else if (ty =3D=3D MPI_SHORT) fprintf(f,"SHORT");
- else if (ty =3D=3D MPI_INT) fprintf(f,"INT");
- else if (ty =3D=3D MPI_LONG) fprintf(f,"LONG");
- else if (ty =3D=3D MPI_FLOAT) fprintf(f,"FLOAT");
- else if (ty =3D=3D MPI_DOUBLE) fprintf(f,"DOUBLE");
- else if (ty =3D=3D MPI_LONG_DOUBLE) fprintf(f,"LONG_DOUBLE");
- else if (ty =3D=3D MPI_UNSIGNED_CHAR) fprintf(f,"UNSIGNED_CHAR");
- else if (ty =3D=3D MPI_UNSIGNED_SHORT) fprintf(f,"UNSIGNED_SHORT");
- else if (ty =3D=3D MPI_UNSIGNED_LONG) fprintf(f,"UNSIGNED_LONG");
- else if (ty =3D=3D MPI_UNSIGNED) fprintf(f,"UNSIGNED");
- else if (ty =3D=3D MPI_FLOAT_INT) fprintf(f,"FLOAT_INT");
- else if (ty =3D=3D MPI_DOUBLE_INT) fprintf(f,"DOUBLE_INT");
- else if (ty =3D=3D MPI_LONG_DOUBLE_INT) fprintf(f,"LONG_DOUBLE_INT");
- else if (ty =3D=3D MPI_LONG_INT) fprintf(f,"LONG_INT");
- else if (ty =3D=3D MPI_SHORT_INT) fprintf(f,"SHORT_INT");
- else if (ty =3D=3D MPI_2INT) fprintf(f,"2INT");
- else if (ty =3D=3D MPI_UB) fprintf(f,"UB");
- else if (ty =3D=3D MPI_LB) fprintf(f,"LB");
-#if defined(MPI_WCHAR)
- else if (ty =3D=3D MPI_WCHAR) fprintf(f,"WCHAR");
-#endif
- else if (ty =3D=3D MPI_LONG_LONG_INT) fprintf(f,"LONG_LONG_INT");
- else if (ty =3D=3D MPI_LONG_LONG) fprintf(f,"LONG_LONG");
- else if (ty =3D=3D MPI_UNSIGNED_LONG_LONG) fprintf(f,"UNSIGNED_LONG_L=
ONG");
- else fprintf(f,"showTy:???");
-}
-
/* How big is a "named" (base) type? Returns 0 if not known. Note.
There is a subtlety, which is that this is required to return the
exact size of one item of the type, NOT the size of it when padded
@@ -334,7 +360,6 @@
int* ints =3D NULL;
MPI_Aint* addrs =3D NULL;
MPI_Datatype* dtys =3D NULL;
- // MPI_Datatype elemTy;
=20
if (0)
printf("walk_type %p\n", (void*)ty);
|