+ if (attrval != 1) {
+ errs++;
+ MPI_Type_get_name(type, typename, &tnlen);
+ printf("attrval is %d, should be 1, before dup in type %s\n", attrval, typename);
+ }
+ MPI_Type_dup(type, &duptype);
+ /* Check that the attribute was copied */
+ if (attrval != 2) {
+ errs++;
+ MPI_Type_get_name(type, typename, &tnlen);
+ printf("Attribute not incremented when type dup'ed (%s)\n", typename);
+ }
+ MPI_Type_free(&duptype);
+ if (attrval != 1) {
+ errs++;
+ MPI_Type_get_name(type, typename, &tnlen);
+ printf("Attribute not decremented when duptype %s freed\n", typename);
+ }
+ /* Check that the attribute was freed in the duptype */
+
+ if (!mstype.isBasic) {
+ MPI_Type_get_name(type, typename, &tnlen);