Pergunta

I've never used MPI before nor taken a formal course on parallel programming. I'm an applied math student working on a large project that consists of a series of for loops. In each for loop, the iterations are completely independent of the others, so I'm pretty sure this can easily be parallelized.

I tried using openmp first but get an error that file can't be found (Mac user), and I'm not really sure how to fix that.

So is this a simple task to do in MPI? Google for some reason comes up short on answers here.

Foi útil?

Solução

If iterations are independent, then OpenMP is the simplest way to go. On Mac OS X, you need to install gcc to compile with OpenMP, owing to the fact that the clang compiler does not support (for now) OpenMP. You can install easily a precompiled version of gcc from here:

http://hpc.sourceforge.net

You can also use MPI of course, but that is going to be much more difficult for you, (besides installation), given that you are not trained. If you want to stick with MPI, parallelizing a loop consisting of independent iterations requires computing for each process its initial and final iteration, managing data structures appropriately (remember that in MPI memory is not shared among processes) etc.

Outras dicas

If you need OpenMP on Mac OS X, you can try to use unofficial clang with OpenMP support. The source code is avaialable here http://clang-omp.github.com. Also you need an OpenMP runtime library, which is available here http://openmp.llvm.org/.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top