-
Notifications
You must be signed in to change notification settings - Fork 182
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
addition of stdlib_experimental_stats mean #124
Conversation
This makes it pass on Windows: jvdp1#5 |
Now there is another problem. The CI suggests the file
Which in my opinion is a big problem. Although perhaps this is only in Release mode. I tested on my desktop in Debug mode, and things take under 2s to compile:
In Release mode it took 5.6s. So I think that's fine. Update: I use GFortran 7.4.0. At the CI, this GFortran 7 on Linux takes 10s to compile. GFortran 8 takes 1m 26s and GFortran 9 takes 4m 25s. The timing for GFortran 7 is ok, but versions 8 and 9 are not acceptable in my opinion. But I don't know if this is a problem with GFortran, or with our code. @zbeekman what do you think of these timings? Something is wrong, every new major version of GFortran got much slower than the previous one. |
@certik : Here are the times on my desktop:
When all loops for real arrays are replaced by
See Actions of branch _stat_mean_dev_2 for details with this branch. The tests with GFortran 9 took still >3 minutes. When the files includes arrays with up to 7 dimensions (with the same compiler):
So,
|
In the branch stat_mean_dev_3, I replaced all loops by using Since this reason is not valid (at least with GFortran 9; please explain me why ;)), I propose to merge this branch "stat_mean_dev_3" into this PR. Regarding compile times of stat_mean_dev_3 on my desktop (GFortran 9):
So there is a speedup of 2 (on my desktop) in comparison to this PR that includes all loops for real and integer arrays. From Github Actions, Build and compile times are 6s for GFortran7, 1m 15s for GFortran 8, and 1m 51s for GFortran 9. These times are better than the initial 4 minutes, but I can't still understand why GFortran 8 and 9 need more time on CI than on my own desktop. |
The other concerning thing is if a single function such as As a practical work around, we can have a CMake option for development, which would restrict dimensions to 3. That would allow us to develop with a reasonable compile time. @milancurcic what do you think we should do here? |
More generally, can we have a build parameter to set the maximum rank to build? This would have a low default values for debug and release modes, and user could override it manually if they needed higher ranks? Something along the lines of:
|
For GFortran 7, the number of dimensions restricticted to 7, and the compile time is 6-7 seconds on Github Actions. Would 7 dimensions be an option for you @certik? |
Yes, I am fine with any number of dimensions (including 7) as long as it is fast. If 7 can be made fast, then let's do it. Otherwise let's do less. |
@certik @milancurcic : I implemented the proposed idea. So, for the CI, the maximum dimension for auto-generation of the Issue: Something seems broken for CI on Linux when installing GFortran:
Any idea how to solve this? |
Thanks for implementing it. Yes, the Linux image sometimes has this problem and last time I think it took about a day to resolve. I am hoping it will be faster this time. |
OK. We will see when it will resolve. At least for |
I limited the number of dimensions to 4 (with |
case default | ||
call error_stop("ERROR (mean): wrong dimension") | ||
end select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor nitpick related to the discussion in #76:
- the error message would be more informative if it were to say something like "wrong dimension, value of the dummy variable dim=dim exceeds rank of the dummy array x, rank(x)=rank(x)", where the italics were replaced with the run-time values
We need to wait for the numeric to string conversion functions to achieve this easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you. Ideally it should be check by the compiler (like for sum
and other intrinsic functions).
I will keep it in mind for a next improvement. It could be also related to #121 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me to merge. It compiles quickly with the proper cmake options, all CI tests pass and the code is clean enough. Further improvements can be made with subsequent PRs. So +1 to merge as is, as far as I am concerned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jvdp1!
follow-up of #119 and after merging #123 (See @certik comments).
In addition to #119, CMakefiles and Makefiles.manual were modified to support
fypp
. Therefore, the auto-generated.f90
files are not present in this PR.Issue: I could not modify the CI for Windows properly. I would need help there.