<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks for all the suggestions. I’ll try these and see how I do.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Bruce<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Jeff Hammond via discuss <discuss@mpich.org>
<br>
<b>Sent:</b> Thursday, April 18, 2019 10:26 PM<br>
<b>To:</b> discuss@mpich.org<br>
<b>Cc:</b> Jeff Hammond <jeff.science@gmail.com><br>
<b>Subject:</b> Re: [mpich-discuss] Debugging MPI Window<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">MPI_Win_{get,set}_name might be an even simpler way to do that. <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Jeff<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Apr 18, 2019 at 1:04 AM Joachim Protze via discuss <<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi Bruce,<br>
<br>
I think, you could use the keyval and set/get-attr functions for that <br>
purpose and it should even be portable :)<br>
Without testing the code, I would so something like the following:<br>
<br>
<br>
#define S1(x) #x<br>
#define S2(x) S1(x)<br>
#define LOCATION __FILE__ " : " S2(__LINE__)<br>
int win_debug_string_key;<br>
const int max_win_debug_string_len = 30;<br>
<br>
int My_copy_attr_function(<br>
MPI_Win oldwin, int win_keyval,<br>
void *extra_state, void *attribute_val_in,<br>
void *attribute_val_out, int *flag)<br>
{<br>
attribute_val_out = strndup(attribute_val_in, *(int*)extra_state);<br>
flag = 1; /* or set 0 if a copy is intended to be different */<br>
}<br>
<br>
int My_delete_attr_function(<br>
MPI_Win win, int win_keyval,<br>
void *attribute_val, void *extra_state)<br>
{<br>
free(attribute_val);<br>
}<br>
<br>
<br>
<br>
/* Define the keyval once */<br>
MPI_Win_create_keyval( My_copy_attr_function, My_delete_attr_function, <br>
&win_debug_string_key, &max_win_debug_string_len );<br>
<br>
<br>
/* When creating a window */<br>
MPI_Win_create( ..., &win );<br>
<br>
/* be aware of the extra byte for the \0 byte */<br>
char * win_debug_string = malloc(sizeof(char)*(max_win_debug_string_len+1));<br>
/* Write the current location in there: */<br>
strncpy(win_debug_string, LOCATION);<br>
/* Bind the debug-string to the new window */<br>
MPI_Win_set_attr( win, win_debug_string_key, win_debug_string );<br>
<br>
<br>
Best<br>
Joachim<br>
<br>
<br>
On 4/18/19 12:32 AM, Palmer, Bruce J via discuss wrote:<br>
> Hi,<br>
> <br>
> Strictly for debugging purposes, is there a way in MPICH to determine if <br>
> a MPI_Win created at point A in a code is the same window being accessed <br>
> at point B? It doesn’t need to be portable, I’m just interested in using <br>
> it to fix some bugs (that are probably not associated with MPI).<br>
> <br>
> Bruce Palmer<br>
> <br>
> Computer Scientist<br>
> <br>
> Pacific Northwest National Laboratory<br>
> <br>
> (509) 375-3899<br>
> <br>
> <br>
> _______________________________________________<br>
> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">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>
Dipl.-Inf. Joachim Protze<br>
<br>
IT Center<br>
Group: High Performance Computing<br>
Division: Computational Science and Engineering<br>
RWTH Aachen University<br>
Seffenter Weg 23<br>
D 52074 Aachen (Germany)<br>
Tel: +49 241 80- 24765<br>
Fax: +49 241 80-624765<br>
<a href="mailto:protze@itc.rwth-aachen.de" target="_blank">protze@itc.rwth-aachen.de</a><br>
<a href="http://www.itc.rwth-aachen.de" target="_blank">www.itc.rwth-aachen.de</a><br>
<br>
_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">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><o:p></o:p></p>
</blockquote>
</div>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Jeff Hammond<br>
<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br>
<a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><o:p></o:p></p>
</div>
</div>
</body>
</html>