Skip to content

DRAFT: MPI Fortran tutorial and example code#104

Draft
stephenpcook wants to merge 16 commits intompitutorial:gh-pagesfrom
stephenpcook:mpi-fortran
Draft

DRAFT: MPI Fortran tutorial and example code#104
stephenpcook wants to merge 16 commits intompitutorial:gh-pagesfrom
stephenpcook:mpi-fortran

Conversation

@stephenpcook
Copy link
Contributor

@stephenpcook stephenpcook commented Oct 12, 2023

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

  • Checking string formatting
  • Make my_bcast take types other than integers
  • Replacing relational operators, e.g. .eq. with ==
  • Check best practice for including modules in a main file vs using contains and subfunctions.
  • Add copyright notices to all code

Closes #99

@stephenpcook stephenpcook marked this pull request as draft October 12, 2023 11:20
@stephenpcook stephenpcook marked this pull request as ready for review November 17, 2023 16:42
@stephenpcook stephenpcook marked this pull request as draft November 17, 2023 16:43
Copy link

@ricky-lv426 ricky-lv426 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turn this into a parameter?

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.
@liamjberrisford
Copy link

Pedagogical Review of index.md

Define Clear Learning Objectives

  • Introduce a brief list of learning objectives at the beginning of the page using action-oriented verbs (e.g. describe, implement, compare).
  • Ensure the objectives are aligned with Bloom's Taxonomy, and build up and reflect both conceptual understanding and practical application.

Improve Instructional Design and Structure

  • Follow a coherent instructional design model such as ADDIE or Backwards Design. For example
    • Begin with foundational concepts (What is MPI?)
    • Progress to syntax and differences in Fortran
    • Follow with practical code examples
    • End with a summary, next steps, or further exercises
  • Ensure each section supports the achievement of the stated objectives.
    In its current form it sort of reads like documentation rather than an actual lesson on MPI?

Reduce Cognitive Load

  • Break large blocks of code or explanation into smaller, more manageable units.
  • Insert explanations between code blocks to support gradual comprehension.
  • Minimise the use of jargon or provide definitions and context for unfamiliar terms.
    I think the place where this is particularly evident is within the first code block that is given. I understand the desire for a runnable Hello World example, but it feels like it jumps into a very big code block. too quickly

Incorporate Inclusive and Accessible Design

  • Add visual aids (e.g. diagrams or illustrations of MPI process flow) to support multiple learning styles.

Introduce Formative Assessment

  • Add short reflective or diagnostic questions throughout the text to reinforce learning.
    • Example: "What is the role of MPI_COMM_WORLD in both the Fortran and C versions?"
  • Depending on what you are using, there are lots of packages that provide interactive quizzes, such as JupyterQuiz, but other packages that create GitHub Pages content also have it.

Encourage a Growth Mindset and Normalise Errors

  • Share examples of common mistakes and how to debug them effectively.

Provide Real-World Context

  • Briefly explain how MPI is used in practical scientific or industrial applications? I think its always handy to have some context for where they are going with the content and the justification for being able to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fortran versions?

3 participants