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

Request to expose Zoltan_get_global_id_type() in public API #1640

Closed
gsjaardema opened this issue Aug 24, 2017 · 3 comments
Closed

Request to expose Zoltan_get_global_id_type() in public API #1640

gsjaardema opened this issue Aug 24, 2017 · 3 comments

Comments

@gsjaardema
Copy link
Contributor

gsjaardema commented Aug 24, 2017

I would like to request that the function Zoltan_get_global_id_type() be exposed in the public API. This function is currently defined in packages/zoltan/src/zz/zz_util.c, but is not declared in any of the zoltan public include files.

It is useful to me in detecting whether the library I am linking to was compiled with the same setting for the ZOLTAN_ID_TYPE as was active during the build of my application or as a sanity check that the include files I am reading are compatible with the link library.

In my code, I can do:

    int lib_global_id_type_size = Zoltan_get_global_id_type(nullptr);
    if (lib_global_id_type_size != sizeof(ZOLTAN_ID_TYPE)) {
      std::ostringstream errmsg;
      errmsg << "ERROR: The compile-time ZOLTAN_ID_TYPE size (" << sizeof(ZOLTAN_ID_TYPE) 
	     << ") does not match the run-time ZOLTAN_ID_TYPE size (" << lib_global_id_type_size 
	     << "). There is an error in the build/link procedure for this application.\n";
      std::cerr << errmsg.str();
      exit(EXIT_FAILURE);
    }

The ZOLTAN_ID_TYPE is a global typedef in affect at the time of compilation based on settings in the zoltan_types.h include file while the value returned from Zoltan_get_global_id_type is the size of the ZOLTAN_ID_TYPE which was active at the time the library was compiled.

Hopefully these two values match, but if they don't, then I want to detect it at runtime and output a somewhat helpful error instead of trying to debug some weird downstream corruption. I am currently "manually" prototyping the function and declaring it external in my code, but it would be better for it to be officially in the zoltan API.

Thanks.

@trilinos/zoltan

@kddevin
Copy link
Contributor

kddevin commented Sep 21, 2017

Sorry @gsjaardema ; I am just seeing this issue now.
https://github.com/trilinos/Trilinos/wiki/GitHub-Notifications

Are you still interested in this change? If so, I think it would be easy to move the function for you. Just let me know. Thanks.

@gsjaardema
Copy link
Contributor Author

gsjaardema commented Sep 21, 2017 via email

@kddevin
Copy link
Contributor

kddevin commented Sep 22, 2017

Done. @gsjaardema , please reopen this issue if you have any problems.

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

No branches or pull requests

2 participants