From 160ce952981eabe6604dd19f40fc3bb0688eb4a6 Mon Sep 17 00:00:00 2001 From: Logan Bishop-Van Horn Date: Mon, 18 Sep 2023 15:07:43 -0700 Subject: [PATCH] Update solve.py --- tdgl/solver/solve.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tdgl/solver/solve.py b/tdgl/solver/solve.py index 2d4f01b..d3b4ad8 100644 --- a/tdgl/solver/solve.py +++ b/tdgl/solver/solve.py @@ -2,6 +2,7 @@ import itertools import logging +import math from datetime import datetime from typing import Callable, Dict, Optional, Sequence, Union @@ -367,7 +368,7 @@ def update( ) if use_cupy: threads_per_block = 1024 - num_blocks = int(len(edges) / threads_per_block) + num_blocks = math.ceil(len(edges) / threads_per_block) get_A_induced_cupy[num_blocks, threads_per_block]( J_site, areas, sites, edge_centers, new_A_induced ) @@ -383,6 +384,7 @@ def update( xp.linalg.norm(dA, axis=1) / xp.linalg.norm(A_induced, axis=1) ) screening_error = float(screening_error) + print(screening_error) del v[:-2] del A_induced_vals[:-2]