Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION #1 The attached cpp source code file (the one introduced in the classro

ID: 3869542 • Letter: Q

Question

QUESTION #1 The attached cpp source code file (the one introduced in the classroom before) is a multi- threaded application, which spawns two (child) threads after it is started. Each of the two child threads executes a for loop, which performs printf system call in each iteration of the for loop. While the two child threads execute their for loop, the main (the parent) thread waits for the two threads to finish. Q1: Which level(s) of tightly-coupled parallel computers (fine-grain, medium-grain, and coarse grain) may be applied to the program? Technically justify your response. Q2: Which of the Flynn's parallel model (SIMD, MISD, and MIMD) may applied? Technically justify your response

Explanation / Answer

Answer to Q1:
Since this is a tightly-coupled parallel computer that implies that it has a shared memory among the processors. Now the classification of the program according to grain size will be done.

Grain size of a program is determined based on the number of instructions in the program, i.e., it is a measure of the amount of computation involved in the program.

In our case we have the following flow
1. A program begins
2. It spawns two children threads
3. Inside each thread 50 print statements are executed
4. Then threads finish execution.
5. After the child threads terminate the main program finishes.

Therefore the number of instructions here is of the order of 100. If the number of instructions is less than 500 but more than 20 we can in general categorize such a program as Medium-grain. Hence our program is Medium-grain.

Answer to Q2:
Flynn's model classifies parallel computers based on the number of instruction streams and data streams. An instruction in a computer is typically composed of two parts -
a. Opcode: It specifies the operation to be carried out.
b. Operand: It specifies the operands for the operation and how to get/access the actual the operand data from the memory.

For our case we have two threads which are sending instructions (to print some strings) asynchronously to the processors. So definitely there are multiple instruction streams.
Also the processors are processing the instructions by carrying out the priniting operations asynchronously. That implies that there are multiple data streams.
Therefore we can conclude that our system is a MIMD(Multiple Instruction Multiple Data stream) system.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote