50 par_partition::par_partition(MPI_Comm _comm) : comm(_comm) { }
64 cerr <<
"Error: incorrect number of medoids on " << rank <<
": " <<
medoid_ids.size()
65 <<
", expected " << count << endl;
72 cerr <<
"Error: incorrect number of objects on " << rank <<
": " <<
cluster_ids.size()
73 <<
", expected " << object_count << endl;
77 std::vector<object_id> bcast_medoid_ids =
medoid_ids;
81 cerr <<
"Error: medoids do not match on " << rank << endl;
99 vector<size_t> local_sizes(
medoid_ids.size(), 0);
std::vector< object_id > medoid_ids
Gives the index of the object that is the ith medoid.
Class to represent a partitioning of a data set.
MPI_Comm comm
Communicator, the processes of which this partition divides.
void get_sizes(std::vector< size_t > &sizes)
Scalably get the sizes of all the clusters in this partition.
std::ostream & operator<<(std::ostream &out, const id_pair< T > &p)
Print out an id_pair as a tuple of its element and its source rank.
par_partition represents a partitioning of a distributed data set.
Overloaded utility functions to convert between arbitrary C/C++ types and MPI types, custom typedefs for cstdlib types like size_t, and a wrapper for MPI_Pack_Size.
Distributed representation of a partitioning of a data set.
std::vector< object_id > cluster_ids
Global cluster ids for local objects.
std::vector< object_id > medoid_ids
Gives the object id for the ith medoid. This object may not be local.
virtual ~par_partition()
Virtual destructor for inheritance.
std::vector< medoid_id > cluster_ids
Gives cluster id (index in medoids) for the ith object.
#defines for switching between MPI and PMPI bindings.
void gather(partition &local, int root=0)
Collective operation.
This represents a partitioning of a data set.