DESCRIPTION Students: Please note instructions in paper copy of quiz. Save your files often, make sure OMSI fills your entire screen at all times, etc. A question may not fully fit into your OMSI question box, which is not scrollable. You can try adjusting the relative size of the question and answer boxes, but remember that clicking CopyQtoA will copy the entire question box to the answer box. In questions involving code which will partially be given to you in the question specs, YOU MAY NEED ADD NEW LINES OF CODE. Generally, the locations of the needed insertions will NOT be indicated. For full credit, do not change any of the existing lines. QUESTION In CUDA code, a conditional statement, for instance in lines 43-44, p.136, causes a performance problem known as thread _______________. QUESTION A CUDA call analogous to our oarlier F&A() is ____________________. QUESTION Consider the mutual outlinks example, pp.134-135. Suppose line 51 were to be changed to dim3 dimBlock(6,32,1) We would have to change TWO other lines in the program. Give the line numbers, and show the revised lines. QUESTION -ext .R -run "Rscript ./omsi_answer4.R" Below is partial listing of R/"Snow" code to transform an adjacency matrix, like Sec. 4.13. Complete the code. # adjacency matrix transform problem, R/parallel version # cls is the 'parallel' cluster, mat is the input matrix transgraph.par <- function(cls,mat) { # to retain original row numbers after splitting matrix rownames(mat) <- as.character(1:nrow(mat)) # distribute matrix chunks to workers rowgrps <- splitIndices(nrow(mat),length(cls)) # send chunks of matrix to workers # '<<'- assigns to global; otherwise mymat would be local to the function clusterApply(cls,rowgrps, function(onegrp) mymat <<- mat[onegrp,]) clusterExport(cls,'transgraph.ser') # do the work } transgraph.ser <- function(adj) { outmat <- NULL for (i in 1:nrow(adj)) { where1s <- which(adj[i,] == 1) newrows <- cbind(origrownum,where1s) } outmat } test <- function() { require(parallel) a <- rbind(c(1,0,1,1), c(1,0,0,1), c(0,0,0,1), c(0,1,1,0)) cls <- makeCluster(2) transgraph.par(cls,a) } test()