Re: [mpich-discuss] Debugging MPI Window
Thanks for all the suggestions. I’ll try these and see how I do. Bruce From: Jeff Hammond via discuss <[email protected]> Sent: Thursday, April 18, 2019 10:26 PM To: [email protected] Cc: Jeff Hammond <[email protected]> Subject: Re: [mpich-discuss] Debugging MPI Window MPI_Win_{get,set}_name might be an even simpler way to do that. Jeff On Thu, Apr 18, 2019 at 1:04 AM Joachim Protze via discuss <[email protected]<mailto:[email protected]>> wrote: Hi Bruce, I think, you could use the keyval and set/get-attr functions for that purpose and it should even be portable :) Without testing the code, I would so something like the following: #define S1(x) #x #define S2(x) S1(x) #define LOCATION __FILE__ " : " S2(__LINE__) int win_debug_string_key; const int max_win_debug_string_len = 30; int My_copy_attr_function( MPI_Win oldwin, int win_keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag) { attribute_val_out = strndup(attribute_val_in, *(int*)extra_state); flag = 1; /* or set 0 if a copy is intended to be different */ } int My_delete_attr_function( MPI_Win win, int win_keyval, void *attribute_val, void *extra_state) { free(attribute_val); } /* Define the keyval once */ MPI_Win_create_keyval( My_copy_attr_function, My_delete_attr_function, &win_debug_string_key, &max_win_debug_string_len ); /* When creating a window */ MPI_Win_create( ..., &win ); /* be aware of the extra byte for the \0 byte */ char * win_debug_string = malloc(sizeof(char)*(max_win_debug_string_len+1)); /* Write the current location in there: */ strncpy(win_debug_string, LOCATION); /* Bind the debug-string to the new window */ MPI_Win_set_attr( win, win_debug_string_key, win_debug_string ); Best Joachim On 4/18/19 12:32 AM, Palmer, Bruce J via discuss wrote:
Hi,
Strictly for debugging purposes, is there a way in MPICH to determine if a MPI_Win created at point A in a code is the same window being accessed at point B? It doesn’t need to be portable, I’m just interested in using it to fix some bugs (that are probably not associated with MPI).
Bruce Palmer
Computer Scientist
Pacific Northwest National Laboratory
(509) 375-3899
_______________________________________________ discuss mailing list [email protected]<mailto:[email protected]> To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss
-- Dipl.-Inf. Joachim Protze IT Center Group: High Performance Computing Division: Computational Science and Engineering RWTH Aachen University Seffenter Weg 23 D 52074 Aachen (Germany) Tel: +49 241 80- 24765 Fax: +49 241 80-624765 [email protected]<mailto:[email protected]> www.itc.rwth-aachen.de<http://www.itc.rwth-aachen.de> _______________________________________________ discuss mailing list [email protected]<mailto:[email protected]> To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss -- Jeff Hammond [email protected]<mailto:[email protected]> http://jeffhammond.github.io/
participants (1)
-
Palmer, Bruce J