OPTION A: Part 01: Please download the attachment ‘MPI 01.tar.gz’ (Attached the file) and complete the following questions. Q1: Understand the source code for each of the following five programs. Compile, run and paste one output sequence for each program. (a) MPI-Hello.c (b) Ring-Example-1.c (c) Ring-Example-2.c (d) Ring-Example-3.c (e) Send-Receive.c Part 02: Please download the attachment ‘MPI-02.tar.gz’ (Attached the file) and comple

OPTION A:

 

Part 01: 

Please download the attachment ‘MPI 01.tar.gz’ (Attached the file) and complete the following questions.

Q1: Understand the source code for each of the following five programs. Compilerun and paste one output sequence for each program.

            (a) MPI-Hello.c     (b) Ring-Example-1.c     (c) Ring-Example-2.c     

                        (d) Ring-Example-3.c             (e) Send-Receive.c

 

Part 02: 

Please download the attachment ‘MPI-02.tar.gz’ (Attached the file) and complete the four questions Q1 ~ Q4 

Q1: Complete the program ‘Scatter-Reduce.c’ (Refer to ‘Scatter-Gather.c’) to compute the product of all elements in a given array. 

 

Q2: Complete the program ‘Bcast-Reduce-Assignment.c’ (Refer to ‘Bcast-Reduce-Example.c’) to make the program have the output as follows if we run the program using processes.

          The input sequence is:   

          0 1 2 3          

          The output sequence is:  

          0 2 6 12

 

Q3: The MPI program ‘Standard-Deviation.c’ computes the standard deviation for an array of elements.(https://en.wikipedia.org/wiki/Standard_deviation Links to an external site.). Here, we assume that the maximum number of elements in the array is 10Some necessary error checkings are performed to ensure that the number of inputs is correct and their values are valid. Please run the program using each of the following commands and submit your screenshots for the outputs.

  (a) mpiexec -n 2 ./Stddev   (b) mpiexec -n 2 ./Stddev 0   (c) mpiexec -n 3 ./Stddev    

                   (d) mpiexec -n 3 ./Stddev         (e) mpiexec -n 4 ./Stddev 21

 

Q4: Complete the MPI program ‘Send-Receive-Checking’ to perform the necessary error checking for our previous example ‘Send-Receive.c’ to ensure that two processes are required for running the program.

OPTION B

Part 03

Please download the attachment ‘MPI-01.tar.gz’ (Attached the file) and complete the two questions Q1 and Q2 by following the instructions below.

Q1: Complete the program ‘Ring-Assignment-1.c’ to make the program work well for any number of processes specified by users and have one possible output sequence as follows if we run the program using processes.

          Process 0: Token value < 4 > is received from process 3

          Process 2: Token value < 2 > is received from process 1

          Process 1: Token value < 1 > is received from process 0

          Process 3: Token value < 3 > is received from process 2

 

Q2: Complete the program ‘Ring-Assignment-2.c to make the program have the same outputs as ‘Ring-Example-2.c’.

 

Part 04

Please download the attachment ‘Project Description.pdf’ (Attached the file) and complete the question Q1 by following the instructions below.

 

Q1: Write an MPI program ‘Estimate-Pi.c’ from the scratch to estimate the value of Pi (π) using a Monte Carlo method. Your program should perform necessary error checking for inputsPlease see the project description (Project-Description.pdf)

OPTION C:

Part 05:

Complete the assignment by following the instructions.  

1. In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.

                Example                 4! = 4*3*2*1 = 24               Note 0! = 1

Write a Pthreads program Factorial.c’ from the scratch to calculate the factorial of a given non-negative integer. Your program should perform necessary error checking for inputs.

GET THE WORK DONE AT ESSAYLINK.NET

Reference no: EM132069492

WhatsApp
Hello! Need help with your assignments? We are here

GRAB 25% OFF YOUR ORDERS TODAY

X