next up previous
Next: Code for communicating the Up: Redistribution of block-cyclic data Previous: Creating the general datatype

Code for creating the general datatype


Creating the General datatype

   integer disp(2), blen(2), type(2)
   integer blocktype, newtype
   integer sizeoftype, nsuperblks

   call mpi_type_contiguous (r, dtype,
                             blocktype, ierr)
   call mpi_type_extent (dtype, sizeoftype, ierr)
   nsuperblks = m/(p*k*r)
   disp(1) = 0
   disp(2) = sizeoftype*k*r
   type(1) = blocktype
   type(2) = MPI_UB
   blen(1) = 1
   blen(2) = 1
   
   call mpi_type_struct (2, blen, disp,
                         type, newtype,ierr)
   call mpi_type_commit (newtype, ierr)



David W Walker
Mon Jan 20 11:10:22 GMT 1997