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

Inconsistency of Ions::setup when used multiple times #284

Closed
dreamer2368 opened this issue Oct 16, 2024 · 5 comments
Closed

Inconsistency of Ions::setup when used multiple times #284

dreamer2368 opened this issue Oct 16, 2024 · 5 comments

Comments

@dreamer2368
Copy link
Collaborator

dreamer2368 commented Oct 16, 2024

Ions::setup is supposed to update the list of overlapping VL ions (overlappingVL_ions_). However, it is observed that the resulting overlapping ions are different even when the same local ion list is used.

A minimal example is implemented in ion-bug branch. A test executable test_overlapping_ion will be available if the code is fully installed (make install). This branch does not need libROM and can be compiled the same as release branch.

The executable test_overlapping_ion is compiled from src/test_overlapping_ion.cc. This works the same as the main mgmol driver mgmol-opt. In essence, it does the following job:

  • runs Ions::setup 3 times with 3 different ion configurations
  • save the corresponding overlapping VL ion lists
  • runs another Ions::setup with one of (previously used) 3 configurations
  • check if the resulting overlapping VL ion list is equivalent to the saved list

Example config and coordinate file are stored in examples/Carbyne-bug. Once the executable is installed, one can run the following script to check the test failure:

ROOT_DIR=/path/to/your/mgmol/repository
INSTALL_DIR=/path/to/mgmol/install/directory

cd ${ROOT_DIR}/examples/Carbyne-bug
srun -n 144 ${INSTALL_DIR}/bin/test_overlapping_ion -c carbyne.cfg -i carbyne.in

The test passes with the PinnedH2O example, but not with Carbyne example. If we want to manipulate local ion instead of overlapping VL ion in PR #274 , this bug must be fixed first. @jeanlucf22 , can you take a look at this bug?

@jeanlucf22
Copy link
Collaborator

You should follow this example: https://github.com/LLNL/mgmol/blob/release/tests/testIons.cc
The way you are doing it in this branch is not correct: you are setting local atoms with coordinates outside the local MPI sub-domain.

@dreamer2368
Copy link
Collaborator Author

dreamer2368 commented Oct 16, 2024

I'm simply perturbing local atoms by 10% from their original locations. Would that be too large to go beyond the local subdomain? Regardless, shouldn't the output of Ions::setup be the same for the same input?

I'll try to set up the test following testions.cc.

@jeanlucf22
Copy link
Collaborator

Yes, 10% is enough to cross over into another subdomain

@dreamer2368
Copy link
Collaborator Author

dreamer2368 commented Oct 16, 2024

While I could make a fictitious Ions with custom hard-coded species as in testIons.cc, I'm hoping to use this test for any config file that we actually use for production. I hope to move local ions' positions randomly within local MPI subdomain, from the existing Ions that is already set from the initial setup. I guess this should be similar to updating ion locations in md, but I couldn't really pinpoint what part I should pick and use. Can you point me to those functions or guide me how to do this properly?

@dreamer2368
Copy link
Collaborator Author

This problem is solved using Ions::setPositions, which sets ion locations globally over all processes. The resolved version is pushed to the branch ion-bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants