We realized that most eko operations do not depend on multiple Q2 at the same time.
The full OperatorGrid is a rank-5 tensor, by using only one Q2 at a time we reduce the problem to a rank-4 tensor, with much less memory consumption.
In order to get a usable and flexible structure, a few capabilities are needed for the new structure:
This new structure will be the upgraded version of the current Output object.
Moreover, a few more things might be implemented as related, and later used to support separate computation of Q2 elements:
The idea is that, an object supporting these features, can be computed separately, in a completely independent way (1 process for thresholds, plus one for each Q2, for example), and then merged together.
In order to make it easier to merge and compute the final one:
- the
thresholds.npz is never removed from the saved output
- everything can be merged together, with or without thresholds, but it's simply checking the input compatibility, and adding the arrays to the archive
- if it contains both thresholds and partial objects, compute final ones
We realized that most
ekooperations do not depend on multipleQ2at the same time.The full
OperatorGridis a rank-5 tensor, by using only oneQ2at a time we reduce the problem to a rank-4 tensor, with much less memory consumption.In order to get a usable and flexible structure, a few capabilities are needed for the new structure:
Q2storage: it will be{q2}.npyQ2at a time, and drop them once consumedThis new structure will be the upgraded version of the current
Outputobject.Moreover, a few more things might be implemented as related, and later used to support separate computation of
Q2elements:OperatorGridOperatorGridto hold the reference to a newOutputobject, and store everything in thereQ2results (those obtained before combining with threshold operators), together with full resultsQ2inOutputthresholds.npz(containing all the threshold elements) and{q2}.part.npyThe idea is that, an object supporting these features, can be computed separately, in a completely independent way (1 process for thresholds, plus one for each
Q2, for example), and then merged together.In order to make it easier to merge and compute the final one:
thresholds.npzis never removed from the saved output{q2}.part.npycome later, they can always be consumedoptimize()orclean()method, to get rid of itcombine()method