This source file includes following definitions.
- ADIO_Set_view
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 #include "adio.h"
   9 #include "adio_extern.h"
  10 
  11 
  12 
  13 
  14 
  15 void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, 
  16                 MPI_Datatype filetype, MPI_Info info,  int *error_code) 
  17 {
  18         int combiner, i, j, k, err, filetype_is_contig;
  19         MPI_Datatype copy_etype, copy_filetype;
  20         ADIOI_Flatlist_node *flat_file;
  21         
  22 
  23 
  24         MPI_Type_get_envelope(fd->etype, &i, &j, &k, &combiner);
  25         if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->etype));
  26 
  27         ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
  28         if (!filetype_is_contig) ADIOI_Delete_flattened(fd->filetype);
  29 
  30         MPI_Type_get_envelope(fd->filetype, &i, &j, &k, &combiner);
  31         if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->filetype));
  32 
  33         
  34         ADIO_SetInfo(fd, info, &err);
  35 
  36         
  37 
  38         ADIOI_Type_get_envelope(etype, &i, &j, &k, &combiner);
  39         if (combiner == MPI_COMBINER_NAMED) fd->etype = etype;
  40         else {
  41             MPI_Type_contiguous(1, etype, ©_etype);
  42             MPI_Type_commit(©_etype);
  43             fd->etype = copy_etype;
  44         }
  45         ADIOI_Type_get_envelope(filetype, &i, &j, &k, &combiner);
  46         if (combiner == MPI_COMBINER_NAMED) 
  47             fd->filetype = filetype;
  48         else {
  49             MPI_Type_contiguous(1, filetype, ©_filetype);
  50             MPI_Type_commit(©_filetype);
  51             fd->filetype = copy_filetype;
  52             ADIOI_Flatten_datatype(fd->filetype);
  53             
  54 
  55         }
  56 
  57         MPI_Type_size_x(fd->etype, &(fd->etype_size));
  58         fd->disp = disp;
  59 
  60         
  61 
  62 
  63         ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
  64         if (filetype_is_contig) fd->fp_ind = disp;
  65         else {
  66             flat_file = ADIOI_Flatlist;
  67             while (flat_file->type != fd->filetype) 
  68                 flat_file = flat_file->next;
  69             for (i=0; i<flat_file->count; i++) {
  70                 if (flat_file->blocklens[i]) {
  71                     fd->fp_ind = disp + flat_file->indices[i];
  72                     break;
  73                 }
  74             }
  75         }
  76         *error_code = MPI_SUCCESS;
  77 }