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

Encapsulation of the load balancing in DEM and CFD-DEM #1199

Merged
merged 13 commits into from
Jul 21, 2024

Conversation

acdaigneault
Copy link
Collaborator

@acdaigneault acdaigneault commented Jul 18, 2024

Description

The functions related to the load balancing were implemented in the DEM solver and coupling CFD-DEM solver even tho it is not really specific to the solvers.
The setup and the routine were duplicated in both solvers, making modifications or maintenances harder.
The solution is the implementation the load balancing class with mostly the same functions.
The load balancing is also fixed for the CFD-DEM. It was not working since nov. 2022, oops.

Testing

All tests related to the load balacing in DEM are still passing.
A new test spouted_bed_load_balancing_generator.prm was added for the unresolved cfd-dem tests.
After a quick fix on the master, results were compared and are the same.

Miscellaneous (will be removed when merged)

It is not fully encapsulated (the load_balance() functions are still implemented in the solvers), but it is the cleanest and easier way to do it to this day with the way the code flags some step (load_balancing, checkpoint, etc...) and executes reinititialization and other stuff.

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Lethe documentation is up to date
  • The branch is rebased onto master
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent
  • If parameters are modified, the tests and the documentation of examples are up to date
  • Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase

Pull request related list:

  • No other PR is open related to this refactoring
  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If any future works is planed, an issue is opened
  • The PR description is cleaned and ready for merge

@acdaigneault acdaigneault added Refactoring This PR is only refactoring or clean up Ready for review Needs more reviewers This pull request needs more review before a merge is possible labels Jul 18, 2024
@acdaigneault acdaigneault self-assigned this Jul 19, 2024
@acdaigneault acdaigneault requested a review from voferreira July 19, 2024 12:43
Comment on lines +376 to +456
/**
* @brief Pointer to the simulation control object.
*/
std::shared_ptr<SimulationControl> simulation_control;

/**
* @brief Pointer to the triangulation object.
*/
parallel::distributed::Triangulation<dim> *triangulation;

/**
* @brief Pointer to the particle handler object.
*/
Particles::ParticleHandler<dim> *particle_handler;

/**
* @brief Pointer to the adaptive sparse contacts object.
*/
AdaptiveSparseContacts<dim> *adaptive_sparse_contacts;
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reasons why you are keeping raw points for some stuff and shared_ptr for others?
I presume the one for which you are keeping raw points are not pointer in the DEM class, is that it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

I'll continue reviewing this as I have time today and over the weekend, but I really like what I have read thus far. This is a beautiful step in a beautiful direction

@acdaigneault acdaigneault force-pushed the dem_encapsulate-load-balancing branch 2 times, most recently from 6980bec to d6f5b2e Compare July 19, 2024 14:56
Copy link
Collaborator

@voferreira voferreira left a comment

Choose a reason for hiding this comment

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

Nice move! I have nothing to add. Great job!

source/dem/load_balancing.cc Show resolved Hide resolved
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

Awesome, will merge :)!

@acdaigneault
Copy link
Collaborator Author

Awesome, will merge :)!

I will look into the failling test this PM, probably the rayleigh ratio :)

@blaisb
Copy link
Contributor

blaisb commented Jul 21, 2024

Awesome, will merge :)!

I will look into the failling test this PM, probably the rayleigh ratio :)

Yes because the test failed after rebased
Absolutely the rayleigh ratio!

@acdaigneault acdaigneault force-pushed the dem_encapsulate-load-balancing branch from e61262c to a08b710 Compare July 21, 2024 19:11
@blaisb blaisb merged commit 2e3dfc0 into master Jul 21, 2024
8 checks passed
@blaisb blaisb deleted the dem_encapsulate-load-balancing branch July 21, 2024 23:37
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
…#1199)

Description
The functions related to the load balancing were implemented in the DEM solver and coupling CFD-DEM solver even tho it is not really specific to the solvers.
The setup and the routine were duplicated in both solvers, making modifications or maintenances harder.
The solution is the implementation the load balancing class with mostly the same functions.
The load balancing is also fixed for the CFD-DEM. It was not working since nov. 2022, oops.

Testing
All tests related to the load balacing in DEM are still passing.
A new test spouted_bed_load_balancing_generator.prm was added for the unresolved cfd-dem tests.
After a quick fix on the master, results were compared and are the same.

Former-commit-id: 2e3dfc0
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description
The functions related to the load balancing were implemented in the DEM solver and coupling CFD-DEM solver even tho it is not really specific to the solvers.
The setup and the routine were duplicated in both solvers, making modifications or maintenances harder.
The solution is the implementation the load balancing class with mostly the same functions.
The load balancing is also fixed for the CFD-DEM. It was not working since nov. 2022, oops.

Testing
All tests related to the load balacing in DEM are still passing.
A new test spouted_bed_load_balancing_generator.prm was added for the unresolved cfd-dem tests.
After a quick fix on the master, results were compared and are the same.

Former-commit-id: 2e3dfc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs more reviewers This pull request needs more review before a merge is possible Refactoring This PR is only refactoring or clean up Reviewed and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants