Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Butterfly matrix compress with blocks of elements? #121

Open
mdschroer opened this issue Jun 24, 2024 · 7 comments
Open

Butterfly matrix compress with blocks of elements? #121

mdschroer opened this issue Jun 24, 2024 · 7 comments

Comments

@mdschroer
Copy link

Is building a butterfly matrix from blocks of elements supported? It looks like it is supported by ButterflyPACK, but as best as I can tell it hasn't yet been implemented in the STRUMPACK wrapper.

I can save a little bit of calculations with my kernel by computing a block at a time, as opposed to element by element. Do you expect the butterfly construct_from_elements to support block-by-block construction in the future?

Thanks!

@liuyangzhuan
Copy link
Collaborator

@pghysels any thought on this? I thought we already have it in strumpack sparse matrix interface, but maybe not yet for the dense interface?

@pghysels
Copy link
Owner

pghysels commented Jul 2, 2024

Apologies for the delay, yes it is supported:

void compress(const elem_blocks_t& Aelem);

elem_blocks_t is defined here:

using elem_blocks_t = typename std::function

you can ignore the ExtractionMeta argument.

@mdschroer
Copy link
Author

Ah gotcha! I guess that it isn't implemented in the structured interface (that I had been using), but is in the ButterflyMatrix class directly? I'll switch to using the ButterflyMatrix class.

Thanks guys!

@mdschroer
Copy link
Author

mdschroer commented Jul 3, 2024

Hmm. When I try to build a butterfly matrix using the structured interface and block extraction, I get a std::logic_error "Not implemented yet". The same code works fine with element-by-element extraction.

For reference, my matrix is a complex, with non-square shape.

If the situation isn't immediately apparent, I can put together some reproducer code.

Thanks!

@mdschroer mdschroer reopened this Jul 3, 2024
@liuyangzhuan
Copy link
Collaborator

liuyangzhuan commented Jul 3, 2024 via email

@pghysels
Copy link
Owner

pghysels commented Jul 3, 2024

It looks like that exception is coming from

throw std::logic_error("Not implemented yet.");

The functionality should be there for ButterflyMatrix (including complex and non-square), but just not added to the StructuredMatrix interface.
I don't have time to do that this week. I'll try next week.
You could try the class ButterflyMatrix directly:
void compress(const delem_blocks_t& Aelem);

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

No branches or pull requests

3 participants