- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In MPI programs, is it possible to tell if a process is launched in the host or MIC at runtime? Also, is it possible for a MIC process to know in which host its corresponding MIC locates at runtime?
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To tell if you are running on the host or coprocessor, you can use the __MIC__ macro in your code. When you compile your code for the coprocessor, this macro will be defined; otherwise, it is undefined. So, you could say:
[cpp]
#ifdef __MIC__
printf("this is the coprocessor\n");
#else
printf("this is the host\n");
#endif
[/cpp]
When you compile your MPI code with the -mmic option for use on the coprocessor, the first printf statement will be inserted in the code. When you compile that same code without the -mmic option, the second printf statement will be inserted in the code.
I'm not sure I understand your second question, but here is how I am interpreting it: If you have host A with coprocessor X installed and host B with coprocessor Y installed, then you want coprocessor X to be able to ask "where am I" and get the answer "host A". Similarly you want coprocessor Y to be able to ask "where am I" and get the answer "host B". Is that right?
I don't know of an existing tool that will give you this information but you can find the host's name in the /etc/hosts file on the coprocessor. The current naming convention says that "host" will be the address of the host and the second name given on that line will be the host name for the host. But can I ask why you want this? There may be another way to accomplish your objective.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Frances,
For my second question, your interpretation is correct, sorry for the confusion I made. I am asking this because I want to improve the throughput between two remote MICs in TCP connections. Ideally, when two remote MICs communicate, I want to dump the data from MIC to its host and then transfer to the remote host where the target MIC locates and finally to the remote target MIC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you show me a small code fragment showing how you will do this if you do know the names of the hosts for each coprocessor? I still can't quite picture it. Also, I would be reluctant to do something that might make the code less portable and might interfere with optimizations the developers have put into MPI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't written any code. Just thinking about a way to improve the slow bandwidth between remote MICs. Do you have any suggestions on this?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
YW, you might find this article of interest:
http://research.colfaxinternational.com/post/2014/03/11/InfiniBand-for-MIC.aspx
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jimdempseyatthecove wrote:
YW, you might find this article of interest:
http://research.colfaxinternational.com/post/2014/03/11/InfiniBand-for-MIC.aspx
Jim Dempsey
Hi Jim,
Thanks for pointing out this. However, it's all about Infiniband, but what I am trying to figure out is on the Ethernet connection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But the article compares Gigabit Ethernet to Infiniband. You can discard the Infiniband information if you wish as the data from the Etherhet connection is still valid for your purpose. You may also find other papers on the Colfax website (though I haven't searched).
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page