Update of /cvsroot/boost/boost/boost/mpi
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21369/boost/mpi
Modified Files:
communicator.hpp
Log Message:
Support building communicators from groups and comparing communicators
Index: communicator.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/mpi/communicator.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- communicator.hpp 31 May 2007 15:36:47 -0000 1.3
+++ communicator.hpp 31 May 2007 16:02:06 -0000 1.4
@@ -87,6 +87,14 @@
enum comm_create_kind { comm_duplicate, comm_take_ownership, comm_attach };
/**
+ * INTERNAL ONLY
+ *
+ * Forward-declaration of @c group needed for the @c group
+ * constructor.
+ */
+class group;
+
+/**
* @brief A communicator that permits communication and
* synchronization among a set of processes.
*
@@ -136,6 +144,21 @@
communicator(const MPI_Comm& comm, comm_create_kind kind);
/**
+ * Build a new Boost.MPI communicator based on a subgroup of another
+ * MPI communicator.
+ *
+ * This routine will construct a new communicator containing all of
+ * the processes from communicator @c comm that are listed within
+ * the group @c subgroup. Equivalent to @c MPI_Comm_create.
+ *
+ * @param comm An MPI communicator.
+ *
+ * @param subgroup A subgroup of the MPI communicator, @p comm, for
+ * which we will construct a new communicator.
+ */
+ communicator(const communicator& comm, const group& subgroup);
+
+ /**
* @brief Determine the rank of the executing process in a
* communicator.
*
@@ -945,6 +968,28 @@
shared_ptr<MPI_Comm> comm_ptr;
};
+/**
+ * @brief Determines whether two communicators are identical.
+ *
+ * Equivalent to calling @c MPI_Comm_compare and checking whether the
+ * result is @c MPI_IDENT.
+ *
+ * @returns True when the two communicators refer to the same
+ * underlying MPI communicator.
+ */
+bool operator==(const communicator& comm1, const communicator& comm2);
+
+/**
+ * @brief Determines whether two communicators are different.
+ *
+ * @returns @c !(comm1 == comm2)
+ */
+inline bool operator!=(const communicator& comm1, const communicator& comm2)
+{
+ return !(comm1 == comm2);
+}
+
+
/************************************************************************
* Implementation details *
************************************************************************/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs