unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values[2] = { 1, 2 };
+ unsigned int values[2] = { 1+myid, numprocs+myid };
unsigned int maxima[2];
Utilities::MPI::max (values,
MPI_COMM_WORLD,
maxima);
- Assert (maxima[0] == 1, ExcInternalError());
- Assert (maxima[1] == 2, ExcInternalError());
+ Assert (maxima[0] == numprocs, ExcInternalError());
+ Assert (maxima[1] == 2*numprocs-1, ExcInternalError());
if (myid==0)
deallog << maxima[0] << ' ' << maxima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::10 19
-DEAL:mpi::1 2
+DEAL:mpi::4 7
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int maxima[2] = { 1, 2 };
+ unsigned int maxima[2] = { 1+myid, numprocs+myid };
Utilities::MPI::max (maxima,
MPI_COMM_WORLD,
maxima);
- Assert (maxima[0] == 1, ExcInternalError());
- Assert (maxima[1] == 2, ExcInternalError());
+ Assert (maxima[0] == numprocs, ExcInternalError());
+ Assert (maxima[1] == 2*numprocs-1, ExcInternalError());
if (myid==0)
deallog << maxima[0] << ' ' << maxima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::10 19
-DEAL:mpi::1 2
+DEAL:mpi::4 7
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values_[2] = { 1, 2 };
+ unsigned int values_[2] = { 1+myid, numprocs+myid };
std::vector<unsigned int> values(&values_[0], &values_[2]);
std::vector<unsigned int> maxima(2);
Utilities::MPI::max (values,
MPI_COMM_WORLD,
maxima);
- Assert (maxima[0] == 1, ExcInternalError());
- Assert (maxima[1] == 2, ExcInternalError());
+ Assert (maxima[0] == numprocs, ExcInternalError());
+ Assert (maxima[1] == 2*numprocs-1, ExcInternalError());
if (myid==0)
deallog << maxima[0] << ' ' << maxima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::10 19
-DEAL:mpi::1 2
+DEAL:mpi::4 7
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values_[2] = { 1, 2 };
+ unsigned int values_[2] = { myid, numprocs+myid };
std::vector<unsigned int> maxima(&values_[0], &values_[2]);
Utilities::MPI::max (maxima,
MPI_COMM_WORLD,
maxima);
- Assert (maxima[0] == 1, ExcInternalError());
- Assert (maxima[1] == 2, ExcInternalError());
+ Assert (maxima[0] == numprocs-1, ExcInternalError());
+ Assert (maxima[1] == 2*numprocs-1, ExcInternalError());
if (myid==0)
deallog << maxima[0] << ' ' << maxima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::0 1
-DEAL:mpi::1 2
+DEAL:mpi::9 19
-DEAL:mpi::1 2
+DEAL:mpi::3 7
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values[2] = { 1, 2 };
+ unsigned int values[2] = { 1+myid, numprocs+myid };
unsigned int minima[2];
Utilities::MPI::min (values,
MPI_COMM_WORLD,
minima);
Assert (minima[0] == 1, ExcInternalError());
- Assert (minima[1] == 2, ExcInternalError());
+ Assert (minima[1] == numprocs, ExcInternalError());
if (myid==0)
deallog << minima[0] << ' ' << minima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::1 10
-DEAL:mpi::1 2
+DEAL:mpi::1 4
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int minima[2] = { 1, 2 };
+ unsigned int minima[2] = { 1+myid, numprocs+myid };
Utilities::MPI::min (minima,
MPI_COMM_WORLD,
minima);
Assert (minima[0] == 1, ExcInternalError());
- Assert (minima[1] == 2, ExcInternalError());
+ Assert (minima[1] == numprocs, ExcInternalError());
if (myid==0)
deallog << minima[0] << ' ' << minima[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::1 10
-DEAL:mpi::1 2
+DEAL:mpi::1 4
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values_[2] = { 1, 2 };
+ unsigned int values_[2] = { 1+myid, numprocs+myid };
std::vector<unsigned int> values(&values_[0], &values_[2]);
std::vector<unsigned int> output(2);
Utilities::MPI::min (values,
MPI_COMM_WORLD,
output);
Assert (output[0] == 1, ExcInternalError());
- Assert (output[1] == 2, ExcInternalError());
+ Assert (output[1] == numprocs, ExcInternalError());
if (myid==0)
deallog << output[0] << ' ' << output[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::1 1
-DEAL:mpi::1 2
+DEAL:mpi::1 10
-DEAL:mpi::1 2
+DEAL:mpi::1 4
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
- unsigned int values_[2] = { 1, 2 };
+ unsigned int values_[2] = { myid, numprocs+myid };
std::vector<unsigned int> inout(&values_[0], &values_[2]);
Utilities::MPI::min (inout,
MPI_COMM_WORLD,
inout);
- Assert (inout[0] == 1, ExcInternalError());
- Assert (inout[1] == 2, ExcInternalError());
+ Assert (inout[0] == 0, ExcInternalError());
+ Assert (inout[1] == numprocs, ExcInternalError());
if (myid==0)
deallog << inout[0] << ' ' << inout[1] << std::endl;
-DEAL:mpi::1 2
+DEAL:mpi::0 1
-DEAL:mpi::1 2
+DEAL:mpi::0 10
-DEAL:mpi::1 2
+DEAL:mpi::0 4