-
Notifications
You must be signed in to change notification settings - Fork 18
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
Check for usage of these subroutines #213
Comments
I was working on implementation related things earlier this week, so I'll take a stab at some of the things on our list now that I'm done with that. |
Meanwhile I have been looking at some of the functions here for testing. Holy. Freaking. Crap. There is some hairy math here! |
I found some tests that used to be in the repository by going back in the commit history that might be helpful. |
See https://github.com/kgerheiser/symbol_checker I ran it on sp and NEMS.exe (weather model) and the results were:
|
Well that is not a lot! How about the _8 and _d versions? |
The library kind does not matter. They all provide the same symbols and rely on the user to link the correct version. |
So does that mean this particular NEMS.exe was built for the _4 libraries? |
BTW in this case there is no need to print out the unused functions/subroutines. We can see at a glance that almost all of them are unused! |
No, it was built the default way, which is I just used The executable would link fine with any of the other versions and it wouldn't break until you run it. |
OK, because the functions have the same name, and Fortran does not check the type of arguments when matching a function. |
Yes, that would be the compiler's job with module files (and name mangling), but the object files contain no type information. |
OK, also, almost none of the subroutines in NCEPLIBS-sp are actually used. That's kind of a big deal! ;-) |
Here is UFS_UTILS:
And from ip (when comparing directly to another library instead of executable it doesn't include sp's internal calls, to fft for example):
|
I guess the next question is: what is a comprehensive set of binaries that we must check? That is, what is the list of binraries that, once we show a program is not used anywhere, we can remove it? |
directory /nwprod on WCOSS. |
Putting this under NCEPLIBS because I think something like this could be a useful utility for generally tracking usage of NCEPLIBS routines throughout the EMC ecosystem. |
What would be super useful would be a python script that takes two directory names as arguments, a source and a bin directory.
Then the script should parse all the code files in the source directory and come up with a list of subroutine/function names. Then it should use nm -a on all the binaries in the other directory and give a list of which binaries use which subroutines.
It should also then provide a list of all the unused subroutines.
This script would be very helpful in dealing with NCEPLIBS issues.
The text was updated successfully, but these errors were encountered: