27namespace shamrock::solvergraph {
31 auto edges = get_edges();
33 edges.spans_in.check_sizes(edges.sizes.indexes);
35 auto dev_sched = shamsys::instance::get_compute_scheduler_ptr();
40 edges.spans_in.get_refs().for_each_ordered(
43 u32 val_cnt = edges.sizes.indexes.get(id_patch) * nvar;
54 "field too small on patch {}: expected at least {} values, got {}",
67 edges.out_scal.data = shamalgs::collective::allreduce_sum(loc_val);
72 std::string tex = R
"tex(
75 {out_scal} = \sum_{i} {spans_in}_i
79 replace_edges_tex_symbols(tex);
Header file describing a Node Instance.
Node computing the global sum of a field over all patches and ranks.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
u32 get_val_cnt() const
Get the number of values stored in the field.
Compute the sum of spans_in over the first sizes * nvar values of every patch on every rank.
virtual std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node
This header file contains utility functions related to exception handling in the code.
T sum(const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< T > &buf1, u32 start_id, u32 end_id)
Compute the sum of elements in a device buffer within a specified range.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.