DRAFT: MPI Fortran tutorial and example code#104
Draft
stephenpcook wants to merge 16 commits intompitutorial:gh-pagesfrom
Draft
DRAFT: MPI Fortran tutorial and example code#104stephenpcook wants to merge 16 commits intompitutorial:gh-pagesfrom
stephenpcook wants to merge 16 commits intompitutorial:gh-pagesfrom
Conversation
Add warnings flag to makefile and remove missing dependency.
79d5118 to
e04c165
Compare
ricky-lv426
suggested changes
Nov 20, 2023
ricky-lv426
left a comment
There was a problem hiding this comment.
Hi Stephen it looks generally fine to me. Haven't seem MPI code for a while!
I have made a couple suggestions/recommendations mainly wrt the structure of the code. I think I caught all cases but basically they mostly fall into:
- Either remove unnecessary modularised code as there seems no benefit over just inlining the relevant code where it is needed. Or perhaps create an external module to import set parameters, which would e.g. make future changes to code input easier to modify.
- Use Fortran standard intrinsics.
- Do some more stringent checks on inputs.
Nice little tutorial you've put together. Hopefully my comments/suggestions are helpful.
| implicit none | ||
|
|
||
| integer :: num_args | ||
| character(12) :: arg |
There was a problem hiding this comment.
As per previous suggestion make the 12 a parameter than can be imported from a module?
| call MPI_COMM_RANK(MPI_COMM_WORLD, world_rank) | ||
|
|
||
| if (world_rank .eq. 0) then | ||
| num = -1 |
Module blocks removed in favor of external functions/subroutines and interface blocks. Random number functions `srand` and `rand` replaced by more standard `random_seed` and `random_number` calls.
Pedagogical Review of
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a draft version of a MPI Fortran tutorial. I would appreciate feedback on the tutorial in
index.md.I think I need to run the example codes by someone more experienced with Fortran, and I still have some changes to make, such as
my_bcasttake types other than integers.eq.with==containsand subfunctions.Closes #99