国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫Shared Memory Particle Simulation

時間:2024-02-18  來源:合肥網(wǎng)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
  • 下一篇:代寫B(tài)usiness Decision Analytics
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁版入口 wps 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久久综合香蕉尹人综合网| 久草精品电影| 天天久久人人| 亚洲一区二区三区av无码| 色综合久久久久久中文网| 久久国产天堂福利天堂| 欧美极品在线播放| 亚洲综合中文字幕在线| 亚洲欧美成人一区| 色播亚洲视频在线观看| 日本精品视频在线播放| 日韩欧美不卡在线| 精品日本一区二区| 免费在线黄网站| 欧美精品一区免费| 蜜桃在线一区二区三区精品| 国产在线一区二区三区| 国产情侣第一页| 国产精品永久免费观看| 91精品久久久久久久久久久久久| 久久久伊人日本| 久久久久久久一| 国产精品免费视频久久久| 国产精品成人免费电影| 欧美激情18p| 日本最新一区二区三区视频观看| 人偷久久久久久久偷女厕 | 日日噜噜噜夜夜爽爽| 日本免费在线精品| 激情综合网俺也去| 成人在线国产精品| 久久久久久久亚洲精品| 精品国产无码在线| 日本一区二区三区在线视频| 免费看国产一级片| 久久伊人一区| 精品久久蜜桃| 日韩欧美精品久久| 分分操这里只有精品| 九九九九九九精品| 中文字幕人妻熟女人妻洋洋| 日韩欧美精品久久| 国产欧美久久久久| 久久草视频在线看| 欧美激情中文字幕在线| 日韩久久久久久久久久久久| 国产伦精品一区二区三区视频免费| 77777亚洲午夜久久多人| 国产精品视频精品| 欧美一区二区三区综合 | 欧美牲交a欧美牲交aⅴ免费真| 国产日产久久高清欧美一区| 日韩有码在线视频| 亚洲字幕在线观看| 麻豆成人av| 久久久久久久免费视频| 一区二区三区欧美在线| 狠狠色噜噜狠狠狠狠色吗综合| 久久欧美在线电影| 中文字幕精品在线播放| 蜜桃传媒视频第一区入口在线看 | 91麻豆精品秘密入口| 国产精品第一区| 欧洲午夜精品久久久| 国产精品18毛片一区二区| 国产精品高清在线观看| 日本视频精品一区| 91国产中文字幕| 久久97久久97精品免视看| 欧美性视频在线播放| 久久久亚洲网站| 中文字幕久久综合| 国产美女在线一区| 久久视频精品在线| 日韩精品无码一区二区三区免费 | 精品久久久无码人妻字幂| 欧美亚洲一级片| 久久国产精品久久| 日韩一级片播放| 97欧美精品一区二区三区| 九九热视频这里只有精品| 加勒比在线一区二区三区观看| 91精品国产高清久久久久久91| 一区二区三区四区视频在线观看| 国产一区二区在线免费视频| 国产精品视频1区| 欧美精品一区二区三区久久| 色妞一区二区三区| 奇米四色中文综合久久| 久久久久久久激情| 欧美又大粗又爽又黄大片视频| 久久国产精品久久精品国产| 日韩欧美亚洲日产国产| www.午夜精品| 精品1区2区| 欧美日韩国产成人在线| 国产精品一区二区久久国产| 久久99久久久久久久噜噜| 亚洲最大福利网站| 久久久婷婷一区二区三区不卡 | 欧美第一黄网| 久久久com| 日韩精品一区二区免费| 久久精品成人欧美大片| 麻豆av一区二区三区久久| 欧美成人在线免费| 日韩av电影免费播放| 久久久久久伊人| 男女超爽视频免费播放| 国产精品久久久久久久久久三级| 国产一级不卡视频| 正在播放国产精品| 久久免费视频在线| 欧美日韩精品免费看| 欧美成人精品在线播放| 99精品国产高清一区二区| 日韩av大片在线| www.日韩.com| 国产精品中文字幕在线观看| 午夜精品美女自拍福到在线| 色老头一区二区三区在线观看| 国产一级不卡毛片| 日韩一区二区三区资源| 久久久精品日本| 国产日韩一区在线| 无码少妇一区二区三区芒果| 久久精品视频在线观看| 成人免费毛片在线观看| 欧美综合在线观看| 蜜月aⅴ免费一区二区三区| 久久琪琪电影院| 国产在线98福利播放视频| 五月天婷亚洲天综合网鲁鲁鲁| 国产精品无码专区av在线播放| 国产欧亚日韩视频| 日韩精品一区在线视频| 在线观看成人一级片| 日韩最新av在线| www.av一区视频| 热re99久久精品国99热蜜月| 欧美成人亚洲成人日韩成人| 九九九九免费视频| 成 年 人 黄 色 大 片大 全| 欧美日韩免费精品| 无码人妻丰满熟妇区96| 国产精品成人品| 久久久久久久中文| 99精品国产高清在线观看| 精品欧美一区二区三区久久久 | 久久国产精品高清| 国产精品成人av性教育| 一区二区精品在线观看| 日韩精品一区二区三区外面| 综合操久久久| 欧美精品情趣视频| 国产成人三级视频| 国产成人亚洲综合青青| www.日日操| 国产私拍一区| 欧美交换配乱吟粗大25p| 欧美一级淫片播放口| 亚洲一区不卡在线| 欧美成人精品一区二区三区| 日韩在线欧美在线国产在线| 国产精品99久久免费黑人人妻| 国产一区二区在线观看免费播放| 欧美日韩国产不卡在线看| 日韩亚洲一区在线播放| 亚洲日本精品一区| 久久夜色精品国产欧美乱| 国产精品视频免费观看| 久久久av网站| 视频直播国产精品| 国产成人精品免高潮费视频 | 视频在线一区二区| 91精品国产综合久久久久久久久| 国产深夜精品福利| 精品视频一区二区在线| 国内自拍中文字幕| 黄色免费高清视频| 蜜臀av性久久久久蜜臀av| 美日韩精品免费| 美女一区视频| 国产原创精品| 国产女人水真多18毛片18精品| 国产又粗又猛又爽又黄的网站 | 日韩视频免费大全中文字幕| 久久精品欧美| 久久人人爽人人爽人人片av高请| 99国内精品久久久久久久软件| 成人精品在线视频| 91成人免费观看网站| 久久久久se| 日韩在线视频观看| 国产精品无码专区av在线播放| 国产精品久久在线观看| 欧美精品一二区| 中文字幕人成一区| 亚洲xxxx在线| 青青青在线视频播放|