[mpich2-commits] r7790 - mpich2/trunk/src/mpi/coll
    goodell at mcs.anl.gov 
    goodell at mcs.anl.gov
       
    Thu Jan 20 16:09:15 CST 2011
    
    
  
Author: goodell
Date: 2011-01-20 16:09:14 -0600 (Thu, 20 Jan 2011)
New Revision: 7790
Modified:
   mpich2/trunk/src/mpi/coll/collutil.h
Log:
add MPIR_Op_is_commutative to collutil.h
No reviewer.
Modified: mpich2/trunk/src/mpi/coll/collutil.h
===================================================================
--- mpich2/trunk/src/mpi/coll/collutil.h	2011-01-20 22:09:12 UTC (rev 7789)
+++ mpich2/trunk/src/mpi/coll/collutil.h	2011-01-20 22:09:14 UTC (rev 7790)
@@ -25,4 +25,24 @@
         return 0;
 }
 
+/* TODO with a modest amount of work in the handle allocator code we should be
+ * able to encode commutativity in the handle value and greatly simplify this
+ * routine */
+/* returns TRUE iff the given op is commutative */
+static inline int MPIR_Op_is_commutative(MPI_Op op)
+{
+    MPID_Op *op_ptr;
+
+    if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
+        return TRUE;
+    }
+    else {
+        MPID_Op_get_ptr(op, op_ptr);
+        if (op_ptr->kind == MPID_OP_USER_NONCOMMUTE)
+            return FALSE;
+        else
+            return TRUE;
+    }
+}
+
 #endif /* !defined(COLLUTIL_H_INCLUDED) */
    
    
More information about the mpich2-commits
mailing list