Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake cli arg parse #895

Merged
merged 2 commits into from
Sep 21, 2024
Merged

cmake cli arg parse #895

merged 2 commits into from
Sep 21, 2024

Conversation

PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Sep 20, 2024

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted command construction in CMake to improve compatibility with "OMPI" MPI type.
  • Refactor

    • Modified the instantiation of the Run class to streamline its initialization process.
  • Tests

    • Updated test sequence for the Simulator to include a reset after execution, enhancing test reliability.

Copy link

coderabbitai bot commented Sep 20, 2024

Walkthrough

Walkthrough

The changes involve modifications to three files: tools/config/config.py, tools/python3/plotting.py, and tests/simulator/test_run.py. In config.py, the method of setting the PHARE_MPIRUN_POSTFIX variable for the "OMPI" MPI type is altered from using a space to using semicolons. In plotting.py, the instantiation of the Run class is updated by removing a boolean flag from its constructor. Lastly, in test_run.py, the sequence of operations in the test_run method is modified to include a call to the reset() method on the Simulator instance after its run() method.

Changes

Files Change Summary
tools/config/config.py Modified the write_local_cmake_file function to change the concatenation method for PHARE_MPIRUN_POSTFIX from a space to semicolons for "OMPI".
tools/python3/plotting.py Updated the plot_run_timer_data function to remove a boolean flag from the Run class constructor, affecting its instantiation.
tests/simulator/test_run.py Modified the test_run method to include a call to the reset() method on the Simulator instance after executing run(), with adjusted indentation for nested loops.

Possibly related PRs

  • rm cli arg parsing #846: The changes in def.cmake may relate to the construction of commands in CMake files, similar to the modifications made in the write_local_cmake_file function in the main PR.

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9cc9d7b and b675d4c.

Files selected for processing (1)
  • tests/simulator/test_run.py (1 hunks)
Additional comments not posted (2)
tests/simulator/test_run.py (2)

226-226: LGTM!

Resetting the simulator after running it is a good practice to ensure that any resources are properly cleaned up and the simulator state is reset for subsequent operations or tests. This helps avoid potential side effects or resource leaks.


230-235: Indentation adjustment improves readability.

The adjustment of the indentation for the nested loops checking plot file existence enhances the code readability and maintainability. The loops are now consistently indented under the condition that checks the MPI rank, making it clearer that the file existence checks are performed only on rank 0.

The logic of the loops remains unchanged, so the behavior of the code is unaffected.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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.

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 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.

@PhilipDeegan
Copy link
Member Author

PhilipDeegan commented Sep 20, 2024

verifying this outside of PR builds as they don't use the configurator yet, but should be able to after this

finished in 42 minutes

if cpp.mpi_rank() == 0:
plot(diag_dir)

for time in timestamps:
Copy link
Member Author

Choose a reason for hiding this comment

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

🐛

@PhilipDeegan PhilipDeegan merged commit 9a2b4d6 into PHAREHUB:master Sep 21, 2024
12 checks passed
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