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

Add MD progress bar #430

Closed
wants to merge 1 commit into from
Closed

Conversation

k-harris27
Copy link
Contributor

Resolves #405

I think there are a few ways that this could be done - this one (attaching the progress bar as an observer function) does not discriminate between heating and production MD steps. I tried using irun as had been suggested, but since half of the ASE ensembles don't support irun right now, this seemed like the best way.

There's a hack at md.py lines 1060/1061 to get around ASE's NPT ensemble calling observers 1 less time than expected. Once the fix is incorporated (https://gitlab.com/ase/ase/-/merge_requests/3598), those lines will need to be deleted.

There is also a test that should check each ensemble fills the progress bar completely by the end of the run.

@k-harris27 k-harris27 marked this pull request as draft February 18, 2025 12:25
@ElliottKasoar
Copy link
Member

Resolves #405

I think there are a few ways that this could be done - this one (attaching the progress bar as an observer function) does not discriminate between heating and production MD steps. I tried using irun as had been suggested, but since half of the ASE ensembles don't support irun right now, this seemed like the best way.

There's a hack at md.py lines 1060/1061 to get around ASE's NPT ensemble calling observers 1 less time than expected. Once the fix is incorporated (https://gitlab.com/ase/ase/-/merge_requests/3598), those lines will need to be deleted.

There is also a test that should check each ensemble fills the progress bar completely by the end of the run.

Thanks for this!

When you say does not discriminate, do you mean it has a single progress bar for a combined heating + MD simulation, with the steps for both summed?

@ElliottKasoar
Copy link
Member

I'm not sure the heating is currently filling up completely (with or without MD after)?

janus-core % janus md --ensemble nvt --temp-time 50 --temp-start 0 --temp-end 20 --temp-step 10 --traj-every 1 --stats-every 1 --struct tests/data/NaCl.cif
cuequivariance or cuequivariance_torch is not available. Cuequivariance acceleration will be disabled.
Using Materials Project MACE for MACECalculator with /Users/elliottkasoar/.cache/mace/20231210mace128L0_energy_epoch249model
Using float64 for MACECalculator, which is slower but more accurate. Recommended for geometry optimization.
[codecarbon INFO @ 17:30:49] offline tracker init
[codecarbon WARNING @ 17:30:49] Multiple instances of codecarbon are allowed to run at the same time.
Performing MD simulation... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100/150 0:00:02
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % 
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % 
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % janus md --ensemble nvt --temp-time 50 --temp-start 0 --temp-end 20 --temp-step 10 --traj-every 1 --stats-every 1 --struct tests/data/NaCl.cif --steps 100
cuequivariance or cuequivariance_torch is not available. Cuequivariance acceleration will be disabled.
Using Materials Project MACE for MACECalculator with /Users/elliottkasoar/.cache/mace/20231210mace128L0_energy_epoch249model
Using float64 for MACECalculator, which is slower but more accurate. Recommended for geometry optimization.
[codecarbon INFO @ 17:31:13] offline tracker init
[codecarbon WARNING @ 17:31:13] Multiple instances of codecarbon are allowed to run at the same time.
Performing MD simulation... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 200/250 

@k-harris27
Copy link
Contributor Author

I'm not sure the heating is currently filling up completely (with or without MD after)?

janus-core % janus md --ensemble nvt --temp-time 50 --temp-start 0 --temp-end 20 --temp-step 10 --traj-every 1 --stats-every 1 --struct tests/data/NaCl.cif
cuequivariance or cuequivariance_torch is not available. Cuequivariance acceleration will be disabled.
Using Materials Project MACE for MACECalculator with /Users/elliottkasoar/.cache/mace/20231210mace128L0_energy_epoch249model
Using float64 for MACECalculator, which is slower but more accurate. Recommended for geometry optimization.
[codecarbon INFO @ 17:30:49] offline tracker init
[codecarbon WARNING @ 17:30:49] Multiple instances of codecarbon are allowed to run at the same time.
Performing MD simulation... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100/150 0:00:02
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % 
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % 
(janus-core) elliottkasoar@dhcp-10-248-26-147 janus-core % janus md --ensemble nvt --temp-time 50 --temp-start 0 --temp-end 20 --temp-step 10 --traj-every 1 --stats-every 1 --struct tests/data/NaCl.cif --steps 100
cuequivariance or cuequivariance_torch is not available. Cuequivariance acceleration will be disabled.
Using Materials Project MACE for MACECalculator with /Users/elliottkasoar/.cache/mace/20231210mace128L0_energy_epoch249model
Using float64 for MACECalculator, which is slower but more accurate. Recommended for geometry optimization.
[codecarbon INFO @ 17:31:13] offline tracker init
[codecarbon WARNING @ 17:31:13] Multiple instances of codecarbon are allowed to run at the same time.
Performing MD simulation... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 200/250 

I noticed this too when the CI tests ran. I can fix it, but I'm trying to see if there's a better way to approach this since this method seems really fragile at the moment.

@ElliottKasoar ElliottKasoar added the enhancement New/improved feature or request label Feb 20, 2025
@k-harris27
Copy link
Contributor Author

Superseded by #444

@k-harris27 k-harris27 closed this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use progress bar for MD
2 participants