Skip to content

Print UMF version in umfInit() when env var UMF_VERSION=1 #550

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

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Jun 14, 2024

Description

Print UMF version in umfInit() when env var UMF_VERSION=1

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@@ -21,6 +24,11 @@ static unsigned long long umfRefCount = 0;

int umfInit(void) {
if (util_fetch_and_add64(&umfRefCount, 1) == 0) {
if (util_env_var_has_str("UMF_VERSION", "1")) {
int umf_ver = umfGetCurrentVersion();
printf("UMF_VERSION: %i.%i\n", UMF_MAJOR_VERSION(umf_ver),
Copy link
Contributor

Choose a reason for hiding this comment

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

why we can't use our logging mechanism here? please do not use printf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: #552

@bratpiorka bratpiorka requested a review from vinser52 June 16, 2024 08:22
@bratpiorka
Copy link
Contributor

as I understand it, here we want to behave in the same way as OpenMP with their environment variable KMP_VERSION and TCM with TCM_VERSION etc. ?

Add umfGetCurrentVersion() to UMF API that gets the current
version of the UMF headers defined by UMF_VERSION_CURRENT.

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Print_UMF_version_in_umfInit_when_env_var_UMF_VERSION=1 branch from d12fc38 to a509d1b Compare June 17, 2024 08:44
@ldorau ldorau force-pushed the Print_UMF_version_in_umfInit_when_env_var_UMF_VERSION=1 branch from a509d1b to 61fbd98 Compare June 17, 2024 08:44
@ldorau
Copy link
Contributor Author

ldorau commented Jun 17, 2024

as I understand it, here we want to behave in the same way as OpenMP with their environment variable KMP_VERSION and TCM with TCM_VERSION etc. ?

Yes, but I try to move it to OpenMP, so closing it for now ...

@ldorau ldorau closed this Jun 17, 2024
@ldorau ldorau deleted the Print_UMF_version_in_umfInit_when_env_var_UMF_VERSION=1 branch June 18, 2024 07:57
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