MPI parallelization of external standalone program

MPI parallelization of external standalone program

Michal Kvasnicka的头像

is possible to parallelize via MPI the following fragment of fortran code:do i = 1,n call ext_run(input(i), output(i))end dowhere 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 ...

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

登陆并发表评论。