Function opensn::DistributeSurfaceAngularFluxes
Defined in File surface_response_data.h
Function Documentation
-
DistributedSurfaceData opensn::DistributeSurfaceAngularFluxes(const std::string &file_base, const std::vector<std::string> &surfaces, const mpi::Communicator &comm, std::uint64_t max_send_bytes = SURFACE_REDISTRIBUTION_BYTES)
Distribute the faces of a surface angular-flux file set written by
DiscreteOrdinatesProblemIO::WriteSurfaceAngularFluxesacross the ranks ofcomm.Each file is read with
DiscreteOrdinatesProblemIO::ReadSurfaceAngularFluxes, which does not check the data against a problem. The files<file_base>0.h5, …,<file_base>(N-1).h5are found from thenum_partitionsattribute of the first file. N need not equal the size ofcomm, and the data need not match the partitioning of any current mesh. File k is read by rank k modulo the size ofcomm, one file per rank at a time, and its faces are sent to their owner ranks (see SurfaceFaceOwner) in exchanges in which each rank sends at mostmax_send_bytespacked bytes (at least one face), before the next file is read. The peak memory of a rank is therefore one file’s requested surfaces, as returned by the reader, plus its owned faces and one exchange. A rank receives from every rank in an exchange, so its receive buffer is bounded by the number of ranks timesmax_send_bytes; faces spread evenly over owners, so it is typically aboutmax_send_bytes. Every file must contain every requested tag, possibly without faces. Any rank may read any file, so the files must be on a file system that every rank ofcommcan access;file_baseis used only by the calling rank.Collective over
comm. Throws, on all ranks,std::invalid_argumentfor invalid arguments, including names that resolve to the same tag twice, andstd::logic_errorfor missing, inconsistent, or malformed files, for a tag with no faces in any file, and for duplicate faces.- Parameters:
file_base – File name base.
surfaces – Surface names to read. Must be non-empty and unique. A boundary name reads that tag, and the name of an interior surface reads both of its tags,
<name>_uand<name>_d. A single side’s tag is rejected unless its other side is also requested, because surface responses need both sides. Names are resolved against file 0, and every other file is read with the resolved tags.comm – Communicator to distribute the faces over.
max_send_bytes – Per-rank send budget of one exchange.