<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi all,<div><br></div><div>it's been two weeks I'm struggling with "Access violation reading" error in my application on the function "MPI_Comm_accept", the weird thing is it work well some iterations then it crashes. MPI_Comm_accept is used in a QThread, the code of the thread is below.</div><div><br></div><div>So, does anyone knows how to debug MPI applications in order to determine where the problem is located? or some way to run the application instruction per <span style="font-size: 10pt; ">instruction? i need help the sooner possible 'cause I don't have much time to finish the application.</span></div><div><span style="font-size: 10pt; ">P.S: I'm working on qt add-in on visual studio 2010 on windows 7, and I'm running my application with "wmpiexec.exe"</span></div><div><br></div><div><div>void ReceiverThread::run()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>CMessage Mes;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Datatype MessageType = Mes.createMessageType();</div><div><span class="Apple-tab-span" style="white-space:pre">  </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>MPI_Comm client;</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>MPI_Status status;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>Message message;</div><div><span class="Apple-tab-span" style="white-space:pre">     </span> </div><div><span class="Apple-tab-span" style="white-space:pre">       </span>char myPort[MPI_MAX_PORT_NAME];</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>DIH.getPort(myPort);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>forever</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>// wait up for a new message</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>printf("\naccepting connections on <%s>\n", myPort); fflush(stdout);</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>MPI_Comm_accept(
myPort , MPI_INFO_NULL, 0, MPI_COMM_WORLD, &client);</div><div><span class="Apple-tab-span" style="white-space:pre">             </span></div><div><span class="Apple-tab-span" style="white-space:pre">             </span>MPI_Recv(&message, 1, MessageType, MPI_ANY_SOURCE, MPI_ANY_TAG, client, &status);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">           </span>//insert the message into the fifo</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>DIH.InFifo.Insert(message);</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>printf("\nA messaage %d has been received from <%s>\n", message.Command, message.portSource); fflush(stdout);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">               </span>//disconnect from the current client</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>MPI_Barrier(client);</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>MPI_Comm_disconnect(&client);</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>}</div><div>}</div></div>                                    </div></body>
</html>