Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine...
-
Upload
franklin-rice -
Category
Documents
-
view
218 -
download
0
Transcript of Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine...
![Page 1: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/1.jpg)
Parallelization: Area Under a Curve
![Page 2: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/2.jpg)
AUC: An important task in science
• Neuroscience– Endocrine levels in the body over time
• Economics– Discounting: the fee incurred for delaying a
payment over time• Pharmacokinetics and clinical pharmacology,
machine learning, medicine, psychiatry and psychology, chemistry, environmental science, fisheries and aquatic sciences, and many others
![Page 3: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/3.jpg)
Newton and Leibniz Calculus
• Integration: exact AUC for simple curves• Problems:– Doesn’t work for many curves, even simple ones– Doesn’t work in a reasonable number of steps
• Solution: approximation
![Page 4: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/4.jpg)
Bernhard Riemann’s methods
• Domain of the function is segmented into the widths of shapes (rectangles in this case)
• Height of the rectangle is the y-value of the function for some x-value in the segment
• Sum of the areas of the rectangles is the approximate total area
![Page 5: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/5.jpg)
The left Riemann sum
• Rectangle height = y-value of the left-most x-value of the rectangle width
![Page 6: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/6.jpg)
How do we approximate?
• Small number of rectangles: by hand or calculator
• Beyond a small number of rectangles: single computer
• Even more: parallel processing• More and more: cluster computer
![Page 7: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/7.jpg)
Parallelism
• Concurrency (doing things at the same time)• Multiple flows of execution (virtual entities
that perform computations) working on the same problem
• Distributed Memory• Shared Memory• Hybrid
![Page 8: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/8.jpg)
Flows of execution
• Processes – Distributed memory– Must communicate (message passing)
• Threads– Shared memory
• Processes with threads– Hybrid
![Page 9: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/9.jpg)
Parallel hardware
• Multiple cores on a single compute node– Shared memory
• Multiple compute nodes sharing a network– Distributed memory
• Multiple compute nodes with multiple cores sharing a network– Hybrid
![Page 10: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/10.jpg)
What are some standards?
• Message Passing Interface (MPI) – distributed memory/message passing
• OpenMP – shared memory• MPI/OpenMP - hybrid
![Page 11: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/11.jpg)
How to approach the parallel algorithm
• Identify data structures – constants and variables
• Determine the process and thread locality of the data structures
• Analyze the interactions of the data structures• Lay out the algorithm (a step by step set of
instructions)
![Page 12: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/12.jpg)
Considerations
• Assume hybrid parallelism– Distributed memory, shared memory, or serial can
be refined from hybrid• Hybrid on 1 thread per process is just distributed
memory• Hybrid on 1 process is just shared memory• Hybrid on 1 thread and 1 process is just serial
• The entire code is executed by each process• Threads only execute code for which they are
spawned
![Page 13: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/13.jpg)
How do we visually represent the data structures?
![Page 14: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/14.jpg)
How do we represent the data structures in writing?
![Page 15: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/15.jpg)
What are the scopes of the data structures?
![Page 16: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/16.jpg)
How do the data structures interact?
![Page 17: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/17.jpg)
What is the order of interactions?
![Page 18: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/18.jpg)
How does this look in pseudocode?
![Page 19: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/19.jpg)
MPI functions
![Page 20: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/20.jpg)
MPI_Reduce in more detail
(Fortran only) Store any error codes in this variable
![Page 21: Parallelization: Area Under a Curve. AUC: An important task in science Neuroscience – Endocrine levels in the body over time Economics – Discounting:](https://reader035.fdocuments.us/reader035/viewer/2022062314/56649ea85503460f94babcf3/html5/thumbnails/21.jpg)
OpenMP regions