Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (exercise 1.3) Try to write pseudo-code for the tree-structured global sum illustrated in Figure 1.1. Assume the number of cores is a power of

image text in transcribed

3. (exercise 1.3) Try to write pseudo-code for the tree-structured global sum illustrated in Figure 1.1. Assume the number of cores is a power of two (1,2,4, 8,...). Hints: Use a variable divisor to determine whether a core should send its sum or receive and add. The divisor should start with the value 2 and be doubled after each iteration. Also use a variable core difference to deter- mine which core should be partnered with the current core. It should start with the value 1 and also be doubled after each iteration. For example, in the first iteration of divisor = 0 and 1 % divisor = 1, so 0 receives and adds, while 1 sends. Also, in the first iteration 0 + core difference = 1 and 1 - core_difference = 0, so 0 and 1 are paired in the first iteration. Cores 3. (exercise 1.3) Try to write pseudo-code for the tree-structured global sum illustrated in Figure 1.1. Assume the number of cores is a power of two (1,2,4, 8,...). Hints: Use a variable divisor to determine whether a core should send its sum or receive and add. The divisor should start with the value 2 and be doubled after each iteration. Also use a variable core difference to deter- mine which core should be partnered with the current core. It should start with the value 1 and also be doubled after each iteration. For example, in the first iteration of divisor = 0 and 1 % divisor = 1, so 0 receives and adds, while 1 sends. Also, in the first iteration 0 + core difference = 1 and 1 - core_difference = 0, so 0 and 1 are paired in the first iteration. Cores

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

CL I P COL Astro- L(1-cas0) Lsing *A=2 L sin(0/2)

Answered: 1 week ago