-
Notifications
You must be signed in to change notification settings - Fork 55
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
Many array temporaries created #39
Comments
Are you willing to share the mods you already made? Was there any indication that they improved performance? I could merge them into the main branch if so. I can also take a look at |
…sing -Warray-temporaries. See #39
HI @jacobwilliams, apologies I realised I never actually answered your comments! |
Note: a quick test on my laptop shows a speed up from the previous version. Likely due to the others changes I made:
|
Very good to know! |
In bspline_sub_module.f90, 'many' array temporaries are created.
When compiling with GCC 7.3.0 and the warning flag -Warray-temporaries, most of them intervene in the calls to dintrv, dbvalu, dbknot and dbtpcf
With just runtime checks, -fcheck=all, they arise for the "fcn" argument of dbtpcf.
I have no idea how harmelss those runtime array temporaries are but since I am incorporating bspline-fortran within a large 3D code I would like to avoid memory fragmentation as much as possible and not exhaust my stack.
I managed to eliminate most of the array temporaries by changing explicit-shape dummy arguments to assumed-shape dummy arguments in most of the routines and getting rid of some assumed-size dummy arrays. But problem remains for "fcn" and "bcoef" in dbtpcf.
I assume it would be tricky to change everything and it would require some copying to adapt the routines for 1D and 3D as the library was originally written in 2D, but I thought assumed-size arrays should not be used in modern Fortran.
The text was updated successfully, but these errors were encountered: