<br><font size=2 face="sans-serif">Hi Jayesh,</font>
<br>
<br><font size=2 face="sans-serif">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. </font>
<br>
<br><font size=2 face="sans-serif">1. I have been looking at </font><font size=2>MPI_Comm_spawn_multiple</font><font size=2 face="sans-serif">
and </font><font size=2>MPI_Comm_spawn</font><font size=2 face="sans-serif">
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? </font>
<br>
<br><font size=2 face="sans-serif">Meaning that if I have the following
line in my main code (call it myCode2.exe), </font>
<br>
<br><font size=2>MPI_Comm_spawn_multiple(NHOST, progs, MPI_ARGVS_NULL,
nproc, infos, 0, MPI_COMM_WORLD, &amp;intercomm, MPI_ERRCODES_IGNORE);</font>
<br>
<br><font size=2 face="sans-serif">the binary specified under &quot;Progs&quot;
argument should be an exe and not a dll or a lib file. Is this correct
? </font>
<br>
<br><font size=2 face="sans-serif">Here is a little background on what
I am trying to do here.</font>
<br><font size=2 face="sans-serif">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. </font>
<br><font size=2 face="sans-serif">I have tried putting in </font><font size=2>MPI_Comm_spawn_multiple</font><font size=2 face="sans-serif">
in the main program and tried to call the dll through </font><font size=2>MPI_Comm_spawn_multiple</font><font size=2 face="sans-serif">
but I get a runtime error indicating that the program being called by </font><font size=2>MPI_Comm_spawn_multiple</font><font size=2 face="sans-serif">
is not an executable. </font>
<br>
<br><font size=2 face="sans-serif">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? &nbsp;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.</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your help.</font>
<br>
<br><font size=2 face="sans-serif">Amar </font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Jayesh Krishna &lt;jayesh@mcs.anl.gov&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: mpich-discuss-bounces@mcs.anl.gov</font>
<p><font size=1 face="sans-serif">08/04/2011 03:28 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
mpich-discuss@mcs.anl.gov</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">mpich-discuss@mcs.anl.gov</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">PATEL_AMAR_K@cat.com</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [mpich-discuss] Running MPI jobs
without mpiexec</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<p><font size=1 face="sans-serif">Caterpillar: Confidential Green &nbsp;
&nbsp; &nbsp; &nbsp;Retain Until: 09/03/2011 &nbsp; &nbsp; &nbsp;
&nbsp;</font>
<p>
<br>
<br>
<br><tt><font size=2>Hi,<br>
 Two options come to my mind,<br>
<br>
# Take a look at MPI dynamic processes (http://www.mpi-forum.org/docs/mpi21-report/node197.htm#Node197).<br>
# Launch mpiexec from myCode2.<br>
<br>
Regards,<br>
Jayesh<br>
----- Original Message -----<br>
From: &quot;Amar K. Patel&quot; &lt;PATEL_AMAR_K@cat.com&gt;<br>
To: mpich-discuss@mcs.anl.gov<br>
Sent: Thursday, August 4, 2011 11:35:58 AM<br>
Subject: [mpich-discuss] Running MPI jobs without mpiexec<br>
<br>
<br>
<br>
Hello, <br>
<br>
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.
<br>
<br>
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.
<br>
<br>
Here is an crude version of myCode1 and myCode2 that I am using. <br>
<br>
void myCode1() <br>
{ <br>
int rank; <br>
MPI_Init(x, x); <br>
MPI_Comm_rank(MPI_COMM_WORLD, &amp;rank); <br>
...... <br>
...... <br>
...... <br>
...... <br>
...... <br>
...... <br>
...... <br>
...... <br>
MPI_Finalize(); <br>
return; <br>
} <br>
<br>
<br>
int myCode2(int argc, char **argv) <br>
{ <br>
myCode1(); <br>
return 0; <br>
} <br>
_______________________________________________<br>
mpich-discuss mailing list<br>
mpich-discuss@mcs.anl.gov<br>
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss<br>
_______________________________________________<br>
mpich-discuss mailing list<br>
mpich-discuss@mcs.anl.gov<br>
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss<br>
</font></tt>
<br>