Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jukkr
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kkr
jukkr
Commits
248868b5
Commit
248868b5
authored
3 years ago
by
Philipp Rüssmann
Browse files
Options
Downloads
Patches
Plain Diff
Activate Lloyd tests
parent
028a7a76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/KKRnano/regtests/tests.py
+11
-4
11 additions, 4 deletions
source/KKRnano/regtests/tests.py
with
11 additions
and
4 deletions
source/KKRnano/regtests/tests.py
+
11
−
4
View file @
248868b5
...
...
@@ -46,7 +46,7 @@ def get_energy(string):
else
:
raise
ArgumentError
def
KKRnano
(
inputdir
,
nranks
=
DEFAULT_nranks
,
nthreads
=
DEFAULT_nthreads
,
solver
=
DEFAULT_solver
,
lmax
=
DEFAULT_lmax
,
Lly
=
DEFAULT_Lly
):
def
KKRnano
(
inputdir
,
nranks
=
DEFAULT_nranks
,
nthreads
=
DEFAULT_nthreads
,
solver
=
DEFAULT_solver
,
lmax
=
DEFAULT_lmax
,
Lly
=
DEFAULT_Lly
,
**
kwargs
):
"""
Run KKR-calculation with input from
'
inputdir
'
and returns the total energy
"""
if
verbose
:
print
"
start KKR for
"
,
inputdir
,
"
with lmax=
"
,
lmax
,
"
, solver=
"
,
solver
,
"
, nthreads=
"
,
nthreads
,
"
nranks=
"
,
nranks
...
...
@@ -72,6 +72,11 @@ def KKRnano(inputdir, nranks=DEFAULT_nranks, nthreads=DEFAULT_nthreads, solver=D
with
open
(
"
input.conf
"
,
"
a
"
)
as
myfile
:
## append to file
myfile
.
write
(
"
LLY = {0}
\n
"
.
format
(
int
(
Lly
)))
# add other inputs
for
key
,
val
in
kwargs
.
items
():
with
open
(
"
input.conf
"
,
"
a
"
)
as
myfile
:
## append to file
myfile
.
write
(
"
{0} = {1}
\n
"
.
format
(
key
,
val
))
mpirun
=
''
if
MPIEXEC
==
'
srun
'
:
mpirun
=
'
srun -n 1
'
...
...
@@ -156,9 +161,11 @@ class Test_semiconductors(unittest.TestCase):
self
.
assertAlmostEqual
(
KKRnano
(
"
ZnO
"
,
solver
=
direct
,
nranks
=
2
**
r
),
Etot
,
DECIMALS
)
### Lloyd formula
# broken because of error message "Lloyd's formula and num_local_atoms > 1 not supported."
# Etot = -7405.74826372
# self.assertAlmostEqual(KKRnano("ZnO", solver=direct, nranks=8, Lly=1), Etot, DECIMALS)
# self.assertAlmostEqual(KKRnano("ZnO", nranks=8, Lly=1), Etot, DECIMALS)
# this seems to work only if we have one MPI rank per atom
# i.e. put "num_atom_procs = 8" into the input.conf
Etot
=
-
7405.75215722
self
.
assertAlmostEqual
(
KKRnano
(
"
ZnO
"
,
solver
=
direct
,
nranks
=
8
,
Lly
=
1
,
num_atom_procs
=
8
),
Etot
,
DECIMALS
)
self
.
assertAlmostEqual
(
KKRnano
(
"
ZnO
"
,
nranks
=
8
,
Lly
=
1
,
num_atom_procs
=
8
),
Etot
,
DECIMALS
)
# total time ~1.5min
class
Test_nocosocmaterials
(
unittest
.
TestCase
):
...
...
This diff is collapsed.
Click to expand it.
Philipp Rüssmann
@ruess
mentioned in commit
cbb5645d
·
2 years ago
mentioned in commit
cbb5645d
mentioned in commit cbb5645d48afdad6e29c449ffb1dc770c3ecb55f
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment