<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><div><div>Hi Andreas,<br><br></div>Thanks a lot for your example! Btw your blog is beneficial for me as well :-)<br><br></div>Best Regards,<br></div>Fan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 13, 2015 at 3:02 PM, Andreas Schäfer <span dir="ltr"><<a href="mailto:gentryx@gmx.de" target="_blank">gentryx@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If the names of your hosts differ in length, then you'll need to use<br>
MPI_Get_processor_name + MPI_Allgather + MPI_Allgatherv, for a quick<br>
example please see the attached code.<br>
<br>
Cheers<br>
-Andreas<br>
<div><div class="h5"><br>
<br>
On 22:46 Thu 12 Mar , Jeff Hammond wrote:<br>
> Try MPI_Allgather on the output of MPI_Get_processor_name.<br>
><br>
> Jeff<br>
><br>
> On Thu, Mar 12, 2015 at 10:41 PM, YANG Fan <<a href="mailto:iddmbr@gmail.com">iddmbr@gmail.com</a>> wrote:<br>
> > Thanks, Jeff!<br>
> ><br>
> > But there's one problem. Suppose I'm on rank 1 and I want to know the host<br>
> > name of rank 2, then using this function I can only know my own host name. I<br>
> > hope that I can know others' host names...<br>
> ><br>
> > On Fri, Mar 13, 2015 at 11:15 AM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>
> > wrote:<br>
> >><br>
> >> Try MPI_Get_processor_name.<br>
> >><br>
> >> Jeff<br>
> >><br>
> >><br>
> >> On Thursday, March 12, 2015, YANG Fan <<a href="mailto:iddmbr@gmail.com">iddmbr@gmail.com</a>> wrote:<br>
> >>><br>
> >>> Hi,<br>
> >>><br>
> >>> To run an MPI program on a cluster I need to pass the host file as a<br>
> >>> parameter. However, how can I know that what host name does a specific rank<br>
> >>> correspond to? Or how can I access the host file inside my MPI program?<br>
> >>> Thanks!<br>
> >>><br>
> >>> Best Regards,<br>
> >>> Fan<br>
> >><br>
> >><br>
> >><br>
> >> --<br>
> >> Jeff Hammond<br>
> >> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
> >> <a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
> >><br>
> >> _______________________________________________<br>
> >> discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
> >> To manage subscription options or unsubscribe:<br>
> >> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
> > To manage subscription options or unsubscribe:<br>
> > <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
><br>
><br>
><br>
> --<br>
> Jeff Hammond<br>
> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
> <a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
> _______________________________________________<br>
> discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
<br>
</div></div>--<br>
==========================================================<br>
Andreas Schäfer<br>
HPC and Grid Computing<br>
Chair of Computer Science 3<br>
Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany<br>
<a href="tel:%2B49%209131%2085-27910" value="+4991318527910">+49 9131 85-27910</a><br>
PGP/GPG key via keyserver<br>
<a href="http://www.libgeodecomp.org" target="_blank">http://www.libgeodecomp.org</a><br>
==========================================================<br>
<br>
(\___/)<br>
(+'.'+)<br>
(")_(")<br>
This is Bunny. Copy and paste Bunny into your<br>
signature to help him gain world domination!<br>
<br>_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br></blockquote></div><br></div>