Skip to content

Fix for set_adapt_weight() with Poisson solver. - #851

Merged
mkstoyanov merged 6 commits into
project-asgard:developfrom
TTBurnett:transfer_kernel
Jul 28, 2026
Merged

Fix for set_adapt_weight() with Poisson solver.#851
mkstoyanov merged 6 commits into
project-asgard:developfrom
TTBurnett:transfer_kernel

Conversation

@TTBurnett

Copy link
Copy Markdown
Contributor

Adapt weight was crashing when used with an electric moment because the poisson solver was not initialized before set_initial_condition() was called. I fixed this so set_adapt_weight() works with the Poisson solver. I also added a single kernel for the remap_() function on GPU in asgard_poisson.cpp to reduce the number of kernel launches.

@mkstoyanov mkstoyanov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severe jetlag here, saw these will have other comments later.

Comment thread src/pde/two_stream_md.cpp Outdated
Comment thread src/pde/two_stream_md.cpp Outdated
int i = threadIdx.x + blockIdx.x * num_threads;
int64_t total_elements = block_size * num_transfers;
while (i < total_elements) {
int64_t transfer_idx = i / block_size;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time we talk, remind me to talk about launching a kernel on a 2D thread grid and doing cycles.

Nothing to change right now, this is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@mkstoyanov
mkstoyanov merged commit 04e0079 into project-asgard:develop Jul 28, 2026
11 checks passed
@TTBurnett
TTBurnett deleted the transfer_kernel branch July 28, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants