Understanding of parallel programming using mpi

Assignment Help C/C++ Programming
Reference no: EM133788651

Operating Systems Multithreaded Programming Assignment

This assignment will test your understanding of parallel programming using MPI and OpenMP by implementing two computationally intensive tasks. Each question combines practical programming with profiling, analysis, and reporting. Follow the requirements carefully and ensure that your submission meets the outlined criteria.

Requirements
This is an open-book, take-home assignment. You may use any resources, including textbooks, and online references, but all code must be your own.

Programs must be compatible with the Rushmore virtual cluster environment.

Submit a well-organized report in PDF format, including code, profiling data, answers to analysis questions, and any required tables or screenshots.

Question 1: Prime Cluster Search Using MPI

Problem Description

A prime cluster is a set of three consecutive prime numbers that appear within a short interval. For example, {101, 103, 107} and {149, 151, 157} are clusters of three consecutive primes. Write a parallel program using Open MPI to search for and analyze prime clusters in a large range of integers.

Program Requirements
Range Specification
Your program should find all prime clusters of size three within the range [2, 1000000]. The range should be divided among processes so each one works on a separate sub-range.
Parallelization

Use MPI to parallelize the program, ensuring each process independently searches for primes in its assigned sub-range. Carefully handle boundary conditions to ensure accurate detection of clusters that may span across sub-range boundaries.
Expected Console Output
At the start, print the range being processed and the number of MPI processes used, along
with each process's assigned sub-range.
Example:
Searching for prime clusters in range [2, 1000000] using 4 processes.
Process 0 handling range [2, 250000]
...
...
Total prime clusters found: 548 Smallest-sum cluster: {101, 103, 107}
Timing Measurement
Use a manual timing function, such as clock() in C/C++, to measure the execution time of your program and include the results in your report.

Analysis Questions
Explain your approach to parallelizing the prime cluster search. Discuss how you handled data distribution and boundary conditions. Describe any observed performance considerations. Did you encounter any load imbalance? If so, explain potential causes and solutions.

Implementation Notes
Use the Sieve of Eratosthenes (or another efficient algorithm) to generate primes within each sub-range. Minimize inter-process communication to maximize efficiency.

Point Breakdown
Accurate identification of prime clusters and correct output formatting. 15 points Effective distribution of work and correct boundary handling. 10 points
Clear explanations of parallelization, data handling, and performance observations. 5 points

Question 2: Merge Sort with OpenMP

Problem Description

Write a program to implement and parallelize the merge sort algorithm for sorting a large array of integers. Start with a sequential version, then use OpenMP to parallelize it, and finally profile and analyze the performance of both versions.

Program Requirements

Sequential Merge Sort
Implement a sequential version of merge sort for sorting an array of integers (at least 1,000,000 elements). This will serve as your baseline implementation.

Parallel Merge Sort Using OpenMP
Use OpenMP to parallelize the merge sort algorithm. Due to merge sort's recursive nature, determine the best way to apply parallelism. Consider parallelizing the merging process or dividing tasks among threads at specific recursion depths. Ensure the parallelized version produces the same sorted output as the sequential version.

Profiling and Performance Measurement
Use omp_get_wtime() or an equivalent timing function to measure running time for both the sequential and parallel versions. Run each version with different OpenMP thread counts (e.g., 1, 2, 4, 8) and record results in the following table format:

Threads Sequential Time (s) OpenMP Time (s) Speedup
1
2
4
8

Analysis Questions
Discuss challenges faced when parallelizing merge sort with OpenMP, focusing on the recursive nature of the algorithm. Explain the observed performance changes as thread count increased. Did parallelism yield expected improvements? Discuss any deviations.

Point Breakdown
Correct implementation of a working merge sort.
Effective parallelization strategy, maintaining correct output.

Complete and accurate timing and speedup data.
Thoughtful answers discussing parallelization challenges and observed performance.

Report Structure and Requirements
Submit a report (PDF format) that includes the following sections, formatted consistently for clarity:

Introduction
Provide an overview of each problem, including your approach and any key design decisions.

Program Description
For Question 1, explain your algorithm for prime detection, parallelization approach, data distribution strategy, and boundary handling. For Questions 2, describe the sequential implementation, then detail your parallelization strategy for OpenMP, including which sections were parallelized and why.

Profiling Summary
Summarize timing data from manual timing functions for both MPI and OpenMP programs. Include tables or graphs to visualize timing and speedup results for the OpenMP section.

Performance Analysis
For the MPI program, include observations on data distribution efficiency and any load imbalance noted during execution. For the OpenMP program, discuss observed speedup as thread count increased and the impact of recursive parallelization.

Screenshots
Include screenshots for each command used to run your programs and display outputs. Ensure output screenshots confirm correct final results.

Reflection
Reflect on the challenges and insights gained from implementing and profiling parallel algorithms using MPI and OpenMP. Discuss potential (future) improvements for both programs.
Readme

Include a README section with any special instructions for compiling and running the programs.

File Requirements
Code Files
Submit your source code files, clearly named, e.g., prime_clusters_mpi.c, merge_sort_sequential.c, and merge_sort_openmp.c. Ensure each file is well-documented, with comments explaining key functions and logic.

Reference no: EM133788651

Questions Cloud

How you can apply strategic management principles to your ow : Would you need to conduct a SWOT analysis or perform an environmental scan? Describe how you can apply strategic management principles to your own personal plan
Client with foot ulcer related to diabetes : A nurse is providing home care to a client with a foot ulcer related to diabetes. The client needs daily insulin injections.
Public health system requirements : Individualized care needs may not be addressed by universal programs Situational needs of clients are taking priority over the public health system requirements
Plot the data and tabulate the descriptive statistics : Transform the data if necessary. Plot the data and tabulate the descriptive statistics. Comment on your observations. Conduct ARIMA modelling.
Understanding of parallel programming using mpi : CSC718 Operating Systems Multithreaded Programming Assignment - Understanding of parallel programming using MPI and OpenMP by implementing two computationally
Create value for the business where you work and your life : Create value for the business where you work, your life, your school, or your family. What can you do to expand or improve your core competencies?
Call the health care provider to obtain permission : A client asks to read their medical record. What should the nurse do? Call the health care provider (HCP) to obtain permission.
How nurses integrate self-monitored data into patient care : How can nurses integrate this self-monitored data into patient care plans effectively, considering the FDA has not approved many of these apps?
What are the six population foci included in the model : What are the four APRN roles included in the model? What are the six population foci included in the model?

Reviews

len3788651

11/12/2024 9:19:05 PM

the programs and stuff are in the zipnwith answer explaination too make sure check it and make chnages for the pdf and make sure it correct amd give the crt doc

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd