码迷,mamicode.com
首页 > 其他好文 > 详细

COMP 3450 – Parallel and Distributed Computing

时间:2019-05-26 20:00:53      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:fun   boa   correct   multi   mpi   func   tar   dir   other   


Wentworth Institute of Technology
COMP 3450 – Parallel and Distributed Computing
Summer 2019, Schuster
Lab Assignment 1
In this assignment you are to write a C program that preforms a matrix-vector product:
1. Login to reinhardt via ssh (ssh <yourusername>@reinhardt.cs.wit.edu)
2. Copy the folder named LA1 into your home directory. It is located in /assignments
3. There is one file, mvp-student.c, with “starter” code for you to build on. This will be the only
assignment where I start you with prewritten code.
4. When finished, compile the code according to what we covered in lecture.
5. Even though this is not a parallel code (we’ll do that next week) create a submission script and
submit to the cluster. Only request one node.
6. Include a makefile in your LA1 folder.
7. Write you code in a way that you can compute any size matrix-vector product.
However, I specifically want you to confirm that the following product works correctly:
The output of the matrix-vector program should look like:
2.00 1.00 0.00 0.00 0.00 1.00 3.00
1.00 2.00 1.00 0.00 0.00 1.00 4.00
0.00 1.00 2.00 1.00 0.00 1.00 = 4.00
0.00 0.00 1.00 2.00 1.00 1.00 4.00
0.00 0.00 0.00 1.00 2.00 1.00 3.00
In an effort to make parts of your code reusable in the future, I have provided you with two function
prototypes for the matrix-vector multiplication. However, you are required to include several more

COMP 3450作业代做、代写Technology留学生作业、代做C++语言作业
functions: freeMat, assignMat, assignVec, printMatVec, allocVec, and allocMat.
The prototypes that I’ve given you are different in a subtle way. One takes the matrix as a double** and
the other takes a double*. Confirm that you understand the difference and test that both functions
produce the same output.
Include the appropriate function prototypes, including the one that I gave you, within a header file. To
include your own header, use #include “myheader.h” There is no need to compile header files since
they are passive code. Remember: header files do not contain regular code, only function prototypes (in
our case).
For the writeup that you upload to blackboard, discuss the implementation of the code, specifically about
the two different matvec prototype functions and how the work. Also, talk about how you might perform
this calculation in parallel. Provide some pseudocode if you find it useful and/or discuss what parts of the
code could be parallelized. Think about using both a shared memory system and a distributed memory
system and how their implementation might differ. There isn’t a wrong answer to these questions because
we haven’t covered the topics yet, however, I want you to begin to think about your code from a parallel
perspective.

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:99515681@qq.com 

微信:codinghelp

COMP 3450 – Parallel and Distributed Computing

标签:fun   boa   correct   multi   mpi   func   tar   dir   other   

原文地址:https://www.cnblogs.com/returnjava/p/10927065.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!