  In this paper, we present OMP2MPI a tool that generates automatically MPI
source code from OpenMP. With this transformation the original program can be
adapted to be able to exploit a larger number of processors by surpassing the
limits of the node level on large HPC clusters. The transformation can also be
useful to adapt the source code to execute in distributed memory many-cores
with message passing support. In addition, the resulting MPI code can be used
as an starting point that still can be further optimized by software engineers.
The transformation process is focused on detecting OpenMP parallel loops and
distributing them in a master/worker pattern. A set of micro-benchmarks have
been used to verify the correctness of the the transformation and to measure
the resulting performance. Surprisingly not only the automatically generated
code is correct by construction, but also it often performs faster even when
executed with MPI.
