added some new errors, removed some

This commit is contained in:
WickedJack99
2025-06-15 15:44:36 +02:00
parent ee36204207
commit 94ddd5cc75
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#include "patterns.h"
Pattern::Pattern(int rows, int cols, MPIGridSize mpiProcs)
: mpiProcs_(mpiProcs), grid_(SuperGrid::zeros(rows / np0(), cols / np1())) {
: mpiProcs_(mpiProcs), grid_(SuperGrid::zeros(rows / np0(), cols / np1(), nullptr)) {
if (rows <= 0 || cols <= 0) {
throw std::invalid_argument("Rows and columns must be positive");
}
@@ -19,7 +19,7 @@ Pattern::Pattern(int rows, int cols, MPIGridSize mpiProcs)
std::array<int, 2> periods = {1, 1};
MPI_Cart_create(MPI_COMM_WORLD, 2, mpiProcs.data(), periods.data(), true,
&comm_);
grid_.set_communicator(comm_);
grid_.set_communicator(&comm_);
}
int Pattern::np0() const { return mpiProcs_[0]; }

View File

@@ -2,6 +2,7 @@
#define SUPER_GRID_H
#include "matrix.h"
#include <mpi.h>
class SuperGrid {
public: