Question: Try to write pseudocode for the tree structured global sum illustrated in fig 1 . 1 . Assume the number of cores is a power

Try to write pseudocode for the tree structured global sum illustrated in fig 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 determine 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 0% divisor =0 and 1% divisor =1 so 0 receives an 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!