[MPICH] MPI_Type_create_resized problems

Rajeev Thakur thakur at mcs.anl.gov
Tue Mar 21 12:13:21 CST 2006


You are doing it correctly. The ROMIO code has probably not been updated to
understand type_resized, which was added in MPICH2. You may want to just
continue to use the struct version for now. If all the datatypes are the
same, you may be able to use MPI_Type_vector or type_indexed.

Rajeev 


> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov 
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of James S Perrin
> Sent: Tuesday, March 21, 2006 9:20 AM
> To: mpich
> Subject: [MPICH] MPI_Type_create_resized problems
> 
> Hi,
> 	I am trying to read some interlaced values from file
> 
> ABCABCABC....
> 
> where A B and C are all say floats. I had previously used the 
> following 
> deprecated code (that still works):
> 
>      types[0] = MPI_FLOAT;
>      types[1] = MPI_UB;
>      lens[0] = 1;
>      lens[1] = 1;
>      displs[0] = 0;
>      displs[1] = file_extent*3;
>      MPI_Type_struct(2, lens, displs, types, &filetype);
>      MPI_Type_commit(&filetype);
> 
> where file_extent is the size of a float in the file. I would 
> like to use the 
> newer MPI2 version:
> 
>      MPI_Type_create_resized(MPI_FLOAT, 0, file_extent*3, &filetype);
>      MPI_Type_commit(&filetype);
> 
> But I get a failure when trying to set my file view. I use 
> disp to move the to 
> first A,B or C. :
> 
>      MPI_File_set_view(fp, disp, MPI_FLOAT, filetype, 
> "native", MPI_INFO_NULL);
> 
>   => Error: Unsupported datatype passed to 
> ADIOI_Count_contiguous_blocks
> 
> Both filetypes look the same:
> 
> MPI_Type_extent 12
> MPI_Type_size 4
> MPI_Type_lb 0
> MPI_Type_ub 12
> 
> Are there any limitations in using MPI_Type_create_resized 
> for Data IO 
> especially on Windows (NTFS) or do I have a bug in my code?
> 
> Regards
> James
> -- 
> --------------------------------------------------------------
> ---------------
> James S. Perrin,                   | email: 
> james.perrin at manchester.ac.uk
> Manchester Visualization Centre,   | 
> www.sve.man.ac.uk/General/Staff/perrin
> Kilburn Building, The University,  | tel: +44 161 275 6945
> Manchester, England. M13 9PL.      | fax: +44 161 275 6800/6040
> --------------------------------------------------------------
> ---------------
> "The test of intellect is the refusal to belabour the 
> obvious" -Alfred Bester
> --------------------------------------------------------------
> ---------------
> 
> 




More information about the mpich-discuss mailing list