How can write a paralle program using the
openmp threading library(omp.h) to calculate
the time needed to calculate the dot product of
two vectors.

Recommended Answers

All 2 Replies

This is getting tedious. DO NOT ask us to do your homework for you!

why would you want to do that with threading?? I don't see how threading would help solve the problem, except maybe for huge values of N. In that case you could split the problem up, create threads that calculate individual chuncks of data. For example, if N is 1 Million then you could split it up into 10 threads where each thread calculates the sum of products for 100 Thousand items. With that large of vectors you would run the risk of data overflow.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.