[mpich2-commits] r7773 - mpich2/trunk/src/mpid/common/datatype

goodell at mcs.anl.gov goodell at mcs.anl.gov
Thu Jan 20 16:08:23 CST 2011


Author: goodell
Date: 2011-01-20 16:08:23 -0600 (Thu, 20 Jan 2011)
New Revision: 7773

Modified:
   mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h
Log:
add MPID_Datatype_is_contig convenience macro

Reviewed by balaji at .

Modified: mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h
===================================================================
--- mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h	2011-01-20 22:08:21 UTC (rev 7772)
+++ mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h	2011-01-20 22:08:23 UTC (rev 7773)
@@ -536,6 +536,20 @@
     }									\
 } while(0)
 
+/* helper macro: takes an MPI_Datatype handle value and returns TRUE in
+ * (*is_config_) if the type is contiguous */
+#define MPID_Datatype_is_contig(dtype_, is_contig_)                            \
+    do {                                                                       \
+        if (HANDLE_GET_KIND(dtype_) == HANDLE_KIND_BUILTIN) {                  \
+            *(is_contig_) = TRUE;                                              \
+        }                                                                      \
+        else {                                                                 \
+            MPID_Datatype *dtp_ = NULL;                                        \
+            MPID_Datatype_get_ptr((dtype_), dtp_);                             \
+            *(is_contig_) = dtp_->is_contig;                                   \
+        }                                                                      \
+    } while (0)
+
 /* Datatype functions */
 int MPID_Type_commit(MPI_Datatype *type);
 



More information about the mpich2-commits mailing list