Reputation: 153
I am passing in a value into my MPI program written in C. So if I pass in a value of 5, I want to to give the number 5 to thread number one, number 4 to thread number 2 etc. How would I do this?
At the end I have a MPI reduce which does the product of all these values (5*4*3...), so I don't really need to do anything in the thread but I just need to pass different values to each thread.
Upvotes: 0
Views: 92
Reputation: 1554
This sounds like an assignment, so I will only write out the pseudo-code.
Even I think that you actually mean processes, and NOT threads (as suszterpatt already pointed out in the comment).
Upvotes: 2