mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Fix MPI-related bugs
This commit is contained in:
parent
50dcae1772
commit
6174461daa
2 changed files with 5 additions and 7 deletions
|
|
@ -92,8 +92,8 @@ void ufs_count_sites()
|
|||
|
||||
#ifdef OPENMC_MPI
|
||||
// Send source fraction to all processors
|
||||
int n = xt::prod(m->shape_)();
|
||||
MPI_Bcast(source_frac.data(), n, MPI_DOUBLE, 0, mpi::intracomm)
|
||||
int n_bins = xt::prod(m->shape_)();
|
||||
MPI_Bcast(source_frac.data(), n_bins, MPI_DOUBLE, 0, mpi::intracomm);
|
||||
#endif
|
||||
|
||||
// Normalize to total weight to get fraction of source in each cell
|
||||
|
|
|
|||
|
|
@ -702,13 +702,11 @@ xt::xarray<double> RegularMesh::count_sites(int64_t n, const Bank* bank,
|
|||
// collect values from all processors
|
||||
MPI_Reduce(cnt.data(), cnt_reduced, total, MPI_DOUBLE, MPI_SUM, 0,
|
||||
mpi::intracomm);
|
||||
if (outside) {
|
||||
MPI_Reduce(&outside_, outside, 1, MPI_BOOL, MPI_LOR, 0, mpi::intracomm);
|
||||
}
|
||||
|
||||
// Check if there were sites outside the mesh for any processor
|
||||
MPI_REDUCE(outside, sites_outside, 1, MPI_LOGICAL, MPI_LOR, 0, &
|
||||
mpi_intracomm, mpi_err)
|
||||
if (outside) {
|
||||
MPI_Reduce(&outside_, outside, 1, MPI_C_BOOL, MPI_LOR, 0, mpi::intracomm);
|
||||
}
|
||||
#else
|
||||
std::copy(cnt.data(), cnt.data() + total, cnt_reduced);
|
||||
if (outside) *outside = outside_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue