Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions simpeg/dask/electromagnetics/frequency_domain/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def compute_rows(
)
deriv_columns = Ainv_deriv_u[:, deriv_indices]

count += blocks_receiver_derivs[ind].shape[1]
source = simulation.survey.source_list[addresses[ind][0][0]]

if isinstance(source, PlanewaveXYPrimary):
Expand Down Expand Up @@ -227,7 +228,10 @@ def compute_J(self, m, f=None):
m_size = m.size
compute_row_size = np.ceil(self.max_chunk_size / (A_i.A.shape[0] * 32.0 * 1e-6))
blocks = get_parallel_blocks(
self.survey.source_list, compute_row_size, optimize=False
self.survey.source_list,
compute_row_size,
optimize=False,
thread_count=n_threads,
)

if self.store_sensitivities == "disk":
Expand Down Expand Up @@ -336,9 +340,7 @@ def parallel_block_compute(
n_threads,
worker=None,
):
m_size = m.size
block_stack = sp.hstack(blocks_receiver_derivs).toarray()

ATinvdf_duT = A_i * block_stack

if client:
Expand Down Expand Up @@ -367,23 +369,18 @@ def parallel_block_compute(
)
)
else:
n_rows = np.sum([addresses[ind][1][2] for ind in indices])
delayed_eval = delayed(compute_rows)
block_delayed.append(
array.from_delayed(
delayed_eval(
simulation,
ATinvdf_duT,
count,
blocks_receiver_derivs,
Zero(),
fields_array,
addresses,
Jmatrix,
indices,
),
dtype=np.float32,
shape=(n_rows, m_size),
delayed_eval(
simulation,
ATinvdf_duT,
count,
blocks_receiver_derivs,
Zero(),
fields_array,
addresses,
Jmatrix,
indices,
)
)
count += np.sum([blocks_receiver_derivs[ind].shape[1] for ind in indices])
Expand Down
Loading