Ignore:
Timestamp:
Mar 14, 2018 8:33:20 AM (3 years ago)
Author:
scharf
Message:

Bugfix: corrected KIND of variable "parsize" for some MPI calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/pmc_particle_interface.f90

    r2841 r2884  
    2626! -----------------!
    2727! $Id$
     28! B: corrected KIND of variable "parsize" for some MPI calls
     29!
     30! 2841 2018-02-27 15:02:57Z knoop
    2831! Bugfix: wrong placement of include 'mpif.h' corrected
    2932!
     
    233236    INTEGER(iwp) ::  nr_childs !< Number of child models of the current model
    234237   
    235     INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
     238    INTEGER ::  parsize !<
     239    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
    236240    INTEGER(KIND=MPI_ADDRESS_KIND) ::  winsize !<
    237241    TYPE(C_PTR), SAVE ::  ptr !<
     
    245249    IF ( cpl_id > 1 )  THEN
    246250
    247        parsize = STORAGE_SIZE(zero_particle)/8
    248 
    249        CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr )
     251       parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
     252
     253       CALL MPI_ALLOC_MEM( parsize_mpi_address_kind , MPI_INFO_NULL, ptr, ierr )
     254       parsize = parsize_mpi_address_kind
    250255       buf_shape(1) = 1
    251256       CALL C_F_POINTER( ptr, win_buffer, buf_shape )
    252        CALL MPI_WIN_CREATE( win_buffer, parsize, parsize,     &
     257       CALL MPI_WIN_CREATE( win_buffer, parsize_mpi_address_kind, parsize,     &
    253258                            MPI_INFO_NULL, me%intra_comm, particle_win_child,  &
    254259                            ierr )
     
    261266       jcn = coarse_bound(4)
    262267
    263 !        ALLOCATE( coarse_particles(jcs:jcn, icl:icr) )
     268       ALLOCATE( coarse_particles(jcs:jcn, icl:icr) )
    264269
    265270       coarse_particles(:,:)%nr_particle = 0
     
    274279       DO  m = 1, nr_childs
    275280          child_id = get_childid(m)
    276           parsize = STORAGE_SIZE(zero_particle)/8
    277 
    278           winsize = max_nr_particle_in_rma_win * parsize
     281          parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
     282          parsize = parsize_mpi_address_kind
     283
     284          winsize = max_nr_particle_in_rma_win * parsize_mpi_address_kind
    279285          CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr )
    280286          buf_shape(1) = max_nr_particle_in_rma_win
    281287          CALL C_F_POINTER( buf_ptr(m), win_buffer, buf_shape )
    282           CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, &
    283                                MPI_INFO_NULL, children(child_id)%intra_comm,   &
     288          CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, MPI_INFO_NULL,    &
     289                               children(child_id)%intra_comm,                  &
    284290                               particle_win_parent(m), ierr )
    285291          ENDDO
     
    306312    INTEGER(iwp) ::  nr   !< number of particles to receive from a parent box
    307313   
    308     INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
     314    INTEGER ::  parsize !<
     315    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
    309316    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
    310317   
     
    337344
    338345                 CALL check_and_alloc_coarse_particle (i, j, nr)
    339                  parsize = STORAGE_SIZE(zero_particle)/8
     346                 parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
     347                 parsize = parsize_mpi_address_kind
    340348                 target_disp = part_adrc(j,i) - 1
    341                  CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
     349                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0,               &
     350                                    particle_win_child, ierr )
    342351                 CALL MPI_GET( coarse_particles(j,i)%parent_particles,         &
    343                                nr * parsize, MPI_BYTE, ip - 1,    &
    344                                target_disp, nr * parsize,         &
    345                                MPI_BYTE, particle_win_child, ierr )
     352                               nr * parsize, MPI_BYTE, ip - 1, target_disp,    &
     353                               nr * parsize, MPI_BYTE, particle_win_child, ierr )
    346354                 CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
    347355             ENDIF
     
    379387    INTEGER(iwp) ::  pe_offset              !< offset index of the current PE
    380388   
    381     INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
     389    INTEGER ::  parsize !<
     390    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
    382391    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
    383392   
     
    429438       max_nr_particle_per_pe = max_nr_particle_in_rma_win / ( n * n )
    430439       disp_offset            = pe_offset * max_nr_particle_per_pe
    431        parsize = STORAGE_SIZE(zero_particle)/8
     440       parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
     441       parsize = parsize_mpi_address_kind
    432442       DO  ip = 1, me%inter_npes
    433443
     
    447457                   CALL message( 'pmci_create_child_arrays', 'PA0480', 3, 2, 0, 6, 0 )   ! PA number has to be adjusted
    448458                ENDIF
    449                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
     459                CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0,                &
     460                                   particle_win_child, ierr )
    450461                CALL MPI_PUT( coarse_particles(j,i)%parent_particles,          &
    451                               nr * parsize, MPI_BYTE, ip - 1,     &
    452                               target_disp, nr * parsize ,         &
    453                               MPI_BYTE, particle_win_child, ierr )
     462                              nr * parsize, MPI_BYTE, ip - 1, target_disp,     &
     463                              nr * parsize, MPI_BYTE,  particle_win_child, ierr )
    454464                CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
    455465                part_adrc(j,i) = target_disp + 1
Note: See TracChangeset for help on using the changeset viewer.