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

extended LAMMPS commands support #115

Merged
merged 23 commits into from
Oct 9, 2024

Conversation

cz4rs
Copy link
Contributor

@cz4rs cz4rs commented Sep 18, 2024

Make it possible to define multiple regions (and the size of simulation box will be adjusted accordingly). This is currently rectricted to fcc lattice style only.

Notable changes:

  • use create_atoms to fill the region with atoms of specific type
  • use mass to assign mass to atom type
  • use velocity to assign temperature to atom type

See in.lb deck and the screenshots below for practical demonstration.

You can use paraview --script utils/paraview_process_data.py to speed up analysis of produced data. It will try to load all dump*, domain_act* and domain_lb* data files from your current directory and do some basic ParaView visualization.


TODO (mostly optional):

  • run the simulations for existing decks in CI to ensure no parsing or runtime errors
  • deduce the padding width for filenames from number of steps instead of using hardcoded default
  • improve compatibility with LAMMPS (to be able to run the decks with LAMMPS for comparison)
  • improve group command support
  • improve communication statistics

Multiple regions with different atom types. Note that when the regions overlap, random type will be assigned:
image

Multiple regions with different velocities:
image

Types after 100 steps:
image

Velocities after 100 steps:
image

Types after 1000 steps:
image

@cz4rs
Copy link
Contributor Author

cz4rs commented Sep 18, 2024

@streeve This is remaining part of our work on CabanaMD. Marking this as a draft, as there are some limitations (mostly being restricted to fcc lattice style only) and in progress bits.
Would you be interested in getting this merged as well?

@streeve
Copy link
Member

streeve commented Sep 19, 2024

This is remaining part of our work on CabanaMD. Marking this as a draft, as there are some limitations (mostly being restricted to fcc lattice style only) and in progress bits. Would you be interested in getting this merged as well?

Yes definitely, I will take a look

paraview_process_data.py Outdated Show resolved Hide resolved
src/cabanamd_impl.h Outdated Show resolved Hide resolved
@@ -268,6 +271,11 @@ void Comm<t_System>::exchange()

N_local = N_local + N_total_recv - N_total_send;

std::cout << '[' << proc_rank << "] "
Copy link
Member

Choose a reason for hiding this comment

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

Same here - always better to have more output, but I doubt we always want to output this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely. I will do some testing and polishing to make sure that the information is actually useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relevant cabanaMD.out fragment after integrating this with the other statistics:

#Timestep Temperature PotE ETot Time Atomsteps/s LBImbalance Exchanged
0   13.038466   -4.081539   15.472248   0.00    0.00e+00    -nan    -   
10  11.276282   -1.442460   15.468581   0.52    9.67e+04    -nan    -   
20  10.717567   -0.607034   15.466101   1.13    8.11e+04    7.55e-01    1057
30  10.846505   -0.798659   15.467845   1.87    6.77e+04    7.55e-01    -   
40  10.953565   -0.960041   15.467020   2.73    5.80e+04    7.14e-01    1011
50  11.091998   -1.167610   15.467059   3.15    1.19e+05    7.14e-01    -   
60  11.050713   -1.105665   15.467089   3.65    1.02e+05    6.50e-01    704 
70  11.114292   -1.200594   15.467509   4.00    1.41e+05    6.50e-01    -   
80  11.153192   -1.258347   15.468094   4.40    1.26e+05    5.65e-01    639 
90  11.169153   -1.281515   15.468864   4.66    1.89e+05    5.65e-01    -   
100 11.207249   -1.339408   15.468103   4.96    1.66e+05    4.70e-01    555 

Exchanged column will show up only when Load Balancing is enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with total values since we don't seem to need a breakdown per rank.

src/inputFile_impl.h Outdated Show resolved Hide resolved
input/in.darma Outdated Show resolved Hide resolved
@cz4rs
Copy link
Contributor Author

cz4rs commented Sep 25, 2024

@cwschilly This should help with modifying the load balancing test case.

@streeve Thanks for the review. Leaving this as a draft for now, I will fix the output and possibly some other minor issues next week 🤞

@streeve
Copy link
Member

streeve commented Oct 4, 2024

@cz4rs just a note that I updated the formatting to 14 here to match Cabana (#117) and in the near future we'll plan to bump that again to match Kokkos at 16

@cz4rs
Copy link
Contributor Author

cz4rs commented Oct 4, 2024

@cz4rs just a note that I updated the formatting to 14 here to match Cabana (#117) and in the near future we'll plan to bump that again to match Kokkos at 16

Alright, I'll rebase this as needed.

- print imbalance on initial step (will be `-nan`)
- use tabs as separators for easier reading
@cz4rs cz4rs marked this pull request as ready for review October 8, 2024 16:11
@cz4rs
Copy link
Contributor Author

cz4rs commented Oct 8, 2024

@streeve I have addressed remaining comments. This is also rebased and re-formatted.

Copy link
Member

@streeve streeve left a comment

Choose a reason for hiding this comment

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

This looks great - couple of wording suggestions, but I think it's ready to merge after that

src/cabanamd_impl.h Outdated Show resolved Hide resolved
input/in.lb Outdated Show resolved Hide resolved
@streeve streeve merged commit 0f028b6 into ECP-copa:master Oct 9, 2024
36 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