Skip to content
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

Add fortran_open_s_ and fortran_close_s_ for single precision #60

Closed
amontoison opened this issue Aug 19, 2024 · 3 comments
Closed

Add fortran_open_s_ and fortran_close_s_ for single precision #60

amontoison opened this issue Aug 19, 2024 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@amontoison
Copy link
Member

amontoison commented Aug 19, 2024

It's relevant if we want to use the same problem decoded in different precisions (single, double, quadruple) within the same code.
For example, there will be a conflict when calling fortran_open_ to provide the *.d file because the three libraries libcutest_single, libcutest_double, and libcutest_quadruple contain the same symbol.

We can do the same thing in quadruple precision with fortran_open_q_ and fortran_close_q_.

Off-topic: the mangling of symbols for quadruple precision is different from single/double precision. The first part (cutest) uses uppercase letters, which complicates writing multiprecision code.
An underscore is also missing at the end of the symbols, it should be *_q_.
All symbols are probably wrong in quadruple precision due to that.
It can be easily fix by adding a macro like it's done for symbols in single and double precision.

@amontoison amontoison added bug Something isn't working enhancement New feature or request labels Aug 19, 2024
@amontoison
Copy link
Member Author

amontoison commented Aug 19, 2024

I found a typo for a symbol in single / double precision:
CUTEST_cconst -> cutest_cconst_
CUTEST_cconst_s -> cutest_cconst_s_

We also have a header for CUTEST_cdimcop / CUTEST_cdimcop_s but it's not in the library libcutest_single / libcutest_double.

@nimgould
Copy link
Contributor

I made the change fortran_open -> fortran_open_r (with r preprocessed to "", _s and _q as appropriate. Of course these routines are identical for all three precisions as they do not use reals.

Did you mean that CUTEST_const should say CUTEST_cconst (etc) in cutest.h? I agree

Yes, there is no routine cutest_cdincop so I have removed this from the header file

@amontoison
Copy link
Member Author

amontoison commented Aug 20, 2024

Did you mean that CUTEST_const should say CUTEST_cconst (etc) in cutest.h? I agree

I got a wrong mangling as a consequence of this typo.
You fixed the root of the issue.

All symbols seem correct now.
Thanks, Nick, for fixing them.
I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants