hpc-task 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hpc_task/hpc_calculator/vasp.py +42 -0
- {hpc_task-0.1.3.dist-info → hpc_task-0.2.0.dist-info}/METADATA +1 -1
- {hpc_task-0.1.3.dist-info → hpc_task-0.2.0.dist-info}/RECORD +6 -6
- {hpc_task-0.1.3.dist-info → hpc_task-0.2.0.dist-info}/WHEEL +0 -0
- {hpc_task-0.1.3.dist-info → hpc_task-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {hpc_task-0.1.3.dist-info → hpc_task-0.2.0.dist-info}/top_level.txt +0 -0
hpc_task/hpc_calculator/vasp.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import subprocess
|
|
3
|
+
from pathlib import Path
|
|
2
4
|
|
|
5
|
+
from ase.calculators import calculator
|
|
3
6
|
from ase.calculators.vasp import Vasp as ase_Vasp
|
|
7
|
+
import ase.io
|
|
4
8
|
from hpc_task.hpc import HPCTask
|
|
5
9
|
|
|
6
10
|
|
|
@@ -44,3 +48,41 @@ class Vasp(ase_Vasp):
|
|
|
44
48
|
if out is not None:
|
|
45
49
|
out.write(stdout)
|
|
46
50
|
return returncode, stderr
|
|
51
|
+
|
|
52
|
+
def execute_only(self):
|
|
53
|
+
"""
|
|
54
|
+
仅仅执行 command 命令,从文件夹中读取 INCAR、POTCAR、POSCAR、KPOINTS
|
|
55
|
+
"""
|
|
56
|
+
self.read_potcar(filename=self._indir('POTCAR'))
|
|
57
|
+
self.read_incar(filename=self._indir('INCAR'))
|
|
58
|
+
self.read_kpoints(filename=self._indir('KPOINTS'))
|
|
59
|
+
atoms = ase.io.read(filename=self._indir('POSCAR'))
|
|
60
|
+
# 需要读进去ase-sort.dat,否则结果会报错
|
|
61
|
+
sortfile = self._indir('ase-sort.dat')
|
|
62
|
+
if os.path.isfile(sortfile):
|
|
63
|
+
self.sort = []
|
|
64
|
+
self.resort = []
|
|
65
|
+
with open(sortfile) as fd:
|
|
66
|
+
for line in fd:
|
|
67
|
+
sort, resort = line.split()
|
|
68
|
+
self.sort.append(int(sort))
|
|
69
|
+
self.resort.append(int(resort))
|
|
70
|
+
else:
|
|
71
|
+
# Redo the sorting
|
|
72
|
+
self.initialize(atoms)
|
|
73
|
+
|
|
74
|
+
command = self.make_command(self.command)
|
|
75
|
+
with self._txt_outstream() as out:
|
|
76
|
+
errorcode, stderr = self._run(command=command,
|
|
77
|
+
out=out,
|
|
78
|
+
directory=self.directory)
|
|
79
|
+
|
|
80
|
+
if errorcode:
|
|
81
|
+
raise calculator.CalculationFailed(
|
|
82
|
+
'{} in {} returned an error: {:d} stderr {}'.format(
|
|
83
|
+
self.name, Path(self.directory).resolve(), errorcode,
|
|
84
|
+
stderr))
|
|
85
|
+
|
|
86
|
+
# Read results from calculation
|
|
87
|
+
self.update_atoms(atoms)
|
|
88
|
+
self.read_results()
|
|
@@ -2,10 +2,10 @@ hpc_task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
hpc_task/hpc.py,sha256=nAf7dpoNh9gopk4GbYyPACvtZTCtwe8KfhR0h1pR0Nk,15219
|
|
3
3
|
hpc_task/hpc_calculator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
hpc_task/hpc_calculator/lasp.py,sha256=HD-DCyXoP0C3zuhgB8Da94QrADyZlrIa-ZlcFPvlpnQ,1059
|
|
5
|
-
hpc_task/hpc_calculator/vasp.py,sha256=
|
|
5
|
+
hpc_task/hpc_calculator/vasp.py,sha256=_hOfeD2_izj-sJ_QELsm4MItP3Ci07VSvj72g2TTReE,3001
|
|
6
6
|
hpc_task/templates/__init__.py,sha256=qLeR7AflskortkH8K4eXnRvINl3otLLKHhTNO6Wnh8Q,695
|
|
7
|
-
hpc_task-0.
|
|
8
|
-
hpc_task-0.
|
|
9
|
-
hpc_task-0.
|
|
10
|
-
hpc_task-0.
|
|
11
|
-
hpc_task-0.
|
|
7
|
+
hpc_task-0.2.0.dist-info/licenses/LICENSE,sha256=iEk8UVtFW_L7ddFiCE_WFUjbOCaVc5fwNapeDmeY0WA,1063
|
|
8
|
+
hpc_task-0.2.0.dist-info/METADATA,sha256=38lHbW5qoZq-aGIJmgZ1xiMWmB9XltR1Z20g4EDHPDg,2235
|
|
9
|
+
hpc_task-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
hpc_task-0.2.0.dist-info/top_level.txt,sha256=6mflaHAkVGFi5mREsN5zh0KOO13pTNrTBRAAcwmHMVA,9
|
|
11
|
+
hpc_task-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|