Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2159 Discussions

MPI parallelization of external standalone program

Michal_Kvasnicka
Beginner
324 Views
is possible to parallelize via MPI the following fragment of fortran code:
do i = 1,n
call ext_run(input(i), output(i))
end do
where subroutine ext_run(input,output) execute external single thread program by SYSTEMQQ (commandline) function.
For example: SYSTEMQQ ('extprog.exe < input_i.dat > output_i.dat'), where input_i and output_i are auxiliary data files which were created using input(i) or output(i) parameters.
I will be happy for some simple examples. Thanks ...

0 Kudos
1 Reply
Dmitry_K_Intel2
Employee
324 Views
Hi Michal,

MPI program is just a number of processes (the same) running in parallel. It's not clear how many times you want to call ext_run(), but it you want to call it for each mpi process you just need to remove the loop.

Calling 'mpiexec -n 4 ./your_app'
Each process will call:
call ext_run(input(rank), output(rank))
with its own rank which is in the range of 0...3

If you start 16 mpi processes, you'll call 16 different ext_run().

Does it answer your question?

Regards!
Dmitry
0 Kudos
Reply