-
Notifications
You must be signed in to change notification settings - Fork 2
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
plugin issue expected LP_struct_BFarray_ instance instead of struct_BFarray_
#1
Comments
I did not but I've also only tested it under Python2.Dinosaur so this is useful feedback. It will also help with the development of |
Actually, could you transfer this issue over to BTCC so I can keep track of it? |
That seems to have worked. |
Yup, looks like it! (I can't see the transfer button so guessing I don't have right permissions) |
I started looking at this today since I'm working on moving ADP over to Py3 but I'm just not hitting this problem. The strange thing is that my |
In btcc_generated.py, the header is: '''Wrapper for btcc.h
Generated with:
-c -lbtcc -I. -Igroup/director2183/dancpr/src/bifrost_tcc_wrapper/src btcc.h -o btcc_generated.py
Do not modify this file.
''' libbtcc was generated with:
It is a pain to install things on the supercomputer, so my most recent setup is using the meson build system (which I quite like). bifrost itself is built using a strange Pawsey-specific build system called MAALI. However I recall hitting this error when compiling on a more regular GPU system. I'll try and find a minimal example to recreate |
(note: this is 'solved', but I'm writing up here for prosperity and discussion)
@LDRyan0 and I have been working on getting the Bifrost TCC plugin working on the topaz supercomputer.
To get it to compile in py 3.6, with the autoconf branch required some makefile edits (we will PR these once we've tidied it up).
Once compiled, we ran into an 'interesting' error when running it:
This turns out to be due to the definition of
class struct_BFarray_(Structure)
inbtcc_generated.py
, which even though it looks identical the definition ofclass struct_BFarray_
inbifrost.libbifrost_generated
, is being considered a different class by ctypes.Our fix was straightforward in the end: remove this from
btcc_generated.py
:and replace with:
@jaycedowell: I'm assuming you didn't have to do this?
Background debug info
For some more debug information, the error was being raised here in
btcc_genereatd.py
:The
LP_
prefix inLP_struct_BFarray_
is ctypes telling us it is a pointer to thestruct_BFarray
,and we are indeed passingPOINTER(BFarray)
toBTccExecute.argtypes
. For example, changing the code toPOINTER(POINTER(BFarray))
will result inLP_LP_struct_BFarray_
.The
expected LP_struct_BFarray_ instance instead of struct_BFarray_
error message is misleading here, removing thePOINTER()
and running the code will result in a segfault (we do want to pass a pointer after all). The cryptic hint that helped me solve it was when after some trial and error the traceback said:!
The text was updated successfully, but these errors were encountered: