Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] speed up this problem by MPI
From: Eugene Loh (Eugene.Loh_at_[hidden])
Date: 2010-01-28 23:40:20


Tim wrote:

>Thanks Eugene!
>
>My case, after simplified, is to speed up the time-consuming computation in the loop below by assigning iterations to several nodes in a cluster by MPI. Each iteration of the loop computes each element of an array. The computation of each element is independent of others in the array.
>
> int main(int argc, char ** argv)
> {
> // some operations
> f(size);
> // some operations
> return 0;
> }
>
> void f(int size)
> {
> // some operations
> int i;
> double * array = new double [size];
> for (i = 0; i < size; i++) // need to speed up by MPI.
> {
> array[i] = complicated_computation(); // time consuming
>
>
What are the inputs to complicated_computation()? Does each process
know what the inputs are? Or, do they need to come from the master
process? Are there many inputs?

> }
> // some operations using all elements in array
> delete [] array;
> }
>
>