Conversation
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
nicolasaunai
left a comment
There was a problem hiding this comment.
unfinished review but already some comments to discuss irl
| basename = os.path.basename(file).split(".")[0] | ||
| if basename.startswith("ions_pop_"): | ||
| if any([basename.endswith(k) for k in ["density", "flux", "domain"]]): | ||
| pops.add(basename[9:].split("_")[0]) |
| for (auto const& box : fieldOverlap.getDestinationBoxContainer()) | ||
| { | ||
| core::FieldBox<Grid_t>{dst, gridLayout, phare_box_from<dimension>(box)} | ||
| .template op<Operator>(buffer, seek); |
There was a problem hiding this comment.
not very obvious what this operator does
There was a problem hiding this comment.
an alternative that I have on the tileset branch could be more obvious
core::FieldBox<Grid_t const> const src{field, gridLayout, phare_box_from<dimension>(packBox)};
src.append_to(buffer);| } | ||
|
|
||
|
|
||
| core::FieldBox<Grid_t>{ |
There was a problem hiding this comment.
I guess this is where all the actual copies are made, which previously was a lot of code and loops here.
However when only reading this here, I find it not easy to understand what is actually done.
Could you try improving the readability of these lines? Maybe it could be easier if the FieldBox class 'op' functions were renamed and here using intermediary variables
There was a problem hiding this comment.
what I have on my tileset branch could be simpler
FieldBox<...> dst{...};
FieldBox<...> src{...};
operate_on_fields<Operator>(dst, src);
|
|
||
|
|
||
| template<typename Operator, typename Field_t0> | ||
| void op(FieldBox<Field_t0> const& that); |
There was a problem hiding this comment.
we should try to find a better name I don't understand these functions easily.
|
|
||
| public: | ||
| FieldFillPattern(std::optional<bool> overwrite_interior) | ||
| FieldFillPattern(std::optional<bool> overwrite_interior = false) |
There was a problem hiding this comment.
I may be wrong but looking at the hybhyb I don't see that we still use this node_only bool from the refinement operator. Do we still need it? You have moved the declaration of the VariableFillPattern to the hybhyb so maybe there is no need anymore to go through which operator is used and this node_only bool, and directly use a bool passed to the fillPattern Ctor (and not an optional?)?
There was a problem hiding this comment.
optional is not needed anymore I do believe
|
|
||
| registerRefine(ghost, model, oldModel, variableFillPattern); | ||
|
|
||
| register_interpolated_resource(rm, ghost, ghost, oldModel, model, refineOp, timeOp, |
There was a problem hiding this comment.
register _time_interpolated_resource ? (to be consistent with the other function)
|
|
||
|
|
||
|
|
||
| auto& register_resource(auto& rm, auto& dst, auto& src, auto& scratch, auto&&... args) |
There was a problem hiding this comment.
do we need the variadic ? it seems to always be called with refineOp and fillPat
There was a problem hiding this comment.
I think the fillPat is optional, but would could make it mandatory even as a nullptr
| } | ||
|
|
||
|
|
||
| auto& register_vector_field(auto&&... args) |
There was a problem hiding this comment.
if it's either 4 or 5 it probably means that it's always 4 + 1 that would be an optional fillpattern ? could it be simpler to read to have explicit arguments for the 4 first and a nullptr fillpattern default or something like that?
I get that auto&&.. args gets everything but it's also not easy to understand what the arguments should be?
There was a problem hiding this comment.
part of me thinks this file could be merged with refiner_pool, so apart from the capacity to have a variable fill pattern from messengers I'll revert this
| } | ||
|
|
||
| template<typename GridLayoutT> | ||
| NO_DISCARD auto makeNonLevelGhostBoxFor(SAMRAI::hier::Patch const& patch, |
There was a problem hiding this comment.
I don't understand what this is for, I see there is make_boxes, setup_level, and the boxing variable which is not clear what they do.
Given their use in updater I guess this is a kind of replacement for the selectors but it is not clear to me to what extent this is needed for the patchghost removal or some refactoring
There was a problem hiding this comment.
in order to export particles that leave to through the patch ghost layer, we need to know are the patch ghost layer, or which are not the level ghost layer
| } | ||
|
|
||
|
|
||
| auto getIDsList(auto&&... keys) |
no more patchghost particles
accumulate pop flux/rho on patch boundaries instead
send particles that leave patch domain to neighbour patch if overlap exists
skipping rabbit for now cause it's noisey