CMDA 3634 SP2021
作者:互联网
CMDA 3634 SP2021使用OpenMP Project 03并行化波动方程
项目03:使用OpenMP并行化波动方程
版本:当前截至:2021-03-22 14:30:01
到期的:
–准备:2021-03-30 23:59:00
–编码和分析:2021-04-09 23:59:00(24小时宽限期适用于该截止日期。)
积分:100
可交付成果:
–准备工作以PDF格式进行,通过Canvas用LaTeX排版。
–通过code.vt.edu的所有代码,包括所有LaTeX源代码。
–通过Canvas使用LaTeX排版的PDF项目报告和分析。
合作:
–此任务由您自己完成。
–对于此作业的概念性方面,您可以寻求同学的帮助。在您的提交中
您必须指出您是从谁那里得到帮助的。
–在编程,代码设计或
派生。
–如果不确定,请询问课程工作人员。
荣誉代码:提交此作业,即表示您承认自己已遵守弗吉尼亚理工大学
荣誉代码并证明以下内容:
在这项任务上,我既没有给予也没有得到未经授权的帮助。我正在介绍的工作
最终是我自己的。
参考
Is Ising模型:
– Heermann和Burkitt撰写的“计算科学中的并行算法”第2.6节
on在VT Library网站https://link-springer-com.ezproxy.lib.vt.edu/上免费提供
书/10.1007%2F978-3-642-76265-9
❼OpenMP:
–通用教程https://computing.llnl.gov/tutorials/openMP/
–参考书https://mitpress.mit.edu/books/using-openmp
–时间https://gcc.gnu.org/onlinedocs/gcc-4.5.0/libgomp/omp_005fget_005fwtime.html
–一般讨论https://pages.tacc.utexas.edu/~eijkhout/pcse/html/(14-26)
1个
CMDA 3634 SP2021使用OpenMP Project 03并行化波动方程
代码环境
❼必须将所有必需的代码放入类Git存储库中。
❼使用以前项目中的标准目录结构。
experiments所有实验都将在TinkerCliffs上进行。您可以在虚拟机中开发,也可以直接在TinkerCliffs上开发。
❼成为ARC的好公民。使用您请求的资源。将您的暂存空间用于大数据。
the材料存储库中提供了针对Project 2的代码解决方案。
to重新创建数据所需的任何脚本都必须在数据目录中。
不要包含视频文件或大量图像文件,也不要包含在您的视频文件中
GIT存放区!
❼您用于项目准备和最终报告的tex源位于报告目录中。
❼请记住:提早提交,经常提交,在较小更改后提交,在重大更改后提交。推
经常将您的代码添加到code.vt.edu。
❼您必须分开标题,源和应用程序。
must您必须包含一个makefile。
must您必须包含一个自述文件,说明如何构建和运行程序。
2个
CMDA 3634 SP2021使用OpenMP Project 03并行化波动方程
要求
准备(20%)
1.编写完成该项目的工作计划。您还应该查看编码和分析部分
作为从现在到到期日期之间的剩余分配时间表。要正确回答这个问题,您
将需要一些时间并仔细考虑剩余的作业。质量答案应该
至少需要一页详细信息的一半。
您的工作计划应包括:
❼简要评估您的项目2计划的有效性。您的新计划应考虑到
记下您从上一个项目中学到的工作风格。
❼说明您认为完成必要任务所必需的步骤,计划的方式
测试这些任务,并估算每个任务所需的时间。
❼ARC资源需求的账目。您将需要提交一些批处理作业到
TinkerCliffs(而不是交互式作业)来获取数据。
you您认为任何其他信息对帮助您完成作业都将是有用的。
2. cmda3634资料存储库中提供了针对项目2的解决方案。查看此解决方案,然后
将其与您提交的内容进行比较。至少给出三(3)个具体的项目要点,以描述以下方面的差异:
实施和总体设计。代做CMDA 3634程序实验、代写c++,java编程设计
您应该考虑通过比较而学到的东西,不同的后果
设计决策,以及如何看待不同的解决方案可能会影响您的未来方法。你应该
考虑一下结构,样式和语法方面。
但是,请尽量不要完全专注于细微的逐行决策,也不要完全专注于大型决策。
设计决策。记住,做事有不止一种方法,只是因为我做某事
方式,并不代表您的想法一定是错误的。这个问题的目的是让您学习其他方式
考虑一下程序设计,而无需查看大量代码就无法做到。
3.在OpenMP的背景下,我们在波动方程的仿真中哪里可以找到并行性?\
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
Project 03: Parallelizing the Wave Equation with OpenMP
Version: Current as of: 2021-03-22 14:30:01
Due:
– Preparation: 2021-03-30 23:59:00
– Coding & Analysis: 2021-04-09 23:59:00 (24 hour grace period applies to this due date.)
Points: 100
Deliverables:
– Preparation work as a PDF, typeset with LaTeX, through Canvas.
– All code through code.vt.edu, including all LaTeX source.
– Project report and analysis as a PDF, typeset with LaTeX, through Canvas.
Collaboration:
– This assignment is to be completed by yourself.
– For conceptual aspects of this assignment, you may seek assistance from your classmates. In your submission
you must indicate from whom you received assistance.
– You may not assist or seek assistance from your classmates on matters of programming, code design, or
derivations.
– If you are unsure, ask course staff.
Honor Code: By submitting this assignment, you acknowledge that you have adhered to the Virginia Tech
Honor Code and attest to the following:
I have neither given nor received unauthorized assistance on this assignment. The work I am presenting
is ultimately my own.
References
❼ The Ising model:
– Section 2.6 of “Parallel Algorithms in Computational Science” by Heermann and Burkitt
✯ Available for free on VT Library site https://link-springer-com.ezproxy.lib.vt.edu/
book/10.1007%2F978-3-642-76265-9
❼ OpenMP:
– General tutorial https://computing.llnl.gov/tutorials/openMP/
– Reference Book https://mitpress.mit.edu/books/using-openmp
– Timing https://gcc.gnu.org/onlinedocs/gcc-4.5.0/libgomp/omp_005fget_005fwtime.html
– General discussion https://pages.tacc.utexas.edu/~eijkhout/pcse/html/ (14-26)
1
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
Code Environment
❼ All necessary code must be put in your class Git repository.
❼ Use the standard directory structure from previous projects.
❼ All experiments will be run on TinkerCliffs. You may develop in your VMs or directly on TinkerCliffs.
❼ Be an ARC good citizen. Use the resources you request. Use your scratch space for large data.
❼ A code solution to Project 2 has been provided in the materials repository.
❼ Any scripts which are necessary to recreate your data must be in the data directory.
DO NOT INCLUDE VIDEO FILES OR LARGE NUMBERS OF IMAGE FILES OR IN YOUR
GIT REPOSITORY!
❼ Your tex source for project preparation and final report go in the report directory.
❼ Remember: commit early, commit often, commit after minor changes, commit after major changes. Push
your code to code.vt.edu frequently.
❼ You must separate headers, source, and applications.
❼ You must include a makefile.
❼ You must include a README explaining how to build and run your programs.
2
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
Requirements
Preparation (20%)
1. Write a work plan for completing this project. You should review the coding and analysis sections, as well
as the remaining assignment schedule between now and the due date. To properly answer this question, you
will need to take some time and think through the remainder of the assignment. A quality answer should
require at least half of a page of detail.
Your work plan should include:
❼ A brief assessment of the effectiveness of your plan for Project 2. Your new plan should take into
account what you learned about your working style from the last project.
❼ A description of the steps you think will be necessary to complete the required tasks, how you plan to
test those tasks, and an estimate of the time that each task will take.
❼ An a accounting of the ARC resource requirements. You will need to submit some batch jobs to
TinkerCliffs (rather than interactive jobs) to get data.
❼ Any other information you think will be useful to help you work through the assignment.
2. A solution to Project 2 has been provided in the cmda3634 materials repository. Review this solution and
compare it to the one you submitted. Give at least three (3) specific bullet points describing differences in
implementation and overall design.
You should consider things that you learned by making the comparison, what the consequences of different
design decisions are, and how seeing a different solution may influence your future approach. You should
consider aspects of structure, style, and syntax.
However, try not to focus entirely on small, line-by-line, decisions and try not to focus entirely on large-scale
design decisions. Remember, there is more than one way to do things and just because I do things one
way, doesn’t mean yours is necessarily wrong. The purpose of this question is for you to learn other ways
to think about program design, which you cannot do without looking at a lot of code.
3. In the context of OpenMP, where might we find parallelism in our simulation of the wave equation?
2. (1)
Give a pseudo-code function for an algorithm for computing the norm of the error between two solutions to
the wave equation. We can define the pointwise error as,
e(x, y) = usimulated(x, y) − utrue(x, y). (2)
The inputs to the function should be the two solutions usimulated and utrue. You may add other inputs if it
helps.
5. Design a weak scalability study for the case where n = nx = ny. Let P be the number of cores (processors),
wP be the amount of work on P cores, and nP be the problem size leading to that work load.
(a) What is the difference between a strong scalability study and a weak scalability study?
(b) For a single iteration of the wave equation simulation:
i. Give an approximate expression for wP , in terms of nP . Here are a few hints:
The expressions depend on total number of grid points.
Asymptotically, n − 1 and n − 2 are the same as n.
“Work” is constant for each grid point.
3
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
ii. In terms of P and w1, give an expression for wP , the amount of work needed for P processors in
a weak scalability study.
iii. In terms of n1 and P, what is nP , the dimension of the problem needed for P processors in a
weak scalability study?
iv. If n1 = nx = ny = 2501, what is n2? n4? n8? n16? n32? n64?
4
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
Coding (50%)
For the coding portion of this assignment, you have a choice: you may start your implementation of this project
from your submitted solution or from the provided solution.
The source code for your solution is to be submitted via GitLab.
This project is to be written in the C language, using OpenMP.
You must include a Makefile in your code directory. This makefile should include targets for each executable
you are required to produce, a target to compile all executables, and a clean target to remove intermediate
build files and executables.
You must include a readme file, explaining how compile and run your code.
Hint: If you do not want to hardcode the number of OpenMP threads (or if you do not want to take them as
a command-line argument), you can run your programs by setting the thread count as an environment variable.
For example, the following command runs the program for 4 threads:
> OMP NUM THREADS=4 ./my program arg1 arg2
You can also use this style in experiment scripts.
Tasks:
1. Modify your makefile to enable compilation with OpenMP.
2. Use OpenMP to parallelize your function that evaluates the standing wave solution on a grid.
3. Use OpenMP to parallelize your function that computes one iteration of the wave equation simulation.
4. Implement a function which computes the norm of the error of two wave equation solutions. This function
should be parallelized with OpenMP.
5. Write a program that computes the time history of the error between the simulated solution and the true
solution (given by your function for evaluating the standing wave solution). There should be one error value
for each time-step. You may output the time sequence however you want, but keep in mind that you may
need to output very long sequences. This program should take n, mx, my, α, and T as arguments. Update
your makefile to include this program.
6. Update your timing and image output programs:
Make any necessary changes to use of your parallelized routines.
Convert your timing functionality to use the OpenMP timing functions.
Update your program arguments to take nt, the number of time steps to run as an argument in place
of the final run-time T.
7. Write SLURM submission scripts for generating the required results for the analysis section. You may create
more than one script!
5
CMDA 3634 SP2021 Parallelizing the Wave Equation with OpenMP Project 03
Analysis (30%)
Your report for this project will be submitted via Canvas. Tex source, images, and final PDFs should be
included in your Git repositories.
All timings and analysis should be from experiments on TinkerCliffs.
I suggest that you run each of the experiments as separate jobs on TinkerCliffs. Use the early experiments
to estimate how long the later ones might take.
Unless otherwise specified, use α = 1, mx = 13, and my = 7.
You should assume that n = nx = ny.
Tasks:
1. Run a strong scalability study for n = 2501, nt = 8838, and P = 1, 2, 4, 8, 16, 32, and 64 for your wave
equation simulation. (nt = 8, 838 corresponds roughly to T = 2.5 at this resolution.)
(a) You should run a small number of trials per experiment.
(b) Create plots of both the run-times and speedup. Remember, these are a function of P.
(c) Does this problem good strong scalability? Justify your claim and explain why you think you observe
this behavior.
2. Run a weak scalability study for n1 = 2501 (for P = 1), nt = 250, and P = 1, 2, 4, 8, 16, 32, and 64
for your wave equation simulation. Use your values for nP developed in the preparation phase. (We will
provide correct values for this.)
(a) You should run a small number of trials per experiment.
(b) Create plots of both the run-times and speedup. Remember, these are a function of P.
(c) Does this problem good weak scalability? Justify your claim and explain why you think you observe
this behavior.
3. For P = 64 (the total cores on one processor of TinkerCliffs) and P = 128 (the total number of cores
on 1 node of TinkerCliffs), time the execution of nt = 100 iterations of your Monte Carlo simulator for
n = 301, 501, 1001, 2501, 5001, 10, 001, and 25, 001.
Plot your results as a function of N = nx × ny. On separate lines on the plot, include your results
from Projects 1 and 2. You may either re-run the experiments from Project 1 and 2 for 100 iterations
or rescale the results so that they are equivalent to 100 iterations.
Estimate how long it will take to run 100 iterations at n = 100, 000 for P = 64 and P = 128.
How do the times and estimates compare to those from the serial Python and serial C experiments?
4. For n = 5001, include images from time-steps 100, 500, and 1000.
You may use as many OpenMP threads as is reasonable to create these images. Report how many
you chose.
5. Use your program for generating the time history of the error to measure the error for n = 301, 1001, and
2501 for T = 2.5. Plot your results. What trends do you see? Why do you think the error oscillates the
way it does?
You may use as many OpenMP threads as is reasonable to obtain this data. Report how many you
chose.
请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp
标签:code,run,3634,SP2021,your,Project,OpenMP,should,CMDA 来源: https://www.cnblogs.com/lhafjava/p/14603589.html