<div>Hi,</div><div> </div><div>I am sorry, but I don't understand. Do you want to see my code?</div><div>I can copy a subroutine with error if it is useful.</div><div>However, the program test fpi work well.</div><div>

<br></div><div><br></div><div>This is the subroutine:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>SUBROUTINE Build_MPI_near_field_type(var_name,MY_MPI_near_field_type)<br>!:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>TYPE(near_field_var), INTENT(IN) :: var_name<br><span class="Apple-tab-span" style="white-space:pre">      </span>INTEGER, INTENT(IN) :: MY_MPI_near_field_type<br><span class="Apple-tab-span" style="white-space:pre">     </span>INTEGER, PARAMETER :: SIZE = 4<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>INTEGER(KIND = MPI_ADDRESS_KIND) :: address(SIZE)<br><span class="Apple-tab-span" style="white-space:pre"> </span>INTEGER(KIND = MPI_ADDRESS_KIND) :: displs(SIZE)<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>INTEGER :: type_list(SIZE), block_lenghts(SIZE), MY_MPI_error<br><span class="Apple-tab-span" style="white-space:pre">     </span>!generate type_list<br><span class="Apple-tab-span" style="white-space:pre">       </span>type_list(1) =  MPI_REAL<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>type_list(2) =  MPI_REAL<br><span class="Apple-tab-span" style="white-space:pre">  </span>type_list(3) =  MPI_REAL<br><span class="Apple-tab-span" style="white-space:pre">  </span>type_list(4) =  MPI_INTEGER<br>

</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class="Apple-tab-span" style="white-space:pre"> </span>! in the 64bit version, after last MPI_GET_ADDRESS it change <br><span class="Apple-tab-span" style="white-space:pre">     </span>!the value of block_lenghts(1) in -1. I moved it under<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>!Fill block_lengths<br><span class="Apple-tab-span" style="white-space:pre">       </span>!block_lenghts(:) = 1<br><span class="Apple-tab-span" style="white-space:pre">     </span> </blockquote>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">        !get addresses<br><span class="Apple-tab-span" style="white-space:pre">    </span>CALL MPI_GET_ADDRESS(var_name%distance,address(1),MY_MPI_error)<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>CALL MPI_GET_ADDRESS(var_name%min_distance,address(2),MY_MPI_error)<br><span class="Apple-tab-span" style="white-space:pre">       </span>CALL MPI_GET_ADDRESS(var_name%max_distance,address(3),MY_MPI_error)<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>CALL MPI_GET_ADDRESS(var_name%flag,address(4),MY_MPI_error)<br><span class="Apple-tab-span" style="white-space:pre">       </span>!Compute displacement<br><span class="Apple-tab-span" style="white-space:pre">     </span>displs(1) = 0<br>

<span class="Apple-tab-span" style="white-space:pre"> </span>displs(2) = address(2) - address(1)<br><span class="Apple-tab-span" style="white-space:pre">       </span>displs(3) = address(3) - address(1)<br><span class="Apple-tab-span" style="white-space:pre">       </span>displs(4) = address(4) - address(1)<br>

        WRITE (*,*) MPI_ADDRESS_KIND<br>    <br>        !Fill block_lengths<br><span class="Apple-tab-span" style="white-space:pre">        </span>block_lenghts(:) = 1<br><span class="Apple-tab-span" style="white-space:pre">      </span></blockquote>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

        CALL MPI_TYPE_CREATE_STRUCT(SIZE,block_lenghts,displs,type_list,MY_MPI_near_field_type,MY_MPI_error)<br><span class="Apple-tab-span" style="white-space:pre">   </span>CALL MPI_TYPE_COMMIT(MY_MPI_near_field_type,MY_MPI_error)<span class="Apple-tab-span" style="white-space:pre">   </span><br>

<span class="Apple-tab-span" style="white-space:pre"> <br></span>END SUBROUTINE</blockquote></div><div><br clear="all"><font style size="2"><span style="font-family:verdana,sans-serif">This is the call in other sub:</span></font></div>

<div><font style size="2"><span style="font-family:verdana,sans-serif"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

!Near field (for sparfied matrix)<br>CALL Build_MPI_near_field_type(var_name%near_field,MY_MPI_near_field_type)</blockquote></span></font></div><div><font style size="2"><span style="font-family:verdana,sans-serif"><br></span></font></div>

<div><font style size="2"><font face="verdana, sans-serif">I defined  </font></font></div><div><font style size="2"><font face="verdana, sans-serif"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

TYPE(project_var), INTENT(IN) :: var_name<br>INTEGER, INTENT(IN) :: MY_MPI_near_field_type</blockquote><div><br></div><div>Where in a module I defined:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

 TYPE :: project_var<br><span style="background-color:rgb(255,255,255)">     TYPE(near_field_var)  :: near_field <br></span><span style="background-color:rgb(255,255,255)">     TYPE(ground_var) :: ground<br></span><span style="background-color:rgb(255,255,255)">     ...<br>

</span> END TYPE project_var</blockquote><div><br></div><div>and</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

