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

Typemap generator tool not creating int or custom typemap for enums #72

Open
aproeme opened this issue Oct 7, 2019 · 0 comments
Open

Comments

@aproeme
Copy link

aproeme commented Oct 7, 2019

Hi,

In porting a code to use LibGeoDecomp I found that for any enum type Cell variables the typemap generator tool fails to create code in the generated typemaps.h to define the corresponding lookup function which is called from the generated typemaps.cpp (within generateMapCell()), meant to return a suitable MPI_Datatype for that enum. The result therefore fails to compile, complaining about the missing lookup function.

This problem can be reproduced in the typemap generator example ("sample") included in the most recent version of the LibGeoDecomp, at least in my hands:

In typemaps.cpp that is generated there appears the following lookup call, in generateMapCell():

MemberSpec(getAddress(&obj->fuel), lookup<Fuel >(), 1),

But typemaps.h does not have lookup<Fuel > defined.

The underlying type of unscoped default type-unspecified C++ enums is implementation defined, usually int, so actually no new lookup function is needed and the call in generateMapCell() can be replaced with:

MemberSpec(getAddress(&obj->fuel), lookup<int >(), 1),

I've checked this compiles (after also modifying MPI::CAR to MPI_CAR in main.cpp) and runs, and it seems happy.

It seems to me like this issue should be resolved by modifying the typemap generator tool. The comments in mpiparser.rb suggest the intention was always to create a lookup call for integer type within typemaps.cpp, but in my hands this is not what is generated. I can't immediately tell whether the issue is in lookup_type("int") in mpiparser.rb not returning int type or whether there is an issue in generate_single_map inside mpigenerator.rb.

It's possible of course that the issue I encountered is simply due to an unforeseen interaction between my environment and that used when the typemap generator tool was created. I ran this using the supplied doxygen.conf, with doxygen version 1.8.15, ruby version 2.6.2p47, under macOS.

If I can help or provide further information let me know.

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

1 participant