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

add Schwarz config #1658

Merged
merged 4 commits into from
Aug 24, 2024
Merged

add Schwarz config #1658

merged 4 commits into from
Aug 24, 2024

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Aug 2, 2024

This PR adds the schwarz config.
Following the current decision, only allow the global index setting from the type_descriptor.
Because sizeof(global_index_type) >= sizeof(index_type), there is an invalid configuration (int64, int32) such that we can not use current dispatch. We only have this case, so I directly write it into the schwarz not create another generalized version for dispatch.

@yhmtsai yhmtsai added the 1:ST:ready-for-review This PR is ready for review label Aug 2, 2024
@yhmtsai yhmtsai self-assigned this Aug 2, 2024
@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. reg:testing This is related to testing. mod:core This is related to the core module. type:preconditioner This is related to the preconditioners labels Aug 2, 2024
Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

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

LGTM!

core/config/schwarz_config.cpp Show resolved Hide resolved
core/test/config/type_descriptor.cpp Outdated Show resolved Hide resolved
include/ginkgo/core/config/type_descriptor.hpp Outdated Show resolved Hide resolved
include/ginkgo/core/config/type_descriptor.hpp Outdated Show resolved Hide resolved
@yhmtsai yhmtsai requested a review from a team August 23, 2024 08:19
Copy link
Member

@MarcelKoch MarcelKoch left a comment

Choose a reason for hiding this comment

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

LGTM. I would suggest to not instantiate type_descriptor versions, which are not allowed.

template type_descriptor make_type_descriptor<std::complex<float>, int64>();
template type_descriptor make_type_descriptor<std::complex<double>, int64>();
// global_index: void
template type_descriptor make_type_descriptor<void, void, void>();
Copy link
Member

Choose a reason for hiding this comment

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

From the documentation of type_descriptor, void is only allowed for the first template argument. So we shouldn't instantiate the other cases here. I think you can also use our normal macros then.

Comment on lines 45 to 47
* @param index_typestr the index type string. "void" means no default.
* @param global_index_typestr the global index type string. "void" means
* no default.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param index_typestr the index type string. "void" means no default.
* @param global_index_typestr the global index type string. "void" means
* no default.
* @param index_typestr the index type string.
* @param global_index_typestr the global index type string.

The doc above states that only value_type may be void.

Copy link
Member Author

Choose a reason for hiding this comment

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

no, the value in the value "void" just mentions it is a possible value like float32, float64, int32 not it is for valuetype

Copy link
Member

Choose a reason for hiding this comment

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

I guess I misunderstood it. But I remember that we allow only the value_type to be set in the config file, so it shouldn't be allowed to have no default for the index types.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we can only set up value type in file now. with void in index or global index type, user will get error when they use some solver requiring the index type.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to be useful only when user wants to ensure solver only uses the type provided by user.
It will be quite rare

Copy link
Member Author

Choose a reason for hiding this comment

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

I have removed them for now

include/ginkgo/core/config/type_descriptor.hpp Outdated Show resolved Hide resolved
@yhmtsai yhmtsai force-pushed the schwarz_config branch 2 times, most recently from 2f472f6 to 7d1ef72 Compare August 23, 2024 15:54
@yhmtsai yhmtsai added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Aug 23, 2024
@yhmtsai yhmtsai merged commit 9929854 into develop Aug 24, 2024
10 of 14 checks passed
@yhmtsai yhmtsai deleted the schwarz_config branch August 24, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-to-merge This PR is ready to merge. mod:core This is related to the core module. reg:build This is related to the build system. reg:testing This is related to testing. type:preconditioner This is related to the preconditioners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants