-
Notifications
You must be signed in to change notification settings - Fork 11
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 modern poisson2d solver & rename optimized.f90 #23
Open
rouson
wants to merge
10
commits into
fortran-lang:main
Choose a base branch
from
rouson:modern-poisson2d
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Jun 29, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 39c006a - Browse repository at this point
Copy the full SHA 39c006aView commit details -
feat: add modernized poisson2d solver
Refactorings ------------ 1. Use BLOCK for tighter variable scoping (reduces some clutter). 2. Use array statements with vector subscripts to write compact initializations. 3. Use DO CONCURRENT to express fine-grained parallelism and expose opportunities for optimizations such as vectorization, multithreading, or GPU offloading. 4. Replace some magic values, e.g., initial delta. 5. Eliminate some unnecessary computation by initializing and updating only values that actually need initializing and updating. 6. Use more compact conditional logic. 7. Use a real kind specificaiton based on precision requirements rather than the ambiguously defined double-precision representation of any one given compiler on any one given platform. 8. Eliminate unnecessary precision specifiers ("_dp") when an expression is simply a constant that is exactly representable in any reasonable floating-point representation. 9. Separate the procedure interface into a module and the procedure definition into a submodule.** 10. Use a more descriptive variable names in a few places. 11. Add comments! (includeing some in FORD style) ** In larger projects, item 9 makes code much more user-friendly by isolation the application programmer interface (API) and reduces compile times by eliminating unnecessary compilation cascades.
Configuration menu - View commit details
-
Copy full SHA for a7ccf54 - Browse repository at this point
Copy the full SHA a7ccf54View commit details -
rename optimized.f90 to archaic.f90
This code is old-fashioned, verbose, and most importantly, less clealry expressive, particularly in terms of exposing optimization opportunties, which makes the file name a misnomer. By contrast, commit a7ccf54 introduces a modern.f90 refactored to expose concurrency more explicitly through the use of `do concurrent` and array statements, both of which express sets of operations that can be safely executed in any order, opening up opportunities for vectorization, multithreading, and GPU offloading. In timings on a 2.3 GHz 8-Core Intel Core i9, modern.f90 executes in roughly the same time -- possibly 5-10% longer based on informal ad hoc testing -- but is considerably more compact in many places, is arguably more clear and expressive.
Configuration menu - View commit details
-
Copy full SHA for da910c0 - Browse repository at this point
Copy the full SHA da910c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 648739c - Browse repository at this point
Copy the full SHA 648739cView commit details -
Either is fine. I'm a minimalist so I use the first one because the `_dp` isn't required when the real literal is exactly representable in the chosen floating-post representation, which presumably is the case for `1.` in any floating-point scheme. Co-authored-by: Ondřej Čertík <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f8768cd - Browse repository at this point
Copy the full SHA f8768cdView commit details -
I concur that `_dp` is required in this one. Co-authored-by: Ondřej Čertík <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5563ae2 - Browse repository at this point
Copy the full SHA 5563ae2View commit details -
Co-authored-by: Ondřej Čertík <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7b63bc9 - Browse repository at this point
Copy the full SHA 7b63bc9View commit details -
Co-authored-by: Milan Curcic <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f5ec218 - Browse repository at this point
Copy the full SHA f5ec218View commit details -
Co-authored-by: Ondřej Čertík <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bd22c45 - Browse repository at this point
Copy the full SHA bd22c45View commit details -
Co-authored-by: Milan Curcic <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fcb0cd0 - Browse repository at this point
Copy the full SHA fcb0cd0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.