Changeset 2807 for palm/trunk/SOURCE/pmc_particle_interface.f90
- Timestamp:
- Feb 14, 2018 5:24:14 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_particle_interface.f90
r2801 r2807 26 26 ! ----------------- 27 27 ! 28 ! Bugfixes gfortran c_sizeof 29 ! 30 ! 28 31 ! Initial Version (by Klaus Ketelsen) 29 32 ! … … 219 222 INTEGER(iwp) :: nr_childs !< Number of child models of the current model 220 223 224 INTEGER(KIND=MPI_ADDRESS_KIND) :: parsize !< 221 225 INTEGER(KIND=MPI_ADDRESS_KIND) :: winsize !< 222 223 226 TYPE(C_PTR), SAVE :: ptr !< 224 227 … … 230 233 !-- If the model has a parent model prepare the structures for transfer 231 234 IF ( cpl_id > 1 ) THEN 232 winsize = C_SIZEOF (zero_particle) 233 CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, ptr, ierr ) 235 #if defined( __gfortran ) 236 ! 237 !-- For the gfortran compiler the function c_sizeof produces strange erros 238 !-- which can probably be attributed to an error in the gfortran compiler. 239 !-- Therefore the particle size in bytes is set manually. Attention: A 240 !-- change of the size of the particle type requires an adjustment of 241 !-- this value 242 parsize = 184 243 #else 244 parsize = C_SIZEOF (zero_particle) 245 #endif 246 CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr ) 234 247 buf_shape(1) = 1 235 248 CALL C_F_POINTER( ptr, win_buffer, buf_shape ) 236 CALL MPI_WIN_CREATE( win_buffer, winsize, C_SIZEOF (zero_particle), &249 CALL MPI_WIN_CREATE( win_buffer, parsize, parsize, & 237 250 MPI_INFO_NULL, me%intra_comm, particle_win_child, & 238 251 ierr ) … … 258 271 DO m = 1, nr_childs 259 272 child_id = get_childid(m) 260 261 winsize = max_nr_particle_in_rma_win * C_SIZEOF( zero_particle ) 273 #if defined( __gfortran ) 274 ! 275 !-- For the gfortran compiler the function c_sizeof produces strange erros 276 !-- which can probably be attributed to an error in the gfortran compiler. 277 !-- Therefore the particle size in bytes is set manually. Attention: A 278 !-- change of the size of the particle type requires an adjustment of 279 !-- this value 280 parsize = 184 281 #else 282 parsize = C_SIZEOF (zero_particle) 283 #endif 284 winsize = max_nr_particle_in_rma_win * parsize 262 285 CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr ) 263 286 buf_shape(1) = max_nr_particle_in_rma_win 264 287 CALL C_F_POINTER( buf_ptr(m), win_buffer, buf_shape ) 265 CALL MPI_WIN_CREATE( win_buffer, winsize, C_SIZEOF( zero_particle ), &288 CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, & 266 289 MPI_INFO_NULL, children(child_id)%intra_comm, & 267 290 particle_win_parent(m), ierr )
Note: See TracChangeset
for help on using the changeset viewer.