Removing dependence on pyiron_atomistics and depend on pyiron_lammps instead#98
Removing dependence on pyiron_atomistics and depend on pyiron_lammps instead#98jan-janssen merged 25 commits intomainfrom
Conversation
|
@jan-janssen The error is I guess the error should happen somewhere here If you can spot something potentially problematic, let me know. Perhaps some adjustment in this file is required as well (?) |
|
If one has to debug the calculation in more detail, I can also do that at some point but probably not before I'm back from parental leave |
|
@ltalirz I guess the more surprising part for me is that the regular tests work fine, while the agent tests failed even though the changes only affected the LAMMPS interface. Based on this I have the feeling the tests are somehow coupled which is something we should address. Is there anything you do different compared to the tests the @Atilaac does? Different parameters or something like this? I looked at it with @Atilaac but so far we were not able to identify any difference. |
|
The code I linked is how the calculation is run in the API I was also not aware of significant differences If the error message does not point to something obvious I may need to have a deeper look later |
|
@jan-janssen I believe I narrowed down the problem. When the code tries to call this function below, it triggers the error seen in the test because the simulations does not run without a potential.
We provide the potential already as a dataframe and this should be changes to allow for that. I am not sure how to fix this. maybe by adding a check if the provided variable is already a dataframe then use it directly. |
|
@Atilaac Thanks a lot - I fixed this issue in a separate pull request https://github.com/pyiron/pyiron_lammps/pull/271/files#diff-d1807450b5bcd683d7d53e490562d7831904fa36ecfe67f8de4e0ba090b1d31b - pyiron/lammpsparser#271 - but that one is not merged yet. I am going to release a new version with the corresponding changes. |
|
There was a problem hiding this comment.
When I try running the simulation using shik potential parameters the simulation fails. I was able to track where the issue is comming from. when I use this potential there will be a a line that add units metal after the definition of the simulation box which causes lammps to return an error (see the generated lammps script below. What is surprising to me is that this error does not happen for the other potentials and I have no idea why.
So far this is what I could comment on and those are the issues I was able to find.
units metal
dimension 3
boundary p p p
atom_style charge
read_data lammps.data
# S. Sundararaman et al.,
# for silica glass, J. Chem. Phys. 2018, 148, 19, https://doi.org/10.1063/1.5023707
# for alkali and alkaline-earth aluminosilicate glasses, J. Chem. Phys. 2019, 150, 15, https://doi.org/10.1063/1.5079663
# for borate glasses with mixed network formers, J. Chem. Phys. 2020, 152, 10, https://doi.org/10.1063/1.5142605
# for alkaline earth silicate and borate glasses, Shih et al. J. Non-Cryst. Sol. 2021, 565, 120853, https://doi.org/10.1016/j.jnoncrysol.2021.120853
units metal
### Group Definitions ###
group Al type 1
group Ca type 2
group O type 3
group Si type 4
### Charges ###
set type 1 charge 1.6334
set type 2 charge 1.4977
set type 3 charge -1.0379928571428572
set type 4 charge 1.7755
### SHIK Potential ###
pair_style hybrid/overlay coul/dsf 0.2 10.0 table spline 10000
pair_coeff * * coul/dsf
pair_coeff 1 1 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Al_Al.tbl" SHIK_Buck_r24 10.0
pair_coeff 1 3 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Al_O.tbl" SHIK_Buck_r24 10.0
pair_coeff 2 2 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Ca_Ca.tbl" SHIK_Buck_r24 10.0
pair_coeff 2 3 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Ca_O.tbl" SHIK_Buck_r24 10.0
pair_coeff 2 4 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Ca_Si.tbl" SHIK_Buck_r24 10.0
pair_coeff 3 3 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_O_O.tbl" SHIK_Buck_r24 10.0
pair_coeff 3 4 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_O_Si.tbl" SHIK_Buck_r24 10.0
pair_coeff 4 4 table "/Users/achrafatila/Documents/Workflows/pyiron-glass/notebooks/table_Si_Si.tbl" SHIK_Buck_r24 10.0
`pair_modify shift yes
thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol
thermo_modify flush yes
thermo 100
fix langevin all langevin 5000 5000 0.05 48279
fix ensemble all nve/limit 0.5
run 10000
unfix langevin
unfix ensemble
variable dumptime equal 1
dump 1 all custom ${dumptime} dump.out id type xsu ysu zsu fx fy fz vx vy vz
dump_modify 1 sort id format line "%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g"
fix ensemble all nvt temp 5000.0 5000.0 0.1
variable thermotime equal 1
timestep 0.001
velocity all create 5000 12345 dist gaussian
thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol
thermo_modify flush yes
thermo ${thermotime}
run 100000
|
@Atilaac Thanks for the feedback, I am going to work on this and get back to you. I mark the pull request as draft for now. |
|
hey guys, what is the status here? |
|
Hi, in the current version of pyiron_atomistics this issue does not exist. A test for SHIK could be just running the notebook in the notebooks folder. |
|
Ok, thanks. My suggestion would be to include at least a small test of the shik route in the integration tests (the test does not necessarily need to run a full simulation, it just needs to surface the error you witnessed). |
|
I added a test that should fail for this PR and is working fine for the main branch. |
| - pyiron_atomistics =0.8.4 | ||
| - pyiron_base =0.15.9 | ||
| - pyiron_lammps =0.5.3 | ||
| - pyiron_base =0.15.10 |
There was a problem hiding this comment.
By migrating from pyiron_atomistics to pyiron_lammps we reduced the CI time for the Setup Mambaforge step from 1m 35s to 1m 10s and the download size from 975MB to 585MB while maintaining the same functionality. The 390MB of files are primarily related to DFT simulation so they are not required in this project.
|
@jan-janssen I tested the PR locally and I found the following errors. I believe this is a bug in parsing or converting the pressure in pyiron_lammps. I will open a separate pull request in pyiron_lammps as I believe I fixed it locally. |
@Atilaac Thanks a lot for the quick catch and the pull request to fix it. I patched the conda package. Can you test again with the latest version? You can install it using: |
|
@jan-janssen This seems to work fine now. If you are done from your side I can merge this PR now. Let me know. |
ltalirz
left a comment
There was a problem hiding this comment.
thanks @jan-janssen , looks good to me!
| """ | ||
|
|
||
|
|
||
| def get_lammps_command(server_kwargs: dict | None = None) -> str: |
There was a problem hiding this comment.
just out of curiosity: is this the default way to build the commandline for running a code in pyiron (i.e. the user writes a python function to do it based on the server kwargs)?
There was a problem hiding this comment.
I guess the default way would be to have a shell script which has the module load commands and so on. In pyiron_atomistics we had an automated index over a predefined folder structure, this is helpful when you have multiple versions of executables but some times complicated to setup initially:
https://github.com/pyiron/pyiron-resources/blob/main/lammps/bin/run_lammps_2024.02.07.sh
Other tools like ASE use environment variables:
https://ase-lib.org/ase/calculators/lammpsrun.html
At the moment the pyiron_lammps interface just accepts a command which is then executed with a subprocess as I see pyiron_lammps primarily as a writer for the input files and a parser for the output files. To be backwards compatible with the pyiron_atomistics interface we added the option for the user to specify the command.
@ltalirz and @Atilaac I was able to fix the issues and the pull request is now ready for review. For some reason I can only specify one of you as reviewer but I guess it makes sense if both of you have a look at the changes to see if both the agent and the large atomistic simulations work fine with these changes. The major advantage is in reducing the number of dependencies by just using the LAMMPS parser rather than the full suite of atomistic tools in pyiron_atomistics.