[mpich-discuss] Integrating parallel and serial code

Hiatt, Dave M dave.m.hiatt at citi.com
Mon Jul 12 16:57:18 CDT 2010


It sounds like you are imagining function A and B are both part of the same executable module.  If that is the case, then A can be single threaded, but you'd be better off using OpenMP to thread function B and run in parallel locally.  Where MPI would help you is if function A is part of a program that sends messages out to a group of computers all running function B, and you are sending different data to all the functions B's hence you are running in parallel that way.

From: mpich-discuss-bounces at mcs.anl.gov [mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Michael Morrison
Sent: Monday, July 12, 2010 4:52 PM
To: mpich-discuss at mcs.anl.gov
Subject: [mpich-discuss] Integrating parallel and serial code

Hi All, I hope i'm posting this in the correct forum. I'm extremely new to MPI so forgive me if my question comes off as silly. I've only been dabbling around with parallel computing for a few weeks now but I'm wondering about the possibilities. So far with each example that I've been through, I create an MPI application and then run this application using the mpiexec command. What I'm wondering about is if it would be possible to say have a C function that executes some algorithm in a parallel manner that could be called by another C function. For example suppose i had two C functions, the first called function A and the second called function B. Function A is just a normal function that runs serially, function B executes its algorithm parallelly using MPI constucts. Is it possible to have a set up like this?

>From the examples I've seen it appears that the MPI code runs as standalone units and couldn't be integrated with  serially executing code. Is this true or is there someway to make this set up work? I may not have given enough information to answer the question, if there's any confusion please ask and i'll clarify.

Thanks for your time,

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20100712/3dff49f5/attachment.htm>


More information about the mpich-discuss mailing list