Which set of variables should you select?

You are designing a parallel algorithm for an OpenMP application. You write the following pseudocode to represent the sequential logic of the algorithm. (Line numbers are included for reference only.)

01 do i = 1, m
02 do j = 1, n
03 x = i/real(m)
04 y = j/real(n)
05 depth[j, i] = calculate_val(x, y)
06 enddo
07 enddo

You need to identify the variables that must be declared as private variables to correctly parallelize the algorithm. Which set of variables should you select?

You are designing a parallel algorithm for an OpenMP application. You write the following pseudocode to represent the sequential logic of the algorithm. (Line numbers are included for reference only.)

01 do i = 1, m
02 do j = 1, n
03 x = i/real(m)
04 y = j/real(n)
05 depth[j, i] = calculate_val(x, y)
06 enddo
07 enddo

You need to identify the variables that must be declared as private variables to correctly parallelize the algorithm. Which set of variables should you select?

A.
j; n; m

B.
i; j; x; y

C.
i; j; depth

D.
x; y; depth



Leave a Reply 0

Your email address will not be published. Required fields are marked *