99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫Shared Memory Particle Simulation

時間:2024-02-18  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



 HW2: Shared Memory Particle Simulation (Extra Credit)
1
HW2: Shared Memory Particle Simulation (Extra Credit)

Attempt 1 Add Comment
Details
Extra Credit Target
Extra Credit (5 points) Target:
LSC [1e3, 1e6] <= 1.20 where LSC = Linear Scaling Coefficient between 1e3 and 1e6 particles.
Due February 15 at 11:59 PM ET no slip day, no late policy.
Overview
This assignment is an introduction to parallel programming using a shared memory model. In this assignment, we will be
parallelizing a toy particle simulation (similar simulations are used in mechanics (http://www.google.com/url?
simulation,
particles interact by repelling one another. A run of our simulation is shown here:
The particles repel one another, but only when closer than a cutoff distance highlighted around one particle in grey.
Asymptotic Complexity
Serial Solution Time Complexity
If we were to naively compute the forces on the particles by iterating through every pair of particles, then we would expect
the asymptotic complexity of our simulation to be O(n^2).
However, in our simulation, we have chosen a density of particles sufficiently low so that with n particles, we expect only O(n)
interactions. An efficient implementation can reach this time complexity. The first part of your assignment will be to
implement this linear time solution in a serial code, given a naive O(n^2) implementation. Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
2
Parallel Speedup
Suppose we have a code that runs in time T = O(n) on a single processor. Then we'd hope to run close to time T/p when
using p processors. After implementing an efficient serial O(n) solution, you will attempt to reach this speedup using OpenMP.
Due Date: Friday, February 24th 2023 at 11:59 PM
Instructions
Teams
Note that you will work individually for this assignment.

Getting Set Up
The starter code is available in the course Github repo and should work out
of the box. To get started, we recommend you log in to Perlmutter and download the first part of the assignment. This will
look something like the following:

CMakeLists.txt common.h job-openmp job-serial main.cpp openmp.cpp serial.cpp
There are five files in the base repository. Their purposes are as follows:
CMakeLists.txt
The build system that manages compiling your code.
main.cpp
A driver program that runs your code.
common.h
A header file with shared declarations
job-openmp
A sample job script to run the OpenMP executable
job-serial
A sample job script to run the serial executable
serial.cpp - - - You may modify this file.
A simple O(n^2) particle simulation algorithm. It is your job to write an O(n) serial algorithm within the simulate_one_step
function.
openmp.cpp - - - You may modify this file.
A skeleton file where you will implement your openmp simulation algorithm. It is your job to write an algorithm within the
simulate_one_step function.
Please do not modify any of the files besides serial.cpp and openmp.cpp.
Building our Code Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
3
First, we need to make sure that the CMake module is loaded.
student@login04:~/hw2> module load cmake
You should put the above command in your ~/.bash_profile file to avoid typing them every time you log in.
Next, let's build the code. CMake prefers out of tree builds, so we start by creating a build directory.
student@login04:~/hw2> mkdir build
student@login04:~/hw2> cd build
student@login04:~/hw2/build>
Next, we have to configure our build. We can either build our code in Debug mode or Release mode. In debug mode,
optimizations are disabled and debug symbols are embedded in the binary for easier debugging with GDB. In release mode,
optimizations are enabled, and debug symbols are omitted. For example:
student@login04:~/hw2/build> cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 11.2.0
...
-- Configuring done
-- Generating done
-- Build files have been written to: /global/homes/s/student/hw2/build
Once our build is configured, we may actually execute the build:
student@login04:~/hw2/build> make
Scanning dependencies of target serial
[ 16%] Building CXX object CMakeFiles/serial.dir/main.cpp.o
[ 33%] Building CXX object CMakeFiles/serial.dir/serial.cpp.o
[ 50%] Linking CXX executable serial
[ 50%] Built target serial
Scanning dependencies of target openmp
[ 66%] Building CXX object CMakeFiles/openmp.dir/main.cpp.o
[ 83%] Building CXX object CMakeFiles/openmp.dir/openmp.cpp.o
[100%] Linking CXX executable openmp
[100%] Built target openmp
student@login04:~/hw2/build> ls
CMakeCache.txt CMakeFiles cmake_install.cmake Makefile openmp serial job-openmp job-serial
We now have two binaries (openmp and serial) and two job scripts (job-openmp and job-serial).
For info on running jobs and editing the code, refer to the HW1 page.
Running the Program
Both executables have the same command line interface. Without losing generality, we discuss how to operate the serial
program here. Here's how to allocate an interactive node and run your program (warning: do not run on the login nodes.
The benchmark will yield an incorrect result, and you will slow system performance for all users).
student@login04:~/hw2> salloc -N 1 -q interactive -t 01:00:00 --constraint cpu --account=m4341
salloc: Granted job allocation 53**46**
salloc: Waiting for resource configuration
salloc: Nodes nid02346 are ready for job
:~/hw2> cd build Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
4
:~/hw2/build> ./serial
Simulation Time = 1.4**77 seconds for 1000 particles.
You can also run the program using the batch scripts that you provide. By default, the program runs with 1000 particles. The
number of particles can be changed with the "-n" command line parameter:
:~/hw2/build> ./serial -n 10000
Simulation Time = 195.029 seconds for 10000 particles.
If we rerun the program, the initial positions and velocities of the particles will be randomized because the particle seed is
unspecified. By default, the particle seed will be unspecified; this can be changed with the "-s" command line parameter:
:~/hw2/build> ./serial -s 150
Simulation Time = 1.45459 seconds for 1000 particles.
This will set the particle seed to 150 which initializes the particles in a reproducible way. We will test the correctness of your
code by randomly selecting several particle seeds and ensuring the particle positions are correct when printed with the "-o"
command line parameter. You can print the particle positions to a file specified with the "-o" parameter:
:~/hw2/build> ./serial -o serial.parts.out
Simulation Time = 1.78357 seconds for 1000 particles.
This will create a serial.parts.out file with the particle positions after each step listed. You can use the hw2-rendering tool to
convert this into a .gif file of your particles. See the below section on Rendering Output for more information.
You can use the "-h" command line parameter to print the help menu summarizing the parameter options:
:~/hw2/build> ./serial -h
Options:
-h: see this help
-n <int>: set number of particles
-o <filename>: set the output file name
-s <int>: set particle initialization seed
Important notes for Performance:
There will be two types of scaling that are tested for your parallel codes:
In strong scaling we keep the problem size constant but increase the number of processors
In weak scaling we increase the problem size proportionally to the number of processors so the work/processor stays the
same (Note that for the purposes of this assignment we will assume a linear scaling between work and processors)
While the scripts we are providing have small numbers of particles 1000 to allow for the O(n ) algorithm to finish execution,
the final codes should be tested with values much larger (50000-1000000) to better see their performance.
Grading
We will grade your assignment by reviewing your assignment write-up, measuring the scaling of both the openmp and serial
implementations, and benchmarking your code's raw performance. To benchmark your code, we will compile it with the
exact process detailed above, with the GNU compiler. We will run your submissions on Perlmutter's CPU processors.
There are usually some groups every year who come up with faster methods to compute the particle repulsion force function
(i.e. rearranging the arithmetic, changing the formula, or using some fancy instructions). This is great, but small differences in
the floating point position values begin to add up until the simulation output diverges from our ground truth (even though your
2
Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
5
method of computation might be more accurate than ours). Since (a) the point of the assignment is to explore OpenMP
parallelism, and (b) we can't anticipate every possible way to compute this force function, here is the rule: if it doesn't pass
the correctness check we provide you reliably, then it's not allowed.
Submission Details (Similar to HW1)
1. Make sure you have our most updated source code on your Permultter machine. We have updated the CMake file for this
submission.
2. Make sure you have only modified the file serial.cpp and openmp.cpp, and it compiles and runs as desired.
3. Get your groupd ID, same as HW1. On Cavas, under the "People" section, there is a hw1 tab. Click on the tab and you'll
see canvas has assigned a group id to each of you individually. Use the search bar to enter your name and find your group id.
Treat it as a two digit number. (If you are group 4, your group id is "04").
4. Ensure that your write-up pdf is located in your source directory, next to serial.cpp It should be
named CS5220Group04_hw2.pdf.
5. From your build directory, run:
student@perlmutter:~/hw2/build> cmake -DGROUP_NO=04 ..
student@perlmutter:~/hw2/build> make package
This second command will fail if the PDF is not present.
6. Confirm that it worked using the following command. You should see output like:
student@perlmutter:~/hw2/build> tar tfz CS5220Group04_hw2.tar.gz
CS5220Group04_hw2/CS5220Group04_hw2.pdf
CS5220Group04_hw2/serial.cpp
CS5220Group04_hw2/openmp.cpp
7. Download and submit your .tar.gz through canvas.
Writeup Details
Your write-up should contain:
your name, cornell id (NetID), and perlmutter username,
A plot in log-log scale that shows that your serial and parallel codes run in O(n) time and a description of the data
structures that you used to achieve it.
A description of the synchronization you used in the shared memory implementation.
A description of the design choices that you tried and how did they affect the performance.
Speedup plots that show how closely your OpenMP code approaches the idealized p-times speedup and a discussion on
whether it is possible to do better.
Where does the time go? Consider breaking down the runtime into computation time, synchronization time and/or
communication time. How do they scale with p?
Notes:
Your grade will mostly depend on three factors:
Scaling sustained by your codes on the Perlmutter supercomputer (varying n).
Performance sustained by your codes on the Perlmutter supercomputer.
Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
6
Explanations of your methodologies and the performance features you observed (including what didn't work).
You must use the GNU C Compiler for this assignment. If your code does not compile and run with GCC, it will not be
graded.
If your code produces incorrect results, it will not be graded.
Rendering Output
The output files that are produced from running the program with the "-o" command line parameter can be fed into the hw2-
rendering tool made available to convert them into .gif files. These animations will be a useful tool in debugging. To get
started clone the hw2-rendering repo:
student@login04:~> git clone git@github.com:CS5220-SP23/HW2_rendering.git
This tool uses python. This can be loaded on Perlmutter with the following command:
student@login04:~> module load python
We can then convert the output files to gifs with the following command: make sure to allocate an interactive node first!
student@login04:~/hw2/build> ~/HW2_rendering/render.py serial.parts.out particles.gif 0.01
Here serial.parts.out is an output file from the "-o" command line parameter. You should find a particles.gif file in your
directory. The number 0.01 is the cutoff distance (will be drawn around each particle).
Output Correctness
The output files that are produced from running the program with the "-o" command line parameter can be fed into the hw2-
correctness tool made available to perform a correctness check. This is the same correctness check we will be performing
when grading the homework, however, we will randomly select the particle seeds. To get started clone the hw2-correctness
repo:
student@login04:~> git clone git@github.com:CS5220-SP23/HW2_correctness.git
This tool uses python. This can be loaded on Perlmutter with the following command:
student@login04:~> module load python
We can then test the output files for correctness with the following command: make sure to allocate an interactive node
first!
:~/hw2/build> ~/HW2_correctness/correctness-check.py serial.parts.out correct.parts.out
If the program prints an error, then your output is incorrect. Here serial.parts.out is an output file from the "-o" command line
parameter from your code. This can be substituted for any output you wish to test the correctness for. The correct.parts.out
can be generated from the provided O(n^2) serial implementation. Remember to specify a particle seed with "-s" to ensure
the same problem is solved between the two output files. The hw2-correctness repo provides the "verf.out" file which is the
correct output with particle seed set to 1 "-s 1".
Resources
Programming in shared and distributed memory models are introduced in Lectures.
Shared memory implementations may require using locks that are available as omp_lock_t (http://www.google.com/url?
q=http%3A%2F%2Fmsdn.microsoft.com%2Fen?Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)

If you are using TAU or HPCToolkit you should run in your $SCRATCH directory which has faster disk access to the
compute nodes (profilers can generate big profile files).
Upload More
Submit Assignment
 HW2: Shared Memory Particle Simulation (Extra Credit)
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機打開當前頁
  • 上一篇:代寫Assignment 3 Description Jack Compiler
  • 下一篇:代寫Business Decision Analytics
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                国产精品麻豆网站| 欧美大片顶级少妇| 国产亚洲精品超碰| 福利视频网站一区二区三区| 久久久精品日韩欧美| 亚洲人123区| 国产电影精品久久禁18| 久久久精品免费观看| 国产成人无遮挡在线视频| 国产午夜亚洲精品午夜鲁丝片| 国产乱码精品一区二区三| 久久精品视频在线看| 亚洲视频在线观看一区| 在线观看成人小视频| 亚洲色欲色欲www| 成人午夜精品一区二区三区| 一区二区三区欧美视频| 97成人超碰视| 激情久久久久久久久久久久久久久久| 久久综合九色综合欧美98| 欧美影院一区二区三区| 亚洲成a人v欧美综合天堂| 欧美成人女星排行榜| 国产精品一区在线观看你懂的| 国产精品区一区二区三| 韩国欧美国产1区| 精品国产乱码久久久久久免费| 韩国v欧美v日本v亚洲v| 国产精品福利在线播放| 欧美一区二区三区免费视频| 国产麻豆精品在线| 欧美理论在线播放| 国产伦精品一区二区三区免费迷| 自拍视频在线观看一区二区| 91福利在线免费观看| 极品少妇xxxx精品少妇| 国产亚洲精品中文字幕| 欧美日韩极品在线观看一区| 国产露脸91国语对白| 香蕉成人啪国产精品视频综合网| 久久蜜桃一区二区| 欧美午夜精品理论片a级按摩| 国内成人自拍视频| 亚洲一区二区三区四区在线 | 国产三级久久久| 91色在线porny| 三级久久三级久久久| 国产色婷婷亚洲99精品小说| 成人app下载| 亚洲欧洲另类国产综合| 欧美一区二区视频在线观看2020| 国产乱人伦偷精品视频不卡| 国产精品乱码人人做人人爱| 色吊一区二区三区| 亚洲综合999| 国产香蕉久久精品综合网| 欧美一区二区视频在线观看| 在线观看视频一区二区| 久久99精品久久久久婷婷| 亚洲制服欧美中文字幕中文字幕| 久久九九99视频| 欧美成人aa大片| 欧美精品乱码久久久久久按摩| 色综合中文字幕国产| 蜜桃传媒麻豆第一区在线观看| 亚洲精品乱码久久久久久黑人 | 日韩美女视频19| 久久亚洲春色中文字幕久久久| av电影在线观看不卡| 免费看欧美女人艹b| 亚洲欧洲成人自拍| 国产一区二区三区在线观看免费| 丝袜国产日韩另类美女| 亚洲激情一二三区| 亚洲视频免费在线观看| 国产精品污污网站在线观看 | 亚洲精品久久久蜜桃| 欧美美女网站色| 欧美午夜免费电影| 欧美在线观看视频一区二区| 国产福利精品导航| 视频一区国产视频| 五月婷婷久久综合| 婷婷激情综合网| 亚洲男人天堂av网| 最新国产の精品合集bt伙计| 欧美一区二区福利在线| 9191成人精品久久| 精品视频色一区| 在线亚洲一区观看| 欧美在线免费观看亚洲| 成人av动漫在线| 99re视频精品| 欧美综合一区二区三区| 成人av电影在线观看| 精品亚洲成av人在线观看| 精品视频1区2区3区| 欧美日韩激情在线| 99国内精品久久| 91原创在线视频| 欧美无人高清视频在线观看| 岛国av在线一区| 成人av电影观看| 欧美专区亚洲专区| 91精品国产福利在线观看| 欧美sm美女调教| 亚洲一二三四区不卡| av一区二区久久| 成人亚洲一区二区一| 91网站最新网址| 欧美日韩国产综合一区二区三区| 欧美日韩一二三| 久久中文字幕电影| 中文字幕一区二区日韩精品绯色| 亚洲一区二区三区三| 性欧美疯狂xxxxbbbb| 老司机一区二区| 精品一区二区三区影院在线午夜| 欧美精品一区二区三区很污很色的 | 国产欧美久久久精品影院| 日韩一区二区三区四区 | 精品区一区二区| 国产精品久久久久久久久图文区| 一区二区三区日韩精品视频| 精品一区二区三区免费观看| 天堂一区二区在线| 三级久久三级久久久| 日韩电影在线观看电影| 色一区在线观看| 精品久久一二三区| 欧美精品一区二区三区蜜桃| 亚洲精品一卡二卡| 精品一区二区免费看| 91色九色蝌蚪| 精品国产一区a| 欧美一区三区四区| 国产精品国模大尺度视频| 免费成人在线网站| 99精品视频在线观看| 日韩欧美国产电影| 亚洲黄色免费电影| 国产精品亚洲成人| 国产精品1024久久| 555www色欧美视频| 亚洲同性同志一二三专区| 一区二区三区色| 免费成人在线影院| 色哟哟亚洲精品| 国产三级三级三级精品8ⅰ区| 国产精品久久久一本精品| 日本aⅴ亚洲精品中文乱码| 一本到高清视频免费精品| 国产日韩成人精品| 麻豆精品视频在线| 欧美欧美欧美欧美首页| 亚洲欧美成人一区二区三区| 日本亚洲三级在线| 色国产综合视频| 国产精品久久久久一区二区三区| 麻豆传媒一区二区三区| 在线免费观看日本欧美| 欧美人体做爰大胆视频| 亚洲精品久久7777| 91色在线porny| 国产精品你懂的在线欣赏| 国产精品一区二区在线播放| 欧美日韩成人综合| 国产精品久久久久久久久免费樱桃 | 欧美不卡在线视频| 日本美女一区二区| 99国产精品国产精品毛片| 久久伊人中文字幕| 国产在线视频一区二区| 7777精品伊人久久久大香线蕉的 | 欧美影片第一页| 中文字幕不卡在线| 激情丁香综合五月| 精品成人a区在线观看| 日韩电影网1区2区| 欧美精品日韩精品| 最新热久久免费视频| 精品一区二区三区免费毛片爱 | 亚洲视频一区二区在线观看| 99久久99久久综合| 亚洲色图制服诱惑 | 亚洲欧美一区二区在线观看| 成人精品鲁一区一区二区| 国产午夜精品久久久久久免费视| 水蜜桃久久夜色精品一区的特点| 91免费版pro下载短视频| 久久综合给合久久狠狠狠97色69| 亚洲bt欧美bt精品| 色哟哟国产精品免费观看| 国产精品天干天干在线综合| 国产精品一区二区免费不卡| 日韩欧美美女一区二区三区| 亚洲一区成人在线| 欧美一级搡bbbb搡bbbb| 国产精品自产自拍| 国产精品三级电影|