<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
When debugging is enabled by configuring with the appropriate switches, it just causes the appropriate code to be compiled into MPICH2.  There are environment variables and command line options that update the value of MPIU_DBG_ActiveClasses, thus enabling some or all of the debug statements.  As the purpose of these debug statements is primarily to generate output that traces the execution, the ActiveClasses variable allows the user to select which types of debug messages are desired.  <div><br class="webkit-block-placeholder"></div><div>Object_set_ref is itself a macro that permits the use of assembly instructions when needed in a multithreaded environment (and one that uses fine-grain locking).  All that it is doing is setting the reference count on the object to the requested value (typically 1 or 2, depending on the object).</div><div><br class="webkit-block-placeholder"></div><div>Bill</div><div><br><div><div>On Jan 21, 2008, at 11:37 AM, Krishna Chaitanya wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dear Sir,<br>Sorry for the delay. <br>I added a few print statements and took a closer look at the  functions <span style="color: rgb(51, 51, 255);">MPIU_DBG_MSG_FMT() and </span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(51, 51, 255);"> MPIU_DBG_Outevent ()</span>. <span style="color: rgb(0, 0, 0);">It turns out that the <span style="color: rgb(51, 51, 255);">MPIU_DBG_ActiveClasses</span> parameter remains at 0 for the entire program execution, which means, the if() test fails and the </span></span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(51, 51, 255);">MPIU_DBG_Outevent</span> function never gets called. So, the call to <span style="color: rgb(51, 51, 255);"> MPIU_Object_set_ref()</span>  that is being called from <span style="color: rgb(51, 51, 255);">MPIR_Init_thread()</span> is not doing anything in terms of updating or maintaining the internal data structures.Am I missing something,here?  Could some one help me out  by explaining this? I hope I have explained my doubt clearly. <br><br>Thanks,<br>Krishna Chaitanya <br></span></span><br><div class="gmail_quote">On Jan 16, 2008 3:14 AM, William Gropp &lt;<a href="mailto:gropp@mcs.anl.gov">gropp@mcs.anl.gov</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style=""> Most of the operations that are used as macros are defined that way so that they can be eliminated at compile time.  The MPIU_DBG routines are a good example.  These are macros that are used to enable various debugging options and are not core parts of the communicator structure.  In fact, when MPICH2 is built for use in production, these macros are defined as empty.   <div><br></div><div>To answer your other question, there are no universally used routines for list management - instead, different modules make use of the routines that they need.</div><div><br></div><div>Bill</div><div><div> <div></div><div class="Wj3C7c"><br><div><div>On Jan 15, 2008, at 2:25 PM, Krishna Chaitanya wrote:</div><br><blockquote type="cite">Dear All,<br>             I have been trying to understand the types of data structures used by MPICH2 and the way in which the various lists are maintained and how they are initialized. I happen to observe that most of such routines have been implemented as macros which has made my job slightly harder as they dont appear while debugging with gdb.( Is there a way to trace through them at run time?) <br><br>             For example, I was keen on observing how MPICH2 deals with the MPI_COMM_WORLD data structure, which is of type MPID_COMM and it is a member of MPICH_PerProcess_t. So, at the time of populating  this structure , the library calls  [ from <span style="color: rgb(0, 0, 153);">MPIR_Init_thread</span>(...)    ]<br>         <span style="color: rgb(0, 0, 153);">MPIU_Object_set_ref( MPIR_Process.comm_world, 1 ); </span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">          -- &gt;   MPIU_DBG_MSG_FM ( .... ) </span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">                  -- &gt; MPIU_DBG_MSG_FMT ( .. ) </span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">                          -- &gt;  MPIU_DBG_Outevent ( ... ) </span><br>                                 --&gt; va_start and other such list related macros. <br><br>However, when the <span style="color: rgb(0, 0, 153);">MPIU_DBG_Outevent </span> function is invoked, the paramater, <span style="color: rgb(0, 0, 153);">int kind </span>is hard-coded to be 0. When the kind value is zero, the library does not do any list related work.Instead, it prints some details into a file.  So, how does the MPICH library maintain reference to the  MPIR_Process.comm_world structure, without the invocation of macros like va_start, va_arg etc. <br> <br clear="all">Its quite possible that I have got things wrong as I am jumping from one function to another using the ctags and I havent actually seen the code behave as above during run-time as we are dealing with macros. So, please correct me if I have got something wrong. <br><br>And, I am trying to draw an analogy between the OPEN-MPI and the MPICH2 when it comes to the way the internal data structures are handled. In Open-MPI, the OPAL library maitains such lists and has routines to manipulate them. Does MPICH have any other way of working with the lists of objects other than using the va_start and other related macros? <br><br>NOTE :  I am using the mpich2-1.0.6 version. <br><br>Thanks,<br>Krishna Chaitanya K,<br>National Institute of Technology,Karnataka ( NITK) <br>India.<br>-- <br>In the middle of difficulty, lies opportunity</blockquote> </div><br></div></div><font color="#888888"><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> <div>William Gropp</div><div>Paul and Cynthia Saylor Professor of Computer Science</div><div>University of Illinois Urbana-Champaign</div><br></span></span></span></span> </div><br></font></div></div></blockquote></div><br> <br clear="all"><br>-- <br>In the middle of difficulty, lies opportunity</blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>William Gropp</div><div>Paul and Cynthia Saylor Professor of Computer Science</div><div>University of Illinois Urbana-Champaign</div><br class="Apple-interchange-newline"></span></span></span></span> </div><br></div></body></html>