Skip to content

Commit

Permalink
Use standard int for modelcell[].thick to avoid potential incompatibi…
Browse files Browse the repository at this point in the history
…lities with MPI_SHORT
  • Loading branch information
lukeshingles committed Oct 26, 2024
1 parent 8d584d0 commit 980df3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct ModelGridCell {
std::span<double> nlte_pops; // Pointer to an array that contains the nlte-level populations for this cell
double totalcooling = -1;
double *ion_cooling_contribs{};
uint_fast8_t thick = 0;
int thick = 0;
};

consteval auto get_ngriddimensions() -> int {
Expand Down
2 changes: 1 addition & 1 deletion sn3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void mpi_communicate_grid_properties(const int my_rank, const int nprocs, const
MPI_COMM_WORLD);
MPI_Pack(&grid::modelgrid[mgi].totalcooling, 1, MPI_DOUBLE, mpi_grid_buffer, mpi_grid_buffer_size, &position,
MPI_COMM_WORLD);
MPI_Pack(&grid::modelgrid[mgi].thick, 1, MPI_SHORT, mpi_grid_buffer, mpi_grid_buffer_size, &position,
MPI_Pack(&grid::modelgrid[mgi].thick, 1, MPI_INT, mpi_grid_buffer, mpi_grid_buffer_size, &position,
MPI_COMM_WORLD);

MPI_Pack(grid::modelgrid[mgi].elem_massfracs, get_nelements(), MPI_FLOAT, mpi_grid_buffer,
Expand Down
2 changes: 1 addition & 1 deletion update_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ void update_grid_cell(const int mgi, const int nts, const int nts_prev, const in
}

printout("lte_iteration %d\n", globals::lte_iteration ? 1 : 0);
printout("mgi %d modelgrid.thick: %d (during grid update)\n", mgi, static_cast<int>(grid::modelgrid[mgi].thick));
printout("mgi %d modelgrid.thick: %d (during grid update)\n", mgi, grid::modelgrid[mgi].thick);

for (int element = 0; element < get_nelements(); element++) {
calculate_cellpartfuncts(mgi, element);
Expand Down

0 comments on commit 980df3e

Please sign in to comment.