-
Notifications
You must be signed in to change notification settings - Fork 0
PETSc Memory Allocator #69
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
base: master
Are you sure you want to change the base?
Conversation
| lib_dir = Path(metadata['lib_dirs'][-1]) | ||
|
|
||
| try: | ||
| cls.lib = ctypes.CDLL(lib_dir/'libpetsc.so') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? Looks like division by a string unless I'm missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib_dir is a Path so maybe it overrides division to allow that
|
|
||
| def _alloc_C_libcall(self, size, ctype): | ||
| if not self.available(): | ||
| raise RuntimeError("...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error message?
| c_bytesize = ctypes.c_ulong(size * ctypes.sizeof(ctype)) | ||
| c_pointer = ctypes.cast(ctypes.c_void_p(), ctypes.c_void_p) | ||
|
|
||
| from devito.petsc.memory import op_memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of imports within functions here, which probably means things need moving around to prevent circular imports
…n not all functions are mem alloc via petsc
No description provided.