<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Thanks for the reply and valuable suggestion.</div><div><br></div><div>One more Question:</div><div><br></div><div>Anyway to avoid bringing down(cleaning up ) all MPI jobs when one job dies.</div><div><br></div><div><br></div><div>Regards</div><div>Sanjeev</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 1, 2017 at 10:25 AM, Guo, Yanfei <span dir="ltr"><<a href="mailto:yguo@anl.gov" target="_blank">yguo@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 5/30/17, 10:19 PM, "sanjeev s" <<a href="mailto:snjv.workmail@gmail.com">snjv.workmail@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
<br>
<br>
</span><span>> I have added the detailed use case..<br>
<br>
<br>
> > I did not follow what were you trying to do here. Can you be more specific?<br>
<br>
> Suppose I have an application which accepts some request from client and do<br>
> the MPI job on request arrival(lazy load of mpi lib). Now I started this<br>
> application through mpiexec on 4 machines.<br>
> mpiexec will start my application on 4 machines not MPI jobs. On request<br>
> arrival I will distribute MPI jobs to this cluster after doing some processing<br>
> in my application on master node.(1 of out of 4 I will designate as master<br>
> node). Now I want to add one more machine( having my application) to this<br>
> cluster, without stopping my already running applications. My master process<br>
> should be able to see this 5th machine and distribute the task. Is there any<br>
> way to achieve this?<br>
<br>
</span>Is this "application" an MPI program? If so, there are two options. 1. Starting<br>
the MPI process on the 5th machine and have it connect to your existing<br>
processes (with MPI_Comm_connect/MPI_Comm_<wbr>accept). 2. Letting the existing<br>
processes spawn new processes on the new machine (with MPI_Comm_spawn). You can<br>
check out the book "Using Advanced MPI" for details and examples. If the<br>
aforementioned application is not an MPI program, then what you are trying to<br>
do is beyond the scope of MPI.<br>
<span><br>
<br>
<br>
> > Also, When I took the size(number of instance for that comm), I am not<br>
> > getting the count for client instance. To distribute the task, I need to have<br>
> > additional logic to handle this case in my application.<br>
<br>
> Can you be more specific about which comm you were referring to?<br>
<br>
<br>
<br>
> I am referring to MPI_COMM_WORLD. Is there any resize kind of api which will<br>
> give me how many jobs are there on this comm after doing one accept connection?<br>
<br>
</span>MPI_COMM_WORLD is created during MPI_Init. It does not change when a new<br>
process group is connected. The communicator that accepts the connection will<br>
give you an intercommunicator which allows the accepting processes to talk to<br>
the connecting processes. You can merge this intercommunicator to a<br>
intracommunicator that contains all the processes.<br>
<span><br>
> Hope this helps in understanding the problem.<br>
<br>
<br>
> Regards<br>
> Sanjeev<br>
<br>
</span>Yanfei Guo<br>
<div><div class="h5"><br>
<br>
<br>
<br>
On Mon, May 29, 2017 at 8:48 AM, sanjeev s<br>
<<a href="mailto:snjv.workmail@gmail.com">snjv.workmail@gmail.com</a>> wrote:<br>
<br>
Hi,<br>
<br>
<br>
Thanks for the reply. I have given the detailed use case below.<br>
<br>
<br>
Regards<br>
Sanjeev<br>
<br>
<br>
<br>
<br>
<br>
On Sat, May 27, 2017 at 2:30 AM, Guo, Yanfei<br>
<<a href="mailto:yguo@anl.gov">yguo@anl.gov</a>> wrote:<br>
<br>
Hi Sanjeev,<br>
<br>
Please see the inline comments below.<br>
<br>
Yanfei Guo<br>
Postdoctoral Researcher<br>
MCS Division, ANL<br>
<br>
<br>
On 5/26/17, 10:40 AM, "sanjeev s" <<a href="mailto:snjv.workmail@gmail.com">snjv.workmail@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
<br>
<br>
> In dynamic process, I read about two models: Client server and parent child.<br>
<br>
<br>
> Client Server : We need to have dedicated threads each for client and server. Now considering all instances same , we will end up doing lot of thread creation apart from our application worker threads.<br>
<br>
I assume you are referring to the connect/accept model by client/server. In that case, you may need one thread on the server side to handle the incoming connection because the `MPI_Comm_accept` call<br>
is blocking. A dedicated thread is not necessary in the client.<br>
It is your application’s job to decide who is the server.<br>
<br>
<br>
<br>
<br>
<br>
Yes I am referring to same connect/accept model. I don't want to put this logic in our application. I want some external process manager ( like Hydra) which can handle this form me .Please see below for detail use case.<br>
<br>
<br>
<br>
<br>
> Moreover when 1 instance (app) goes down, we want<br>
that instance to come up without doing much manual work. We don't want to club this logic in our application.<br>
<br>
I did not follow what were you trying to do here.<br>
Can you be more specific?<br>
<br>
<br>
<br>
Suppose I have an application which accepts some request from client and do the MPI job on request arrival(lazy load of mpi lib). Now I started this application through mpiexec on 4 machines.<br>
mpiexec will start my application on 4 machines not MPI jobs. On request arrival I will distribute MPI jobs to this cluster after doing some processing in my application on master node.(1 of out of 4 I will designate as master node). Now I<br>
want to add one more machine( having my application) to this cluster, without stopping my already running applications. My master process should be able to see this 5th machine and distribute the task. Is there any way to achieve this?<br>
<br>
<br>
<br>
<br>
<br>
> Also, When I took the size(number of instance for that comm), I am not getting the count for client instance. To distribute the task, I need to have additional logic to handle this case in my application.<br>
<br>
Can you be more specific about which comm you were referring to?<br>
<br>
<br>
<br>
I am referring to MPI_COMM_WORLD. Is there any resize kind of api which will give me how many jobs are there on this comm after doing one accept connection?<br>
<br>
<br>
> 2) Parent child: Suppose we have started 4 instance on 4 different machines. Now we need to add another server. I don't think parent child/ client server is good option in this case.<br>
<br>
<br>
> We don't want to build process management capabilities in our application. We are looking for process management in MPI itself (e.g in Hydra )so that we can leverage on that.<br>
<br>
<br>
> Please correct me if I am missing something in my understanding of Dynamic model.<br>
<br>
<br>
Regards<br>
Sanjeev Sinha<br>
<br>
<br>
<br>
<br>
<br>
On Fri, May 26, 2017 at 8:46 PM, Halim Amer<br>
<<a href="mailto:aamer@anl.gov">aamer@anl.gov</a>> wrote:<br>
<br>
Sanjeev,<br>
<br>
> More precisely my requirement is suppose I started 4 instances of my<br>
> application. Now I want to add one more instance dynamically to this set<br>
<br>