TYPE :: near_field_var<br>     REAL(KIND=SGL) :: distance, min_distance, max_distance<br>     INTEGER  :: flag<br>END TYPE near_field_var </blockquote><div><br></div><div>In another module:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6,r=37)</blockquote><div><br></div><div><br></div><div>p.s. of course. The 64 bit code doesn't work with 32 bit MPICH2, the builder returned error in link procedure. </div>

<div> </div></font></font></div><div><font style size="2"><span style="font-family:verdana,sans-serif">Ing. Marco De Gregorio</span></font><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Microwave & Radiation Laboratory</span><br style="font-family:verdana,sans-serif"><span style="font-family:verdana,sans-serif">Dip. Ingegneria dell'Informazione - Universitą di Pisa</span><br style="font-family:verdana,sans-serif">


<span style="font-family:verdana,sans-serif">via G. Caruso 16, 56122 Pisa - Italy</span><br style="font-family:verdana,sans-serif"><span style="font-family:verdana,sans-serif"><i>Lab</i>: <a href="tel:%28%2B39%29050.2217681" value="+390502217681" target="_blank">(+39)050.2217681</a></span><br style="font-family:verdana,sans-serif">


<span style="font-family:verdana,sans-serif"><i>Cell</i>: <a href="tel:%28%2B39%293281982575" value="+393281982575" target="_blank">(+39)3281982575</a></span><br style="font-family:verdana,sans-serif"><span style="font-family:verdana,sans-serif"><i>Mail</i>: </span><a style="font-family:verdana,sans-serif" href="mailto:marco.degregorio@iet.unipi.it" target="_blank">marco.degregorio@iet.unipi.it</a><span style="font-family:verdana,sans-serif"></span><br>


<br>
<br><br><div class="gmail_quote">2012/9/24 Jayesh Krishna <span dir="ltr"><<a href="mailto:jayesh@mcs.anl.gov" target="_blank">jayesh@mcs.anl.gov</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<br>
 Can you send us a test program (source code) that fails?<br>
<br>
(PS: I am assuming that you recompiled your code after installing the 64-bit libs.)<br>
Regards,<br>
Jayesh<br>
<div><br>
----- Original Message -----<br>
From: "Marco De Gregorio" <<a href="mailto:marco.degregorio@iet.unipi.it" target="_blank">marco.degregorio@iet.unipi.it</a>><br>
To: <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
Sent: Monday, September 24, 2012 11:21:46 AM<br>
Subject: [mpich-discuss] MPI 64 bit for 64 bit code on windows7 64 bit<br>
<br>
<br>
Hi,<br>
<br>
I work with a Fortran code. I use Visual Studio 2008 and Intel Fortran 11.<br>
I have always used 32 bit MPI successfully.<br>
Now I need to switch my code to 64 bit. First of all I uninstalled 32 bit MPICH2 and I installed mpich2-1.4.1p1-win-x86-64.<br>
I have several problems.<br>
</div>When I launch my program, the first value of some integer array ( block_lengths ) changes sign after some MPI_GET_ADDRESS and I have an error message. Below you can find a piece of code.<br>
<div><div><br>
block_lengths(:) = 1<br>
<br>
!get addresses<br>
CALL MPI_GET_ADDRESS(var_name%distance,address(1),MY_MPI_error)<br>
CALL MPI_GET_ADDRESS(var_name%min_distance,address(2),MY_MPI_error)<br>
CALL MPI_GET_ADDRESS(var_name%max_distance,address(3),MY_MPI_error)<br>
CALL MPI_GET_ADDRESS(var_name%flag,address(4),MY_MPI_error)<br>
<br>
So, I changed the position of these arrays in the code and I have bypass the error, but after the change, however the code doesn't work. The problem is with a mpi_send and mpi_receiver.<br>
<br>
address is defined as INTEGER(KIND = MPI_ADDRESS_KIND) :: address(SIZE) , but write(*,*) MPI_GET_ADDRESS returns 4.<br>
<br>
In the mpif.h I found:<br>
INTEGER MPI_ADDRESS_KIND, MPI_OFFSET_KIND<br>
PARAMETER (MPI_ADDRESS_KIND=8)<br>
PARAMETER (MPI_OFFSET_KIND=8)<br>
<br>
There is a mistake.<br>
<br>
Do you have any idea to help me??<br>
<br>
With 32 bit MPICH2 and 32 bit code I don't have error.<br>
If I try mpiexec -n 1 code_64bit.exe , the 64 bit code works fine.<br>
<br>
Thank you,<br>
regards,<br>
<br>
<br>
--<br>
<br>
<br>
Ing. Marco De Gregorio<br>
Microwave & Radiation Laboratory<br>
Dip. Ingegneria dell'Informazione - Universitą di Pisa<br>
via G. Caruso 16, 56122 Pisa - Italy<br>
Lab: <a href="tel:%28%2B39%29050.2217681" value="+390502217681" target="_blank">(+39)050.2217681</a><br>
Mail: <a href="mailto:marco.degregorio@iet.unipi.it" target="_blank">marco.degregorio@iet.unipi.it</a><br>
<br>
<br>
</div></div>_______________________________________________<br>
mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
</blockquote></div><br></div>