Skip to content

Reply To: NSlattice.getLoadBalancer().size() is always 1 independent of blocks number

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics NSlattice.getLoadBalancer().size() is always 1 independent of blocks number Reply To: NSlattice.getLoadBalancer().size() is always 1 independent of blocks number

#7830
Adrian
Keymaster

Yes, this is exactly what is expected as one divides the problems into blocks. Each function instance (one per independent MPI process) only has access to its local data (by design, this is “the point of MPI”).

If you want to manually sum up and aggregate over the global simulation state in this way you will need to also call the MPI primitives (wrapped by OpenLB for convenience) on your own (e.g. MPI_Reduce).

The “OpenLB way” of implementing your function would be to wrap you per-cell criterion in a custom functor that returns either 0 or 1 depending on if the criteria is met. This functor can then be passed into one of the existing integral functors (e.g. we have BlockReduction3D2D for hyperplane reductions on top of which you would then call an integral functor with an appropriate norm in order to aggregate the values).