Commit 6de10d0
authored
model_devi | sort models in default&support user-defined order (#610)
* model_devi | sort models in default&support user-defined order
current behavior:
1)the list of models written in input.lammps for model_devi is created by "glob" without "sort" --> may give different (random) orders in different machine environments --> would randomly alter the model being used to sample configurations (always use the first model written in imput.lammps)
---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent.
2)when preparing input.lammps from iuser-provided template, the line begin with "pair_style deepmd" will be overwritten by dpgen, thus overwrites the user defined order of models ---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent and users indeed expected a specific order of models.
changes:
1)sorted the list of models in default, thus always use graph.000.pb to sample configurations;
2)check weather user writes the full line of begin with "pair_style deepmd" (by checking the length), if yes, leave it be; if not, overwrites with the default settings (use graph.000.pb to sample); besides, the original error trigger is retained if key words "pair_style deepmd" are not provided in the template.
* adjust space/tab
* adjust annotation1 parent 7692835 commit 6de10d0
1 file changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
950 | | - | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
951 | 967 | | |
952 | 968 | | |
953 | 969 | | |
| |||
0 commit comments