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

ABT_self_get_type() printing on type == ABT_UNIT_TYPE_EXT #341

Closed
ashleypittman opened this issue Jul 2, 2021 · 2 comments · Fixed by #343
Closed

ABT_self_get_type() printing on type == ABT_UNIT_TYPE_EXT #341

ashleypittman opened this issue Jul 2, 2021 · 2 comments · Fixed by #343

Comments

@ashleypittman
Copy link

We have a generic logging callback that tried to log the "thread" identifier so is called in many different contexts and one of the things it does is call ABT_self_get_thread_id(), however that fails if called outside of a argobots context, so before we call that we call ABT_self_get_type() which appears to do exactly what we want.

Looking at the code we're don't have ABT_CONFIG_ENABLE_VER_20_API set, so we're seeing log messages of "[self.c:300] ABT_self_get_type: 4" printed every time we call this function, and it's then returning ABT_ERR_INV_XSTREAM and setting type to ABT_UNIT_TYPE_EXT.

Other than the debug printf when using --enable-debug everything is working as we expect, but it seems that calling this function in this context is OK so the message should not be printed in this case.

One fix would be to create a new ABTI_SETUP_LOCAL_XSTREAM_SILENT() macro to remove the print and call it from self_get_type, there would be the possibility to use this in ABT_self_get_thread_id() as well which would work for our use-case but I can see why you might not want this generally.

@shintaro-iwasaki
Copy link
Collaborator

shintaro-iwasaki commented Jul 2, 2021

Thank you for reporting the issue! I agree. those messages look annoying. I would like to change this error behavior since it is not an "error", but while we are maintaining this 1.x API, we should suppress this error message for some functions that return error codes users might use.

I will create a PR soon.


The following does not fix this issue, but just tips:

Workaround for Argobots 1.1 (latest stable):

Neither event log nor error message, but -g -Wall:

./configure --enable-debug=yes

Both event log and error message.

./configure --enable-debug=all

Workaround for Argobots > 1.1 (main branch):

This --enable-debug options are cleaned up by #332.

Neither event log nor error message, but -g -Wall.

./configure --enable-debug=yes

Only event log.

./configure --enable-debug=yes,log,ub_assert

Both event log and error message.

# --enable-debug=all is equal to --enable-debug=yes,err,log,ub_assert
./configure --enable-debug=all

@ashleypittman
Copy link
Author

Thank you. Whilst the messages are annoying they're not causing a problem so I don't think we need any immediate workarounds but that's good information.

Currently we're using 1.1 and not supplying any debug options, as part of investigating #333 I've been trying tip of main and using --enable-debug=most which is where I saw the issue. It's likely that we'll be testing with at least some debugging turned on in future, if only to get -g enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants