source: trunk/tradit_spectral_model/PROJECTS/trivial/create_mpi_data_type.f @ 2

Last change on this file since 2 was 2, checked in by xlvlod, 17 years ago

initial import from /home2/xlvlod/IDRIS/SVN_BASE_TRUNK

File size: 1.2 KB
Line 
1      subroutine create_MPI_data_type(nx,ny,nz,locnx,locnz,
2     *                                twoslice,subslice,myid,comm)
3 
4c     Routine to create a specialized data type for MPI data swaps
5c     between processors. See real and complex data maps for details.
6 
7      implicit none
8#include "mpif.h"
9      integer nx,ny,nz,locnx,locnz
10      integer myid,comm,ierr
11      integer sizeofreal,oneslice,twoslice,subslice
12
13      call MPI_TYPE_EXTENT(MPI_REAL,sizeofreal,ierr)
14
15
16c     data type for 1d section of basic data slice: 2*locnx
17      call MPI_TYPE_VECTOR(2*locnx,1,1,MPI_REAL,oneslice,ierr)
18
19c     data type for 2d section of basic data slice: ny+1 1d sections
20      call MPI_TYPE_HVECTOR(ny+1,1,(nx+2)*sizeofreal,oneslice,twoslice,ierr)
21      if( myid .eq. 0 ) then
22       if( ierr .ne. 0 ) write(6,*) ' TYPE_HVECTOR twoslice failure'
23      endif
24      call MPI_TYPE_COMMIT(twoslice,ierr)
25
26c     data type for 3d section of basic data slice: locnz 2d sections
27      call MPI_TYPE_HVECTOR(locnz,1,(nx+2)*(ny+1)*sizeofreal,
28     *                      twoslice,subslice,ierr)
29      if( myid .eq. 0 ) then
30       if( ierr .ne. 0 ) write(6,*) ' TYPE_HVECTOR subslice failure'
31      endif
32      call MPI_TYPE_COMMIT(subslice,ierr)
33
34      return
35      end
Note: See TracBrowser for help on using the repository browser.