Skip to content

Commit

Permalink
Slurm job submission script fix. (#109)
Browse files Browse the repository at this point in the history
* Magnetic setup and LOCPOT update.

* Added LOCPOT, test Fermi velocity, test Tc

* Pycodestyle fix.

* LDAU module added.

* Magnetic ordering,EFG setup, Interface fix

* Pycodestyle fix.

* Pycodestyle fix.

* Delete rem.sh

* Atoms dim test.

* Slurm queue fix.

* Test coverage

* Pycodestyle fix.

* Pycodestyle fix in magmom_setup
  • Loading branch information
knc6 authored Aug 8, 2020
1 parent d128dad commit e7710ff
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Version number."""
__version__ = "2020.7.25"
__version__ = "2020.8.7"
15 changes: 1 addition & 14 deletions jarvis/analysis/magnetism/magmom_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,10 @@ def get_minimum_configs(self, min_configs=10, enforce_primitive=True):
while len(symm_list) < min_configs:
dim[index_to_expand[count]] += 1
symm_list, ss = self.get_unique_magnetic_structures(
atoms, supercell_dim=dim, magnetic_ions=["Mn"]
atoms, supercell_dim=dim, magnetic_ions=self.get_mag_ions()
)
count = count + 1
if count > 2:
count = 0
print("Supercell dimension", dim)
return symm_list, ss


"""
if __name__ == "__main__":
from jarvis.db.figshare import data
dft3d=data('dft_3d')
for i in dft3d:
if i['jid']=='JVASP-22693':
atoms=Atoms.from_dict(i['atoms']).get_primitive_atoms
Mag = MagneticOrdering(atoms).get_minimum_configs(min_configs=3)
print ('Mag',Mag)
"""
2 changes: 1 addition & 1 deletion jarvis/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def converged(self):
pass
return cnvg

@property
# @property
def efg_tensor_diag(self, std_conv=True, prec=3):
"""Get diagonalized electric field gradient tensor."""
# std_conv: |Vzz|>=|Vyy|>=|Vxx|, eta=(Vxx-Vyy)/Vzz
Expand Down
2 changes: 1 addition & 1 deletion jarvis/tasks/queue_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def slurm(
f = open(filename, "w")
f.write("%s\n" % shell)
f.write("#SBATCH --nodes=%d\n" % (nnodes))
f.write("SBATCH --ntasks-per-node=%d\n" % (cores))
f.write("#SBATCH --ntasks-per-node=%d\n" % (cores))

if walltime is not None:
if isinstance(walltime, str):
Expand Down
9 changes: 7 additions & 2 deletions jarvis/tests/testfiles/io/calphad/test_calphad.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from jarvis.io.calphad.write_decorated_poscar import get_selective_dyn_decorated_atoms
from jarvis.core.atoms import Atoms

from jarvis.io.vasp.inputs import Poscar

def test_cal():
box = [[2.715, 2.715, 0], [0, 2.715, 2.715], [2.715, 0, 2.715]]
coords = [[0, 0, 0], [0.25, 0.2, 0.25]]
elements = ["Si", "Si"]
atoms = Atoms(lattice_mat=box, coords=coords, elements=elements)
decorated_atoms, hall_number, wsymbols = get_selective_dyn_decorated_atoms(atoms)
print (decorated_atoms)
p = Poscar(decorated_atoms)
p.write_file('POSCAR')
#p2 = Poscar.from_file('POSCAR')
#print (p2)
assert (wsymbols, hall_number) == (["i", "i"], 63)


# test_cal()
#test_cal()
2 changes: 2 additions & 0 deletions jarvis/tests/testfiles/io/vasp/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def test_inputs():
assert (round(p.atoms.density, 2), i.to_dict()["ISIF"]) == (2.25, "3")
d = i.to_dict()
ii = Incar.from_dict(d)
ii.write_file('INCAR')
print (ii)
pot = os.path.join(
os.path.dirname(__file__), "POT_GGA_PAW_PBE", "Xe", "POTCAR",
)
Expand Down
13 changes: 11 additions & 2 deletions jarvis/tests/testfiles/io/vasp/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,17 @@ def test_locpot():
vac = loc.vac_potential()[0]
assert round(vac,2) == round(7.62302803577618, 2)


td = loc.to_dict()
fd = Locpot.from_dict(td)

vac = loc.vac_potential(direction='Y')[0]
assert round(vac,2) == round(7.62302803577618, 2)

vac = loc.vac_potential(direction='Z')[0]
assert round(vac,2) == round(7.62302803577618, 2)


def test_vrun():
# print ('gapp',round(vrun.get_indir_gap,2))
assert (round(vrun.get_indir_gap[0], 2)) == (0.73)
Expand Down Expand Up @@ -269,7 +277,8 @@ def test_out():
out_efg_raw = Outcar(
os.path.join(os.path.dirname(__file__), "OUTCAR.EFG-JVASP-12148")
).efg_raw_tensor
assert out_efg.efg_tensor_diag[0][0] == -4.766
assert out_efg.efg_tensor_diag()[0][0] == -4.766
assert out_efg.efg_tensor_diag(std_conv=False)[0][0] == -4.766
assert out_efg.quad_mom[0][0] == 0.023
assert out_efg.converged == True
td = out_efg.to_dict()
Expand All @@ -278,7 +287,7 @@ def test_out():
print()
print("out_efg_raw", np.linalg.eig(out_efg_raw)[0])
print()
print("out_efg", out_efg.efg_tensor_diag)
print("out_efg", out_efg.efg_tensor_diag())
print()


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="jarvis-tools",
version="2020.7.25",
version="2020.8.7",
long_description=long_d,
install_requires=[
"numpy",
Expand Down

0 comments on commit e7710ff

Please sign in to comment.