![]() |
|
#include "generic.h"Functions | |
| template<typename myType > | |
| void | construct_vector (myType given_array[], unsigned given_arraysize, Vector< myType > &result_vector) |
| template<typename myType > | |
| void | output_vector (Vector< myType > &given_vector) |
| void | create_vector_ascend_row (unsigned const nrow, const OomphCommunicator *const comm_pt, bool const distributed, DoubleVector &my_vec) |
| void | fill_in_sub_vectors (const OomphCommunicator *const comm_pt, const bool distributed, Vector< unsigned > &dimvector, Vector< DoubleVector > &my_vecs) |
| void | create_vectors_to_cat (const unsigned nvectors, unsigned dimarray[], const OomphCommunicator *const comm_pt, Vector< DoubleVector > &my_vecs) |
| void | create_vectors_to_split (unsigned nrowarray[], const OomphCommunicator *const comm_pt, const bool distributed, Vector< DoubleVector > &out_vector) |
| int | main (int argc, char *argv[]) |
| void construct_vector | ( | myType | given_array[], |
| unsigned | given_arraysize, | ||
| Vector< myType > & | result_vector | ||
| ) |
| void create_vector_ascend_row | ( | unsigned const | nrow, |
| const OomphCommunicator *const | comm_pt, | ||
| bool const | distributed, | ||
| DoubleVector & | my_vec | ||
| ) |
References oomph::DoubleVector::build(), oomph::DoubleVector::clear(), oomph::LinearAlgebraDistribution::first_row(), and oomph::LinearAlgebraDistribution::nrow_local().
Referenced by fill_in_sub_vectors().
| void create_vectors_to_cat | ( | const unsigned | nvectors, |
| unsigned | dimarray[], | ||
| const OomphCommunicator *const | comm_pt, | ||
| Vector< DoubleVector > & | my_vecs | ||
| ) |
References construct_vector(), and fill_in_sub_vectors().
| void create_vectors_to_split | ( | unsigned | nrowarray[], |
| const OomphCommunicator *const | comm_pt, | ||
| const bool | distributed, | ||
| Vector< DoubleVector > & | out_vector | ||
| ) |
Referenced by main().
| void fill_in_sub_vectors | ( | const OomphCommunicator *const | comm_pt, |
| const bool | distributed, | ||
| Vector< unsigned > & | dimvector, | ||
| Vector< DoubleVector > & | my_vecs | ||
| ) |
References create_vector_ascend_row().
Referenced by create_vectors_to_cat().
Driver code: Testing DoubleVectorHelpers::split_without_communication(...) This is the reverse of DoubleVectorHelpers::concatenate_without_communication(...), demonstrated in self_test/mpi/vector_concatenation_without_communication/
There is a "strong" relationship between the distributions of the in_vector and the out vectors: The distribution of the in_vector must be the same as the concatenation of the out vectors as defined by LinearAlgebraDistributionHelpers::concatenate(...).
To see why, we demonstrate this on two cores, p0 and p1, and out vectors v1, v2 and v3 with lengths 7, 5 and 3 respectively. As seen in the driver code distribution_concatenation, we have:
v1: nrow = 7 nrow_local p0 = 3 nrow_local p1 = 4
v2: nrow = 5 nrow_local p0 = 2 nrow_local p1 = 3
v3: nrow = 3 nrow_local p0 = 1 nrow_local p1 = 2
If no communication takes place, i.e. all data on p0 stays on p0 (and similarly for p1), the in vector MUST have the following distribution: in_vec: nrow = 15 nrow_local p0 = 3+2+1 = 6 nrow_local p1 = 4+3+2 = 9
In this driver test, we split a vector of length 15 into vectors of length 7, 5 and 3, ensuring that the above relationship is maintained. The script validate.sh should run this program on 1, 2, 3 and 4 cores.
References oomph::MPI_Helpers::communicator_pt(), oomph::LinearAlgebraDistributionHelpers::concatenate(), create_vectors_to_split(), oomph::MPI_Helpers::finalize(), oomph::DistributableLinearAlgebraObject::first_row(), oomph::MPI_Helpers::init(), oomph::OomphCommunicator::my_rank(), oomph::OomphCommunicator::nproc(), oomph::DistributableLinearAlgebraObject::nrow_local(), oomph::DoubleVectorHelpers::split_without_communication(), and oomph::DoubleVector::values_pt().
| void output_vector | ( | Vector< myType > & | given_vector | ) |
References oomph::oomph_info.