Skip to content

Commit f86f309

Browse files
committed
Add print_subproblem_ranks for NLBVP
1 parent f263415 commit f86f309

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dedalus/core/solvers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,17 @@ def __init__(self, problem, **kw):
456456
self.F = F_handler.fields
457457
logger.debug('Finished NLBVP instantiation')
458458

459+
def print_subproblem_ranks(self, subproblems=None):
460+
"""Print rank of each subproblem LHS."""
461+
if subproblems is None:
462+
subproblems = self.subproblems
463+
# Check matrix rank
464+
for i, sp in enumerate(subproblems):
465+
if not hasattr(sp, 'dF_min'):
466+
continue
467+
dF = sp.dF_min.A
468+
print(f"MPI rank: {self.dist.comm.rank}, subproblem: {i}, group: {sp.group}, matrix rank: {np.linalg.matrix_rank(dF)}/{dF.shape[0]}, cond: {np.linalg.cond(dF):.1e}")
469+
459470
def newton_iteration(self, damping=1):
460471
"""Update solution with a Newton iteration."""
461472
# Compute RHS

0 commit comments

Comments
 (0)