Skip to content

Conversation

@ZoeLeibowitz
Copy link
Owner

No description provided.

lib_dir = Path(metadata['lib_dirs'][-1])

try:
cls.lib = ctypes.CDLL(lib_dir/'libpetsc.so')
Copy link
Collaborator

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

Copy link
Collaborator

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("...")
Copy link
Collaborator

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
Copy link
Collaborator

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

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.

4 participants