Skip to content

WIP patchghostless#1000

Closed
PhilipDeegan wants to merge 6 commits intoPHAREHUB:masterfrom
PhilipDeegan:ghosting
Closed

WIP patchghostless#1000
PhilipDeegan wants to merge 6 commits intoPHAREHUB:masterfrom
PhilipDeegan:ghosting

Conversation

@PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Apr 22, 2025

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

@PHAREHUB PHAREHUB deleted a comment from coderabbitai bot Apr 22, 2025
@PhilipDeegan
Copy link
Member Author

closes #996 and closes #997

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@PhilipDeegan
Copy link
Member Author

nightly build artifacts for this

@PHAREHUB PHAREHUB deleted a comment from coderabbitai bot Apr 30, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 5, 2025

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (1)
  • WIP

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@nicolasaunai nicolasaunai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 == len("ions_pop_") ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

for (auto const& box : fieldOverlap.getDestinationBoxContainer())
{
core::FieldBox<Grid_t>{dst, gridLayout, phare_box_from<dimension>(box)}
.template op<Operator>(buffer, seek);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not very obvious what this operator does

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

@PhilipDeegan PhilipDeegan May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional is not needed anymore I do believe


registerRefine(ghost, model, oldModel, variableFillPattern);

register_interpolated_resource(rm, ghost, ghost, oldModel, model, refineOp, timeOp,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

register _time_interpolated_resource ? (to be consistent with the other function)




auto& register_resource(auto& rm, auto& dst, auto& src, auto& scratch, auto&&... args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the variadic ? it seems to always be called with refineOp and fillPat

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fillPat is optional, but would could make it mandatory even as a nullptr

}


auto& register_vector_field(auto&&... args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be const?

@PhilipDeegan PhilipDeegan mentioned this pull request Jun 10, 2025
@PhilipDeegan PhilipDeegan deleted the ghosting branch July 27, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants