Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neel Shah
NIFTy
Commits
a386488b
Commit
a386488b
authored
Jun 17, 2016
by
theos
Browse files
Deactivated nifty_about output for MPI ranks other than 0.
parent
fd8bdf02
Changes
2
Show whitespace changes
Inline
Side-by-side
config/nifty_about.py
View file @
a386488b
...
...
@@ -23,9 +23,20 @@ from sys import stdout as so
import
os
import
inspect
import
d2o
import
keepers
from
nifty
import
__version__
MPI
=
d2o
.
config
.
dependency_injector
[
keepers
.
get_Configuration
(
'D2O'
)[
'mpi_module'
]]
comm
=
MPI
.
COMM_WORLD
size
=
comm
.
size
rank
=
comm
.
rank
class
switch
(
object
):
"""
.. __ __ __
...
...
@@ -256,7 +267,7 @@ class notification(switch):
current
=
inspect
.
stack
()[
i
][
3
]
return
result
[
1
:]
def
cstring
(
self
,
subject
):
def
cstring
(
self
,
subject
):
"""
Casts an object to a string and augments that with a colour code.
...
...
@@ -272,10 +283,11 @@ class notification(switch):
String augmented with a color code.
"""
if
rank
==
0
:
return
self
.
ccode
+
str
(
self
.
_get_caller
())
+
':
\n
'
+
\
str
(
subject
)
+
self
.
_code
+
'
\n
'
def
cflush
(
self
,
subject
):
def
cflush
(
self
,
subject
):
"""
Flushes an object in its colour coded sting representation to the
standard output (*without* line break).
...
...
@@ -291,11 +303,11 @@ class notification(switch):
None
"""
if
(
self
.
status
)
:
if
self
.
status
and
rank
==
0
:
so
.
write
(
self
.
cstring
(
subject
))
so
.
flush
()
def
cprint
(
self
,
subject
):
def
cprint
(
self
,
subject
):
"""
Flushes an object in its colour coded sting representation to the
standard output (*with* line break).
...
...
@@ -311,7 +323,7 @@ class notification(switch):
None
"""
if
(
self
.
status
)
:
if
self
.
status
and
rank
==
0
:
so
.
write
(
self
.
cstring
(
subject
)
+
"
\n
"
)
so
.
flush
()
...
...
operators/nifty_operators.py
View file @
a386488b
...
...
@@ -3388,7 +3388,7 @@ class propagator_operator(operator):
"ERROR: At least M or N must be given."
))
def
_multiply
(
self
,
x
,
W
=
None
,
spam
=
None
,
reset
=
None
,
note
=
True
,
x0
=
None
,
tol
=
1E-3
,
clevel
=
1
,
limii
=
None
,
**
kwargs
):
x0
=
None
,
tol
=
1E-3
,
clevel
=
1
,
limii
=
1000
,
**
kwargs
):
if
W
is
None
:
W
=
self
.
S
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment