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

Feedback after mini-workshop on 2024.09.26 #5

Open
3 tasks
ashwinvis opened this issue Sep 26, 2024 · 3 comments
Open
3 tasks

Feedback after mini-workshop on 2024.09.26 #5

ashwinvis opened this issue Sep 26, 2024 · 3 comments
Assignees

Comments

@ashwinvis
Copy link
Collaborator

ashwinvis commented Sep 26, 2024

Timing notes

  • Opening note on ENCCS can take a few minutes, but I was unprepared.
  • Installation took a good 15 minutes - unsure.
  • Intro and perf. fundamentals episodes took a long time, but more on that later
  • Start to end of profiling episode was around 1 hour 20 minutes.
  • Optimization episode was done quickly without a demo and it still took 15 minutes.
  • Parallelizing was skipped.

Possible improvements

  • Spread theory part (intro and perf. fundamentals) into discussion points along at the end of hands-on episodes. This will allow us to get to the practical aspects quicker and appreciate the context of the theory.

Technical problems

  • Move pip install instruction from footer to the main page along with conda - most learners had either Linux or macOS.
  • Remove mpi4py - we are not using it and installing it with pip requires a working mpi library.
@ashwinvis
Copy link
Collaborator Author

  • Python Tutor demo does not add any value, it can be removed
  • Also in the code, change f.readlines() to f, since using readlines would create a list of the whole file and the latter is an iterator. Otherwise the discussion topic is confusing.
import io

def rms_from_text_file(f):
    """Compute root-mean-square of comma-separated values."""
    rms = 0
    n_samples = 0
    
    for line in f.readlines():
        fields = line.split(",")
        x, y, z = float(fields[0]), float(fields[1]), float(fields[2])
        # compute root-mean-square value
        rms += ((x**2 + y**2 + z**2) / 3) ** 0.5
        n_samples += 1
        
    return rms / n_samples


fake_file = io.StringIO("""\
0.27194615,0.85939776,0.76905204
0.51586611,0.59174447,0.06501842
0.23109192,0.8260391,0.08045166
""")

avg_rms = rms_from_text_file(fake_file)

@ashwinvis
Copy link
Collaborator Author

@ashwinvis
Copy link
Collaborator Author

@ashwinvis ashwinvis self-assigned this Sep 30, 2024
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

No branches or pull requests

1 participant