<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>RE: Buggy code - return status is an Integer array for fort pgms</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>&nbsp;Hi,<BR>
&nbsp; The return status in MPI calls is an Integer array for fortran programs. After the change your code works for me.<BR>
<BR>
######### orig code #########<BR>
<BR>
...<BR>
integer :: x, y, z, count, k, status, ierr<BR>
...<BR>
CALL MPI_RECV(count, 1, MPI_INTEGER, source, OCNT_TAG, MPI_COMM_WORLD, status, ierr)<BR>
<BR>
######### modify to ##########<BR>
<BR>
...<BR>
integer :: x, y, z, count, k, status(MPI_STATUS_SIZE), ierr<BR>
...<BR>
CALL MPI_RECV(count, 1, MPI_INTEGER, source, OCNT_TAG, MPI_COMM_WORLD, status, ierr)<BR>
<BR>
##############################<BR>
<BR>
&nbsp;Let us know if you have any other problems.<BR>
<BR>
Regards,<BR>
Jayesh<BR>
-----Original Message-----<BR>
From: Gib Bogle [<A HREF="mailto:g.bogle@auckland.ac.nz">mailto:g.bogle@auckland.ac.nz</A>]<BR>
Sent: Monday, May 05, 2008 2:16 AM<BR>
To: Jayesh Krishna<BR>
Subject: Buggy code<BR>
<BR>
Hi Jayesh,<BR>
<BR>
After a lot of trial and error, and some luck, I've managed to create a small program that shows the problem I referred to with MPICH2/Fortran/Windows.<BR>
<BR>
I've put the source code and the associated Intel project files into a zip file (attached).<BR>
<BR>
The failure mode is different with 'No optimization' and 'Optimize for maximum speed'.<BR>
<BR>
This test program runs if I turn off runtime error checking (All), but that isn't true for the real program.&nbsp; In general changing the compile and/or run flags changes the behaviour.<BR>
<BR>
By the way, if the write statement at line 29 in etransfer.f90 is commented out, the program runs.<BR>
<BR>
My guess is that there is a problem with the stack.<BR>
<BR>
I hope this code is useful to you, and wish you luck.&nbsp; I'm exhausted :-(<BR>
<BR>
Cheers<BR>
Gib<BR>
<BR>
--<BR>
Dr. Gib Bogle<BR>
Research Scientist<BR>
Auckland Bioengineering Institute<BR>
University of Auckland<BR>
New Zealand<BR>
<BR>
<A HREF="http://www.bioeng.auckland.ac.nz">http://www.bioeng.auckland.ac.nz</A><BR>
<BR>
g.bogle@auckland.ac.nz<BR>
(64-9) 373-7599 Ext. 87030<BR>
</FONT>
</P>

</BODY>
</HTML>