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

[BUG] not support formats otherwise POSCAR when using shuffle_poscar #1570

Closed
cherushui opened this issue Jun 18, 2024 · 0 comments · Fixed by #1610
Closed

[BUG] not support formats otherwise POSCAR when using shuffle_poscar #1570

cherushui opened this issue Jun 18, 2024 · 0 comments · Fixed by #1610
Labels
bug Something isn't working

Comments

@cherushui
Copy link
Contributor

cherushui commented Jun 18, 2024

Bug summary

not support formats otherwise POSCAR when using shuffle_poscar

when running dpgen run, an error occured with "abacus/stru" format as sys_configs

nohup: ignoring input
INFO:dpgen:-------------------------iter.000000 task 03--------------------------
Traceback (most recent call last):
  File "/opt/mamba/bin/dpgen", line 8, in <module>
    sys.exit(main())
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/main.py", line 255, in main
    args.func(args)
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/generator/run.py", line 5411, in gen_run
    run_iter(args.PARAM, args.MACHINE)
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/generator/run.py", line 4748, in run_iter
    cont = make_model_devi(ii, jdata, mdata)
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/generator/run.py", line 1216, in make_model_devi
    poscar_shuffle(
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/generator/run.py", line 203, in poscar_shuffle
    numb_atoms = poscar_natoms(lines)
  File "/opt/mamba/lib/python3.10/site-packages/dpgen/generator/run.py", line 196, in poscar_natoms
    numb_atoms += int(ii)
ValueError: invalid literal for int() with base 10: 'LATTICE_CONSTANT'

I've checked the poscar_natoms func in dpgen/generator/run.py, and I think only a fixed POSCAR for vasp are supported

def poscar_natoms(lines):
    numb_atoms = 0
    for ii in lines[6].split():
        numb_atoms += int(ii)
    return numb_atoms

when set "shuffle_poscar": false, dpgen can run normally.

DP-GEN Version

0.12.0

Platform, Python Version, Remote Platform, etc

  • Ubuntu 20.04 LTS (in Bohrium),
  • python: 3.10.6

Input Files, Running Commands, Error Log, etc.

run_param.json

Steps to Reproduce

running dpgen run run_param.json machine.json

Further Information, Files, and Links

No response

@cherushui cherushui added the bug Something isn't working label Jun 18, 2024
@cherushui cherushui changed the title [BUG] not support formats otherwise POSCAR when [BUG] not support formats otherwise POSCAR when using shuffle_poscar Jun 19, 2024
njzjz added a commit to njzjz/dpgen that referenced this issue Aug 2, 2024
@njzjz njzjz linked a pull request Aug 2, 2024 that will close this issue
wanghan-iapcm pushed a commit that referenced this issue Aug 3, 2024
Fix #1570.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced efficiency in handling atomic configurations by directly
modifying coordinates in memory, eliminating the need for intermediate
files.
	- Simplified logic for shuffling atomic indices.

- **Bug Fixes**
- Removed obsolete function that may have caused confusion in the
workflow related to POSCAR file management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz closed this as completed Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants