[mpich-discuss] Running MPI jobs without mpiexec

Amar K. Patel PATEL_AMAR_K at cat.com
Mon Aug 15 13:45:08 CDT 2011


Hi Jayesh,

Apologies if I was not clear in the previous email. My main executable 
loads the dll in the beginning and while it (exe) is running calls the dll 
for performing CPU intensive math. Previously the dll used to be an 
executable that was run as a separate program with MPI. What we are trying 
to do now, is to couple two separate programs into one such that one of 
them becomes the main program and the second one needs is called by first. 
For this reason we are converting the second program into a dll that is 
loaded by the main as a shared library. 

However when the main program calls the dll, we would like the dll to be 
run on multiple processors just as it used to be run when it (the dll) was 
a standalone executable. 

Thanks,
Amar

----------------------------------------------------------------------------------
Engine Performance & Emissions
Advanced Virtual Product Development , PD & GT
Caterpillar Inc. 
Phone     : (309) 578-1283
Email      : PATEL_AMAR_K at cat.com
----------------------------------------------------------------------------------



Jayesh Krishna <jayesh at mcs.anl.gov> 
Sent by: mpich-discuss-bounces at mcs.anl.gov
08/15/2011 01:31 PM
Please respond to
mpich-discuss at mcs.anl.gov


To
"Amar K. Patel" <PATEL_AMAR_K at cat.com>
cc
mpich-discuss at mcs.anl.gov
Subject
Re: [mpich-discuss] Running MPI jobs without mpiexec




Caterpillar: Confidential Green Retain Until: 09/14/2011 



Hi,
 I am not sure what you mean by "running" a dll (Are you referring to 
using "rundll" etc ? ). 
 What is the advantage that you get by running dlls instead of executables 
?

Regards,
Jayesh

----- Original Message -----
From: "Amar K. Patel" <PATEL_AMAR_K at cat.com>
To: jayesh at mcs.anl.gov
Cc: mpich-discuss at mcs.anl.gov
Sent: Monday, August 15, 2011 10:58:37 AM
Subject: Re: [mpich-discuss] Running MPI jobs without mpiexec


Hi Jayesh, 

Thanks for suggesting the two options earlier. I have been exploring them 
since your recommendations and I would appreciate if you could answer 
these follow-up questions. 

1. I have been looking at MPI_Comm_spawn_multiple and MPI_Comm_spawn under 
MPI dynamic processes and I have concluded that for either of these 
options to work, the callee binary should be an exe. Am I correct to 
conclude this? 

Meaning that if I have the following line in my main code (call it 
myCode2.exe), 

MPI_Comm_spawn_multiple(NHOST, progs, MPI_ARGVS_NULL, nproc, infos, 0, 
MPI_COMM_WORLD, &intercomm, MPI_ERRCODES_IGNORE); 

the binary specified under "Progs" argument should be an exe and not a dll 
or a lib file. Is this correct ? 

Here is a little background on what I am trying to do here. 
I am trying to call a shared library (dll) that needs to be run on 
multiple processors but I do not want the main calling program to be run 
on multiple PCs. So basically, I need to run the main program 
(myCode2.exe) as a singleton process which at run time needs to call a dll 
(myCode1.dll) and that dll needs to be run on multiple processors. 
I have tried putting in MPI_Comm_spawn_multiple in the main program and 
tried to call the dll through MPI_Comm_spawn_multiple but I get a runtime 
error indicating that the program being called by MPI_Comm_spawn_multiple 
is not an executable. 

2. Your other suggestion was launching mpiexec from the main program 
(myCode2.exe). Are you suggesting using the system() function in 
myCode2.exe to launch mpiexec which then launches myCode1? Wont this 
require myCode1 to be an exe file to be launched with mpiexec command? In 
my case myCode1 used to be compiled as a standalone exe file before, but 
we would now wish to compile it as a dll that is loaded as a shared 
library and called by another larger executable at run time. 

Thanks for your help. 

Amar 




                 Jayesh Krishna <jayesh at mcs.anl.gov> 
Sent by: mpich-discuss-bounces at mcs.anl.gov 

08/04/2011 03:28 PM 
Please respond to 
mpich-discuss at mcs.anl.gov 
 
To               mpich-discuss at mcs.anl.gov 
 
cc               PATEL_AMAR_K at cat.com 
 
Subject                  Re: [mpich-discuss] Running MPI jobs without 
mpiexec 
 


Caterpillar: Confidential Green Retain Until: 09/03/2011 




Hi, 
Two options come to my mind, 

# Take a look at MPI dynamic processes (
http://www.mpi-forum.org/docs/mpi21-report/node197.htm#Node197). 
# Launch mpiexec from myCode2. 

Regards, 
Jayesh 
----- Original Message ----- 
From: "Amar K. Patel" <PATEL_AMAR_K at cat.com> 
To: mpich-discuss at mcs.anl.gov 
Sent: Thursday, August 4, 2011 11:35:58 AM 
Subject: [mpich-discuss] Running MPI jobs without mpiexec 



Hello, 

I have MPI program that runs fine when it started with the command mpiexec 
-n # myCode1.exe. I now need to call myCode1 from another code (say 
myCode2) in such a way that myCode1 is a dll file which is loaded and 
called when myCode2 is being executed. myCode2 is started without using 
mpiexec commad. 

With this new setup I would like to call myCode1.dll and be able to use 
the MPI features that have been embedded in it such that myCode1.dll can 
be run on more than one CPU. Is such a thing possible ? If so, then I 
would appreciate if someone could point me to a documentation or an 
example that illustrates how to implement the changes needed in myCode1 
and/or myCode2. 

Here is an crude version of myCode1 and myCode2 that I am using. 

void myCode1() 
{ 
int rank; 
MPI_Init(x, x); 
MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
...... 
...... 
...... 
...... 
...... 
...... 
...... 
...... 
MPI_Finalize(); 
return; 
} 


int myCode2(int argc, char **argv) 
{ 
myCode1(); 
return 0; 
} 
_______________________________________________ 
mpich-discuss mailing list 
mpich-discuss at mcs.anl.gov 
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss 
_______________________________________________ 
mpich-discuss mailing list 
mpich-discuss at mcs.anl.gov 
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss 

_______________________________________________
mpich-discuss mailing list
mpich-discuss at mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss

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


More information about the mpich-discuss mailing list