par_partition represents a partitioning of a distributed data set. More...
#include <par_partition.h>
Public Member Functions | |
par_partition (MPI_Comm comm=MPI_COMM_WORLD) | |
Construct a parallel partition for the communicator supplied Partition starts off with everyone in one cluster with medoid 0. | |
virtual | ~par_partition () |
Virtual destructor for inheritance. | |
void | get_sizes (std::vector< size_t > &sizes) |
Scalably get the sizes of all the clusters in this partition. | |
void | gather (partition &local, int root=0) |
Collective operation. | |
Public Attributes | |
std::vector< object_id > | medoid_ids |
Gives the object id for the ith medoid. This object may not be local. | |
std::vector< object_id > | cluster_ids |
Global cluster ids for local objects. | |
MPI_Comm | comm |
Communicator, the processes of which this partition divides. |
par_partition represents a partitioning of a distributed data set.
It is analogous to partition, but its object_ids are distributed across the ranks of the communicator it is instantiated with. Each process is assumed to "own" some set of objects in the data set this describes, and each process's par_partition object contains medoid_ids only for its own objects. Thus, the cluster_ids array will contain different object_ids on different processes within the "same" par_partition object.
While cluster_ids will vary, the "same" par_partition object on the same communicator will have the same medoid_ids. If this is not true, then the medoid_ids won't make any sense between processes. Partitioning algorithms that use a par_partition for output should preserve this property.
You can convert a par_partition to a partition on a single process using the gather() method. This is a collective operation. It is not scalable, in that it will aggregate ids from every process in the communicator to one process. However, it's useful for small systems and debugging.
Definition at line 70 of file par_partition.h.
par_partition | ( | MPI_Comm | comm = MPI_COMM_WORLD ) |
Construct a parallel partition for the communicator supplied Partition starts off with everyone in one cluster with medoid 0.
Definition at line 50 of file par_partition.cpp.
~par_partition | ( | ) | [virtual] |
Virtual destructor for inheritance.
Definition at line 52 of file par_partition.cpp.
void gather | ( | partition & | local, |
int | root = 0 |
||
) |
Collective operation.
Gathers my_id from all processes into a local partition object. If size of system is large, then this method will not scale.
Definition at line 55 of file par_partition.cpp.
void get_sizes | ( | std::vector< size_t > & | sizes ) |
Scalably get the sizes of all the clusters in this partition.
POST: sizes is valid on all processes
Definition at line 98 of file par_partition.cpp.
std::vector<object_id> cluster_ids |
Global cluster ids for local objects.
These are indices into medoid_ids. The object id of the medoid of the ith local object is medoid_ids[cluster_ids[i]].
Definition at line 76 of file par_partition.h.
MPI_Comm comm |
Communicator, the processes of which this partition divides.
Definition at line 79 of file par_partition.h.
std::vector<object_id> medoid_ids |
Gives the object id for the ith medoid. This object may not be local.
Definition at line 72 of file par_partition.h.