vtopt / DelaunaySparse

Interpolation via a Sparse Subset of the Delaunay Triangulation

Home Page:https://vtopt.github.io/DelaunaySparse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set pmode in example.py

gillette7 opened this issue · comments

When I run example.py, it gives me error code 90: PMODE not set. (Although it does compute something). It looks like the pmode variable is never set in the example.py script, but no matter what I try (setting pmode at different parts of the script, changing the value to 1 or 2, etc), I keep getting the error code 90. Any thoughts on what I'm missing here?

@gillette7 I don't get this error when I run on either of my machines. Did you alter example.py in any way? Also, are you using any special hardware and on what OS?

This is on the cluster system at LLNL. After each run it says [Delaunay errors: 90 at {0,1,...,998,999};] which corresponds to not setting pmode. If you look in example.py, the function def delaunay_simplex is defined with pmode=None but then at line 46 it calls delaunaysparsep with option pmode=pmode, which presumably is still None. The strange thing is that if I add in pmode=1 just before this call, for instance, it still gives the error 90 result.

Calling with pmode=None in example.py is intentional. By doing so, no optional argument is passed by the Python wrapper to the Fortran subroutine, and the recommended value is automatically assigned (at run-time based on the number of interpolation points). This is all handled between delsparse.py and delsparse.f90

I am not able to reproduce the error on my machine, did you change any lines in example.py or delsparse.py? If not, it may be a type incompatibility (perhaps python's c_type.int and your system's C int don't match, or C int doesn't match with Fortran INTEGER)

@tchlux can you think of any other possibilities? I checked the delsparse.py wrapper for passing pmode and it looks correct, I think it is passing correctly on my machine

@gillette7 the value 90 corresponds to an invalid PMODE, not it being unset. However, if your code is giving this error when you do not provide a value for PMODE then something else is wrong, because that means the boolean that is passed to the Fortran BIND(C) that tells if PMODE is present has the value .TRUE. when it should be .FALSE.. Since we know the code works on some computers but not others, I suspect that one of your wrappers has not compiled and linked to Python correctly. This could cause the PMODE variable to be filled with garbage by the time the Fortran code is executing.

To start, I would delete the *.so file that is automatically compiled and let it recompile the shared object automatically.

Please respond here once you've done that (preferably including the entire output you get when re-executing example.py, including the compilation printouts).

Thanks to both of you. @tchlux - that worked! I deleted delsparse_clib.so, it was rebuilt when I ran example.py again and the error went away. Closing this issue.