<div>Jayesh,</div><div>  Thanks for your immediate response. MPI_IN_PLACE for 1 processor and using different arrays for the sendbuff and recbuff fixed it. And sorry for not checking the MPICH2 versions in Windows and Linux. I was running an earlier version of MPICH2 in linux. Also, I would appreciate it if you (or someone else) can answer the following question:</div>
<div>   I&#39;m running my code on a Quad core machine. Given this, why does mpiexec -n 6 &lt;my code.exe&gt; still run and work fine? </div><div>Thanks again</div><div>Prashanth</div><br><div class="gmail_quote">On Tue, Nov 16, 2010 at 12:11 PM, Jayesh Krishna <span dir="ltr">&lt;<a href="mailto:jayesh@mcs.anl.gov">jayesh@mcs.anl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
 The error usually occurs when you use the same buffer to send and receive data and don&#39;t use the MPI_IN_PLACE option (In your code pass MPI_IN_PLACE as the value of sendbuf in root.).<br>
 You might (should) get the same error with the latest version of MPICH2 on Linux too.<br>
 Let us know if it works for you.<br>
<br>
Regards,<br>
<font color="#888888">Jayesh<br>
</font><div><div></div><div class="h5">----- Original Message -----<br>
From: Prashanth &lt;<a href="mailto:prashanth.dumpuri@gmail.com">prashanth.dumpuri@gmail.com</a>&gt;<br>
To: <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
Sent: Tue, 16 Nov 2010 11:26:36 -0600 (CST)<br>
Subject: [mpich-discuss] MPI_Gather error<br>
<br>
All,<br>
   I have been using MPICH2 in linux and recently switched to Windows XP. My<br>
code worked fine under Linux but in Windows I get the following error<br>
message:<br>
<br>
Fatal error in PMPI_Gather: Invalid buffer pointer, error stack:<br>
PMPI_Gather(786): MPI_Gather(sbug=04785FF8, scount=1, MPI_INT,<br>
rbuf=04785FF8, rcount=1, MPI_INT, root=0, MPI_COMM_WORLD) failed<br>
PMPI_Gather(729): Buffers must not be aliased.<br>
<br>
( here is line in the code where i get the above error:<br>
<br>
MPI_Gather((void*)&amp;recvcnts[rank],1,MPI_INT,(void*)recvcnts,1,MPI_INT,0,MPI_COMM_WORLD);<br>
<br>
i have defined recvcnts to be an integer array )<br>
<br>
Please note that the above line and code works fine in Linux. Any help on<br>
this will be greatly appreciated.<br>
<br>
Thanks<br>
Prashanth<br>
<br>
</div></div></blockquote></div><br>