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

Reflecting boundaries #339

Merged
merged 97 commits into from
Oct 29, 2024
Merged

Conversation

amartyads
Copy link
Contributor

@amartyads amartyads commented Sep 10, 2024

Description

Added "native" support for reflecting and outflow boundaries in ls1.

The actual communication code was left untouched, and the boundary effects were manages with these two steps:

  • Manually deleting halo particles after they're populated after balanceAndExchange
  • Using a region iterator over the regions one cutoff away from global walls, and reflecting/deleting molecules as required.

The communication code was not changed, because I did not want to mess up the inter-subdomain communication for internal molecules.

How Has This Been Tested?

Since this adds more checks for default (periodic) behaviour, I ran a test on the AMD minicluster to make sure that default behaviour is not slower.

configForBoundary.txt

jobForBoundary.txt

50000 steps, 485150 particles

I ran each run 5 times, took time values from the output files, averaged them, and here are the results (in seconds):

Container Run Type Wall time Boundary Effects Time Force Computation Time Total Computation Time Communication Time
AP master 746.116 0.000000 548.0748 582.2928 132.6998
periodic 744.350 0.090808 544.4254 578.4000 134.4734
reflecting 737.930 15.541120 542.4348 586.7612 124.2872
LC master 1413.200 0.000000 735.0464 885.0394 282.4636
periodic 1404.534 0.149090 737.6524 880.9132 276.3130
reflecting 1486.748 147.659200 713.3886 887.7828 267.289

So compared to master, running periodic boundaries on this branch seems to have negligible overhead, hence performance should not be massively affected overall.

Otherwise, this has been more or less extensively tested, both with and without MaMiCo, so everything should be fine.

@amartyads
Copy link
Contributor Author

@HomesGH Do you want to take a look at the comments Fabio left in the files that were part of #336 ?

@HomesGH
Copy link
Contributor

HomesGH commented Sep 20, 2024

@HomesGH Do you want to take a look at the comments Fabio left in the files that were part of #336 ?

I went through the comments in the files Domain.* and ResultWriter.* and resolved them.
However, I have no idea about the following section

double _universalProfiledComponentMass;  // set from outside
double _universalLambda;  // set from outside
float _globalDecisiveDensity;  // set from outside

@amartyads
Copy link
Contributor Author

@HomesGH Do you want to take a look at the comments Fabio left in the files that were part of #336 ?

I went through the comments in the files Domain.* and ResultWriter.* and resolved them. However, I have no idea about the following section

double _universalProfiledComponentMass;  // set from outside
double _universalLambda;  // set from outside
float _globalDecisiveDensity;  // set from outside

I have no idea either, unfortunately

Checking git history, seems like those lines have existed unchanged since 2012 (commit 9b1e251)

@amartyads
Copy link
Contributor Author

After all these changes I redid the performance test, and the results don't seem impacted at all (I didn't rerun master):

Container Run Type Wall time Boundary Effects Time Force Computation Time Total Computation Time Communication Time
AP master 746.116 0.000000 548.0748 582.2928 132.6998
periodic 740.762 0.164010 543.6474 578.2006 131.9316
reflecting 739.328 0.106152 541.3684 576.2200 132.5192
LC master 1413.200 0.000000 735.0464 885.0394 282.4636
periodic 1403.222 0.292358 722.1366 866.5802 282.3060
reflecting 1404.236 0.178882 731.8196 874.3370 280.8740

LC (base ls1) seems less consistent somehow, maybe last time's runs got skewed by one bad run (possible because I'm testing on the minicluster).

But in either case, no slowdowns from all the corrections.

@amartyads
Copy link
Contributor Author

amartyads commented Oct 29, 2024

After fixing the implementation so that it actually works now, I reran the speed tests just for completeness's sake. Not much changed, so that's good.

Container Run Type Walltime Boundary Effects Time Force Computation Time Total Computation Time Communication Time
AP master 746.116 0.000000 548.0748 582.2928 132.6998
periodic 750.502 0.108154 551.0130 585.5592 133.6746
reflecting 735.690 15.147920 537.2156 581.5974 127.1540
LC master 1413.200 0.000000 735.0464 885.0394 282.4636
periodic 1405.444 0.175187 728.6756 875.6406 276.0900
reflecting 1324.986 34.878960 651.8310 823.5968 265.7218

@amartyads amartyads merged commit 125c3b6 into mamico-postrefactor-fix Oct 29, 2024
@amartyads amartyads deleted the reflective-boundaries branch October 29, 2024 12:24
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.

4 participants