Question: Goal: - This assignment aims to design a multithreaded program which will determine whether a solution to a Sudoku puzzle is valid or not. Details:
Goal: This assignment aims to design a multithreaded program which will determine whether a solution to a Sudoku puzzle is valid or not.
Details: This assignment is Programming Projects given in the th edition of the textbook pdf chapter Please read the details given in the book carefully. Solve this problem using OpenMP and pthread and compare their performances.
For a given N X N sudoku, where N is a square, there will be N rows, N columns and N grids to be validated as shown below.
Validation Condition: For a N X N sudoku, the validation condition is:
For example: For X sudoku, you need to check each row, each column and each of the four X subgrids have values from to
Input File: The input to the program will be a file, named input.tex.
The first line of the input file will contain two values K and N where K is the number of threads and N is the dimensional value of N X N sudoku.
From the second line, the sudoku of dimension N X N will be present, with each row in a new line. This sudoku can be generated through a python script.
A sample input file will be like this :
In the above example, K and N
Each row contains unique values from N
Each column contains unique values from N
Each of the nXn subgrids, contains a unique value from N where, N n
Output File: For ease of understanding, you need to generate an output file in which you will store the details of the execution of each thread and at last it should output whether the given sudoku is valid or invalid. A sample output would be something like this:
Thread checks row and is valid. Thread checks column and is valid. Thread checks grid and is valid.
Thread i checks the grid m and is valid.
Thread j checks the row n and is invalid.
Sudoku is invalid.
The total time taken is microseconds.
Report Details: As a part of this assignment you have to prepare a report in which you will compare the performance of OpenMP and pthread.
You have to perform two experiments without considering early termination. In the first experiment, you have to keep the number of threads constant say and compare the performance by varying the size of the sudoku XXXXXX and X In the second experiment, you have to keep the size of the sudoku constant X and compare the performance by varying the number of threads from to in multiples of
For the First experiment, the size of the sudoku will be on the xaxis as described above and the yaxis will show the time taken.
For the Second experiment, the number of threads will be on the xaxis and the y axis will show the time taken.
Note that, there will be three curves in each graph.
Finally, you must also give an analysis of the results while explaining any
anomalies observed in the report.
Submission Format: You have to upload: The source code in the following format: AssgnSrcc Readme: AssgnReadmetxt which contains the instructions for executing the program. Report: AssgnReportpdf Name the zipped document as: Assgnzip.
Note: Please follow this naming convention mentioned above.
Grading Policy: The policy for grading this assignment will be Design as described in the report and analysis of the results: Execution of the tasks based on the description in the readme: Code documentation and indentation:
Please note:
All assignments for this course have a late submission policy of a penalty of each day after the deadline of six days. After that, it will not be evaluated.
All submissions are subject to plagiarism checks. Any case of plagiarism will be dealt with severely.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
