-
-
Notifications
You must be signed in to change notification settings - Fork 123
Removal of Fortran API variadic functions #297
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
Removal of Fortran API variadic functions #297
Conversation
…ere is a rounding error introduced by FMA in CLANG
… MMG5_ARG_* should be defined as integer(kind=8) to match new API functions
…have a return value
…ve a return value
…structures and mmg3d_free_all to have a return value
Why do we need to change all these thresholds in the core sources of src/common ? That doesn't really seem desirable to me... |
In order to validate some unitary tests, the values of these thresholds have been set ad hoc, by taking into account the truncation error of |
This update is motivated by problems encountered when using variadic functions, such as
MMG3D_Init_mesh()
in Fortran on a ARM processor.Up to now, the Fortran API did not provide interfaces for variadic functions, as such functions do not exist in Fortran.
In this update, variadic functions from the Fortran API have been removed. They have been replaced by functions holding the same name with a different prototype, using arrays of pointer of unknown length, allowing to mimic the behaviour of C variadic functions.
As a consequence, the typical use of these functions in Fortran as been modifed. As illustrated in the
libexamples
, functions should be called using the following syntax:where variadic arguments are passed through an array of
MMG5_DATA_PTR_T
elements. TheLOC()
function must be used to pass data by reference.The perl script generating the Fortran interface has been modified in order to have consistency between both types of elements in the array: indicators such as
MMG5_ARG_start
should be interpreted asINTEGER(kind=N)
, which correspond to the typeMMG5_DATA_PTR_T
.