Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
SciNet
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet
CCDB
Expand all Collapse all
  1. Dashboard
  2. HPC111 - Apr 2025
  3. Area under the curve

Area under the curve

Completion requirements
Opened: Tuesday, 22 April 2025, 12:00 AM
Due: Tuesday, 29 April 2025, 11:59 PM

Consider the Python code `auc_serial.py` for computing the area under the curve \(y=\frac7{10}x^3-2x^2+4\)  from \(x=0\) to \(x=3\).

This code can be run with `python auc_serial 100000000` (100,000,000 is the number of points it will use).

1 Profile the auc_serial.py code

  • Add @profile to the main function.
  • Run this through the line profiler and see what line(s) cause the most cpu usage.
  • Submit the (text) output of the line profiler.

2 Speed up the python code

  • Use either numpy, numexpr, or numba.
  • Submit the improved python code.

The deadline is Tue April 29, 2025 at midnight.

  • auc_serial.py auc_serial.py
    22 April 2025, 7:29 PM
Contact site support
You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle