calculate the number of memory bytes accessed by this program: void my_dgemv(int n, double* A, double* x, double* y) {    #pragma omp parallel    {       int nthreads = omp_get_num_threads();       int thread_id = omp_get_thread_num();       printf("Hello world: thread %d of %d checking in. \n", thread_id, nthreads);    }    // insert your dgemv code here. you may need to create additional parallel regions,

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter11: Operating Systems
Section: Chapter Questions
Problem 14VE
icon
Related questions
Question

calculate the number of memory bytes accessed by this program:

void my_dgemv(int n, double* A, double* x, double* y) {

   #pragma omp parallel
   {
      int nthreads = omp_get_num_threads();
      int thread_id = omp_get_thread_num();
      printf("Hello world: thread %d of %d checking in. \n", thread_id, nthreads);
   }

   // insert your dgemv code here. you may need to create additional parallel regions,
   // and you may want to comment out the above parallel code block that prints out
   // nthreads and thread_id so as to not taint your timings

   #pragma omp parallel for
   // insert your code here: implementation of basic matrix multiply
   for(int i = 0; i < n; i++) {
         #pragma omp parallel for
         for(int j = 0; j < n; j++) {
                y[i] += A[i * n + j] * x[j];
         }
   }

}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Terminal Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning