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

Support several CALYPSO run in different pressure in one iteration #814

Merged
merged 53 commits into from
Aug 6, 2022

Conversation

wangzyphysics
Copy link
Contributor

Support several CALYPSO run in different pressure in one iteration:

One can do this by changing model_devi_jobs into

{"times":[4, 5],
"NameOfAtoms":["Mg","Al","Cu"],
"NumberOfAtoms":[1,1,1],
"NumberOfFormula":[1,1],
"Volume":30,
...
"PSTRESS":[0, 400, 500, 600],
"fmax":0.01}

the PSTRESS is a List which can contain several different pressure and the number of CALYPSO Loop is same as the length of PSTRESS in one iteration

here is picture of this situation

$ pwd
/home/zhenyu/workplace/dpgen/debug/iter.000004/01.model_devi

image

the times is a List which can be seen as a collection of iter number, in this example "times":[4, 5] means iter.000004 and iter.000005 will run the same CALYPSO Loop

wangzyphysics and others added 30 commits February 21, 2022 22:11
- rename model_devi_calypso.py run_calypso.py
- rename calypso.py make_calypso.py
- add new file calypso_check_outcar.py calypso_run_opt.py
- add new file calypso_run_model_devi.py
- delete write_modd.py
- modify README.md and run.py
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

Merging #814 (fbca550) into devel (5a57de2) will increase coverage by 0.85%.
The diff coverage is 13.63%.

@@            Coverage Diff             @@
##            devel     #814      +/-   ##
==========================================
+ Coverage   35.16%   36.01%   +0.85%     
==========================================
  Files          96       97       +1     
  Lines       16817    17227     +410     
==========================================
+ Hits         5913     6204     +291     
- Misses      10904    11023     +119     
Impacted Files Coverage Δ
dpgen/generator/lib/calypso_check_outcar.py 0.00% <0.00%> (ø)
dpgen/generator/lib/calypso_run_model_devi.py 0.00% <0.00%> (ø)
dpgen/generator/lib/calypso_run_opt.py 0.00% <0.00%> (ø)
dpgen/generator/run.py 62.74% <5.71%> (-0.96%) ⬇️
dpgen/generator/lib/run_calypso.py 10.03% <7.89%> (+0.03%) ⬆️
dpgen/generator/lib/make_calypso.py 70.06% <45.65%> (-7.46%) ⬇️
dpgen/generator/lib/parse_calypso.py 84.84% <60.00%> (+0.47%) ⬆️
dpgen/generator/arginfo.py 99.20% <100.00%> (+50.06%) ⬆️
dpgen/auto_test/common_prop.py 38.15% <0.00%> (-0.10%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

.gitignore Outdated
@@ -41,4 +41,4 @@ dbconfig.json
.idea/*
_build
tests/generator/calypso_test_path
doc/api/
doc/api/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not remove the '\n' at the end of the file

@@ -53,8 +54,8 @@ def make_calypso_input(nameofatoms,numberofatoms,
ret+= "# 0 combination of all method\n"
ret+= "# If GenType=3 or 4, it determined the small unit to grow the whole structure\n"
ret+= "# It determines which local optimization method should be interfaced in the simulation.\n"
assert icode != None or type(icode) == type([0,1]) or type(icode[0]) == type(0)
ret+= "ICode= %d\n"%(icode[0])
assert icode != None or type(icode) == type(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be and? If you want all the conditions are satisfied.
I would recommend changing it to assert icode is not None and type(icode) is int

ret+= "PSTRESS = %f\n"%(pstress[0])
assert fmax != None or type(fmax) == type([200])
ret+= "fmax = %f\n"%(fmax[0])
assert pstress != None or type(pstress) == type(200) or type(pstress) == type(0.001)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar issue

@@ -95,18 +96,19 @@ def make_calypso_input(nameofatoms,numberofatoms,
ret+= "###################End Parameters for VSC ##########################\n"
return ret

def _make_model_devi_buffet(jdata,calypso_run_opt_path):
def _make_model_devi_buffet(jdata,caly_run_opt_path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the original variable name, which is self-explanatory to the readers. It is not easy to relate caly to calypso...

Comment on lines 844 to 846
if run_mode == 1:
caly_run_opt_path.append('%s.%03d'%(_calypso_run_opt_path, 0))
elif run_mode == 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment explaining what does the run_modes mean?

print('too little confs, ')
return
dlog.info('too little confs, ')
sys.exit()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use raise instead

check_outcar_script = os.path.join(calypso_run_opt_path,'check_outcar.py')
shutil.copyfile(check_outcar_file,check_outcar_script)
# Create work path list
caly_run_opt_path = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
caly_run_opt_path = []
calypso_run_opt_path = []

To improve the readability of the code

@wanghan-iapcm
Copy link
Contributor

Could you please merge the devel branch to fix the bug in UT? Thanks!

@wanghan-iapcm wanghan-iapcm merged commit 5c5718c into deepmodeling:devel Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants