Skip to content

Commit

Permalink
Fix a few checks that came up during rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaddy committed Sep 14, 2023
1 parent 921c937 commit 626817b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/grid/grid3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void Grid3D::Initialize(struct parameters *P)
#endif

#ifdef COSMOLOGY
H.OUTPUT_SCALE_FACOR = not P->scale_outputs_file[0] == '\0';
H.OUTPUT_SCALE_FACOR = not(P->scale_outputs_file[0] == '\0');
#endif

H.Output_Initial = true;
Expand Down
2 changes: 1 addition & 1 deletion src/mhd/ct_electric_fields_tests.cu
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ TEST(tMHDCTSlope, CorrectInputExpectCorrectOutput)
ASSERT_EQ(test_data.size(), fiducial_data.size());

for (size_t i = 0; i < test_data.size(); i++) {
testingUtilities::checkResults(fiducial_data.at(i), test_data.at(i), "");
testing_utilities::checkResults(fiducial_data.at(i), test_data.at(i), "");
}
}
// =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/model/disk_ICs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ void Grid3D::Disk_3D(parameters p)
Real r_cool;

// MW model
DiskGalaxy galaxy = Galaxies::MW;
DiskGalaxy galaxy = Galaxies::MW; // NOLINT(cppcoreguidelines-slicing)
// M82 model Galaxies::M82;

M_vir = galaxy.getM_vir(); // viral mass in M_sun
Expand Down
8 changes: 5 additions & 3 deletions src/mpi/mpi_routines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,23 +542,25 @@ void DomainDecompositionBLOCK(struct parameters *P, struct Header *H, int nx_gin

void Allocate_MPI_DeviceBuffers(struct Header *H)
{
int xbsize = 0, ybsize = 0, zbsize = 0;
int xbsize, ybsize, zbsize;
if (H->ny == 1 && H->nz == 1) {
xbsize = H->n_fields * H->n_ghost;
ybsize = 1;
zbsize = 1;
}
// 2D
if (H->ny > 1 && H->nz == 1) {
else if (H->ny > 1 && H->nz == 1) {
xbsize = H->n_fields * H->n_ghost * (H->ny - 2 * H->n_ghost);
ybsize = H->n_fields * H->n_ghost * (H->nx);
zbsize = 1;
}
// 3D
if (H->ny > 1 && H->nz > 1) {
else if (H->ny > 1 && H->nz > 1) {
xbsize = H->n_fields * H->n_ghost * (H->ny - 2 * H->n_ghost) * (H->nz - 2 * H->n_ghost);
ybsize = H->n_fields * H->n_ghost * (H->nx) * (H->nz - 2 * H->n_ghost);
zbsize = H->n_fields * H->n_ghost * (H->nx) * (H->ny);
} else {
throw std::runtime_error("MPI buffer size failed to set.");
}

x_buffer_length = xbsize;
Expand Down

0 comments on commit 626817b

Please sign in to comment.