Skip to content

Commit

Permalink
updated poisson 3d experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamyaniv committed Mar 11, 2024
1 parent 82906b3 commit c6f38c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/dense/testFrontMPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ MPI_Init(&argc, &argv);

{
strumpack::MPIComm c;
strumpack::BLACSGrid grid(c);
strumpack::DenseMatrix<double> Aseq;
strumpack::DistributedMatrix<double> A;
int m = 0;

if (!strumpack::mpi_rank()) {
std::string filename;
Expand All @@ -26,10 +28,12 @@ MPI_Init(&argc, &argv);
std::ifstream file(filename, std::ifstream::binary);
file.read(reinterpret_cast<char*>(&m), sizeof(int));
Aseq = strumpack::DenseMatrix<double>(m, m);
file.read(reinterpret_cast<char*>(Aseq.data()), sizeof(double)*m*m);
file.read(reinterpret_cast<char*>(Aseq.data()), sizeof(double)*m*m);
std::cout << "# Matrix dimension read from file: " << m << std::endl;
}

MPI_Bcast(&m, 1, strumpack::mpi_type<int>(), 0, MPI_COMM_WORLD);

A = strumpack::DistributedMatrix<double>(&grid, m, m);
A.scatter(Aseq);

Expand Down

0 comments on commit c6f38c5

Please sign in to comment.