[mpich-discuss] MPI 64 bit for 64 bit code on windows7 64 bit

Marco De Gregorio marco.degregorio at iet.unipi.it
Tue Sep 25 07:01:35 CDT 2012


Hi,

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


This is the subroutine:

!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> SUBROUTINE Build_MPI_near_field_type(var_name,MY_MPI_near_field_type)
>
> !:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>  TYPE(near_field_var), INTENT(IN) :: var_name
> INTEGER, INTENT(IN) :: MY_MPI_near_field_type
> INTEGER, PARAMETER :: SIZE = 4
>  INTEGER(KIND = MPI_ADDRESS_KIND) :: address(SIZE)
> INTEGER(KIND = MPI_ADDRESS_KIND) :: displs(SIZE)
>  INTEGER :: type_list(SIZE), block_lenghts(SIZE), MY_MPI_error
> !generate type_list
> type_list(1) =  MPI_REAL
>  type_list(2) =  MPI_REAL
> type_list(3) =  MPI_REAL
> type_list(4) =  MPI_INTEGER
>


 ! in the 64bit version, after last MPI_GET_ADDRESS it change
> !the value of block_lenghts(1) in -1. I moved it under
>  !Fill block_lengths
> !block_lenghts(:) = 1
>

        !get addresses
> CALL MPI_GET_ADDRESS(var_name%distance,address(1),MY_MPI_error)
>  CALL MPI_GET_ADDRESS(var_name%min_distance,address(2),MY_MPI_error)
> CALL MPI_GET_ADDRESS(var_name%max_distance,address(3),MY_MPI_error)
>  CALL MPI_GET_ADDRESS(var_name%flag,address(4),MY_MPI_error)
> !Compute displacement
> displs(1) = 0
>  displs(2) = address(2) - address(1)
> displs(3) = address(3) - address(1)
> displs(4) = address(4) - address(1)
>         WRITE (*,*) MPI_ADDRESS_KIND
>
>         !Fill block_lengths
> block_lenghts(:) = 1
>


        CALL
> MPI_TYPE_CREATE_STRUCT(SIZE,block_lenghts,displs,type_list,MY_MPI_near_field_type,MY_MPI_error)
> CALL MPI_TYPE_COMMIT(MY_MPI_near_field_type,MY_MPI_error)
>
> END SUBROUTINE


This is the call in other sub:

> !Near field (for sparfied matrix)
> CALL Build_MPI_near_field_type(var_name%near_field,MY_MPI_near_field_type)


I defined

> TYPE(project_var), INTENT(IN) :: var_name
> INTEGER, INTENT(IN) :: MY_MPI_near_field_type


Where in a module I defined:

>  TYPE :: project_var
>      TYPE(near_field_var)  :: near_field
>      TYPE(ground_var) :: ground
>      ...
>  END TYPE project_var


and

> TYPE :: near_field_var
>      REAL(KIND=SGL) :: distance, min_distance, max_distance
>      INTEGER  :: flag
> END TYPE near_field_var


In another module:

INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6,r=37)



p.s. of course. The 64 bit code doesn't work with 32 bit MPICH2, the
builder returned error in link procedure.

Ing. Marco De Gregorio
Microwave & Radiation Laboratory
Dip. Ingegneria dell'Informazione - Università di Pisa
via G. Caruso 16, 56122 Pisa - Italy
*Lab*: (+39)050.2217681
*Cell*: (+39)3281982575
*Mail*: marco.degregorio at iet.unipi.it



2012/9/24 Jayesh Krishna <jayesh at mcs.anl.gov>

> Hi,
>  Can you send us a test program (source code) that fails?
>
> (PS: I am assuming that you recompiled your code after installing the
> 64-bit libs.)
> Regards,
> Jayesh
>
> ----- Original Message -----
> From: "Marco De Gregorio" <marco.degregorio at iet.unipi.it>
> To: mpich-discuss at mcs.anl.gov
> Sent: Monday, September 24, 2012 11:21:46 AM
> Subject: [mpich-discuss] MPI 64 bit for 64 bit code on windows7 64 bit
>
>
> Hi,
>
> I work with a Fortran code. I use Visual Studio 2008 and Intel Fortran 11.
> I have always used 32 bit MPI successfully.
> 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.
> I have several problems.
> 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.
>
> block_lengths(:) = 1
>
> !get addresses
> CALL MPI_GET_ADDRESS(var_name%distance,address(1),MY_MPI_error)
> CALL MPI_GET_ADDRESS(var_name%min_distance,address(2),MY_MPI_error)
> CALL MPI_GET_ADDRESS(var_name%max_distance,address(3),MY_MPI_error)
> CALL MPI_GET_ADDRESS(var_name%flag,address(4),MY_MPI_error)
>
> 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.
>
> address is defined as INTEGER(KIND = MPI_ADDRESS_KIND) :: address(SIZE) ,
> but write(*,*) MPI_GET_ADDRESS returns 4.
>
> In the mpif.h I found:
> INTEGER MPI_ADDRESS_KIND, MPI_OFFSET_KIND
> PARAMETER (MPI_ADDRESS_KIND=8)
> PARAMETER (MPI_OFFSET_KIND=8)
>
> There is a mistake.
>
> Do you have any idea to help me??
>
> With 32 bit MPICH2 and 32 bit code I don't have error.
> If I try mpiexec -n 1 code_64bit.exe , the 64 bit code works fine.
>
> Thank you,
> regards,
>
>
> --
>
>
> Ing. Marco De Gregorio
> Microwave & Radiation Laboratory
> Dip. Ingegneria dell'Informazione - Università di Pisa
> via G. Caruso 16, 56122 Pisa - Italy
> Lab: (+39)050.2217681
> Mail: marco.degregorio at iet.unipi.it
>
>
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120925/c2eb574a/attachment-0001.html>


More information about the mpich-discuss mailing list