Skip to content
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

Create parallel-fortran example #341

Draft
wants to merge 6 commits into
base: gh-pages
Choose a base branch
from

Conversation

bkmgit
Copy link
Contributor

@bkmgit bkmgit commented Apr 18, 2021

It would be helpful to have examples in a number of programming languages, to allow choice and comparison.
This is for Fortran, but other languages would be nice to add as well.

It would be helpful to have examples in a number of programming languages, to allow choice and comparison.
@tkphd tkphd marked this pull request as draft April 18, 2021 12:14
@tkphd tkphd changed the title WIP: Create parallel-fortran example Create parallel-fortran example Apr 18, 2021
@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

As a practitioner, I find this very cool, and welcome the contribution.
For our learners, the focus of this lesson should be on using the HPC machinery, and the high-level Python language is the best fit for that constraint. I suggest we begin planning an "HPC Programming" lesson and consider moving this Fortran code there.

Complete parallel Fortran program
Add explanation of how to make the program  parallel
@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 18, 2021

  • We should not force everyone to use Python, while it is useful for scripting and increasing programmer productivity, it has serious drawbacks for efficiency, see for example https://ioinformatics.org/journal/INFOL026.pdf
  • One of the aims of parallelization is to reduce time to solution, since both human time and computer time are important, it is good to make people aware that expending more human time to use a less productive language can lead to reduced computation time.
  • Allowing people to contribute different parallel versions is the way to go
  • The artificial memory utilization in the Python program is needed in Python because loops without automatic numpy vectorization are slow. Tradeoffs of speed for memory are common in many algorithm implementations, but probably not needed in all the implementations.

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

I completely agree, @bkmgit: I use C++ & CUDA for my HPC work, with some Python glue. We are not trying to force people to use Python, and certainly are not suggesting people use vanilla Python for high-performance applications.

Fundamentally, the HPC Intro lesson is not about the code, it's about the infrastructure: how to connect, plan & launch jobs, and manage file inputs & outputs. Python, as a high-level and reasonably human-readable language, allows us to focus on the pedagogical goals without getting bogged explaining the language. Fortran achieves its performance because of the fact that it is a low-level language. I could explain the code you submitted to newbies, but I really wouldn't want to unless that was the only teaching goal. Hence my suggestion to partition it into a separate, code-centric, lesson. It's possible we could provide the Fortran version as an alternative episode, so if you know your learners are more familiar with Fortran than they are with Python, you could teach to their strengths. Given the rise of Python over the past decade, I'm not sure how realistic the notion is, but it's not impossible.

There has been a lot of discussion around the curriculum and teaching goals of HPC Intro. We would do well to revisit the over-arching curriculum of our lessons as a whole, and figure out how to smoothly chain from one lesson to the next in building a workshop. Your experience teaching the material is high value, and I look forward to ironing out the designs with you.

@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 18, 2021

Expect to test out:

  • C
  • C++
  • Java
  • Scala
  • Go
  • R
  • Chapel
  • Julia
  • Rust
  • Perl
  • Lua

One can even use map-reduce for this problem, which may be helpful for people using big data frameworks

@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 18, 2021

The aim should be that course participants can choose the language they are most familiar with for execution, with instructor using a common high level explanation.

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

The conventional Carpentries approach is to have the Learners and Instructor typing the same thing, to remain engaged and get used to keystrokes. For an individual following a web tutorial, it could make sense to offer all these options for comfort, but the Carpentries exists because that style of learning is not as effective as a guided tutorial working through common material.

I see that you're passionate about providing options and helping people learn in their preferred languages. Have you received strong feedback from learners that Python is unacceptable?

@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 18, 2021

So we can do an effective test of this, it would be great to add templates for code blocks of

  • language-fortran
  • language-c
  • language-cpp
  • language-java
  • language-scala
  • language-go
  • language-r
  • language-chapel
  • language-julia
  • language-rust
  • language-perl
  • language-lua

Where can these be added?

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

KNOWN_CODEBLOCKS in bin/lesson_check.py

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

Recommend making this WIP Ep. 19, so the "consecutive numbering" check can pass.

@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 18, 2021

Is it possible to have 16 which has Python as default and gives links to other options, or just lists all the possible language options, and then 16-a 16-b etc for other language possibilities?

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

No. Lessons must be numbered consecutively.

@tkphd
Copy link
Contributor

tkphd commented Apr 18, 2021

If you want options, the episode would have to be snippetized.

@tkphd tkphd mentioned this pull request Apr 18, 2021
@reid-a
Copy link
Contributor

reid-a commented Apr 18, 2021

No. Lessons must be numbered consecutively.

Possibly a minor sidebar, but I think lessons can be nonconsecutive since the merger of PR #263 , closing issue #230. Actual nonsequential lessons were never implemented, but it's now a policy question, and not a technical question.

@bkmgit
Copy link
Contributor Author

bkmgit commented Apr 19, 2021

Ok, the snippets option may be good here. Most procedural languages would have a very similar format.

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.

3 participants