@@ -91,7 +91,7 @@ int mca_common_ompio_file_open (ompi_communicator_t *comm,
9191 ompio_fh -> f_info = info ;
9292 ompio_fh -> f_atomicity = 0 ;
9393
94- ompi_io_ompio_set_file_defaults (ompio_fh );
94+ mca_common_ompio_set_file_defaults (ompio_fh );
9595 ompio_fh -> f_filename = filename ;
9696
9797 ompio_fh -> f_split_coll_req = NULL ;
@@ -105,9 +105,6 @@ int mca_common_ompio_file_open (ompi_communicator_t *comm,
105105 ompio_fh -> f_decode_datatype = ompi_io_ompio_decode_datatype ;
106106 ompio_fh -> f_generate_current_file_view = ompi_io_ompio_generate_current_file_view ;
107107
108- ompio_fh -> f_sort = ompi_io_ompio_sort ;
109- ompio_fh -> f_sort_iovec = ompi_io_ompio_sort_iovec ;
110-
111108 ompio_fh -> f_get_num_aggregators = mca_io_ompio_get_num_aggregators ;
112109 ompio_fh -> f_get_bytes_per_agg = mca_io_ompio_get_bytes_per_agg ;
113110 ompio_fh -> f_set_aggregator_props = mca_io_ompio_set_aggregator_props ;
@@ -377,4 +374,78 @@ int mca_common_ompio_file_get_position (mca_io_ompio_file_t *fh,
377374 return OMPI_SUCCESS ;
378375}
379376
377+ int mca_common_ompio_set_file_defaults (mca_io_ompio_file_t * fh )
378+ {
379+
380+ if (NULL != fh ) {
381+ ompi_datatype_t * types [2 ];
382+ int blocklen [2 ] = {1 , 1 };
383+ OPAL_PTRDIFF_TYPE d [2 ], base ;
384+ int i ;
385+
386+ fh -> f_io_array = NULL ;
387+ fh -> f_perm = OMPIO_PERM_NULL ;
388+ fh -> f_flags = 0 ;
389+ fh -> f_bytes_per_agg = mca_io_ompio_bytes_per_agg ;
390+ fh -> f_datarep = strdup ("native" );
391+
392+ fh -> f_offset = 0 ;
393+ fh -> f_disp = 0 ;
394+ fh -> f_position_in_file_view = 0 ;
395+ fh -> f_index_in_file_view = 0 ;
396+ fh -> f_total_bytes = 0 ;
397+
398+ fh -> f_init_procs_per_group = -1 ;
399+ fh -> f_init_procs_in_group = NULL ;
400+
401+ fh -> f_procs_per_group = -1 ;
402+ fh -> f_procs_in_group = NULL ;
403+
404+ fh -> f_init_num_aggrs = -1 ;
405+ fh -> f_init_aggr_list = NULL ;
406+
407+
408+ /* Default file View */
409+ fh -> f_iov_type = MPI_DATATYPE_NULL ;
410+ fh -> f_stripe_size = mca_io_ompio_bytes_per_agg ;
411+ /*Decoded iovec of the file-view*/
412+ fh -> f_decoded_iov = NULL ;
413+ fh -> f_etype = NULL ;
414+ fh -> f_filetype = NULL ;
415+ fh -> f_orig_filetype = NULL ;
416+
417+ mca_common_ompio_set_view (fh ,
418+ 0 ,
419+ & ompi_mpi_byte .dt ,
420+ & ompi_mpi_byte .dt ,
421+ "native" ,
422+ fh -> f_info );
423+
424+
425+ /*Create a derived datatype for the created iovec */
426+ types [0 ] = & ompi_mpi_long .dt ;
427+ types [1 ] = & ompi_mpi_long .dt ;
428+
429+ d [0 ] = (OPAL_PTRDIFF_TYPE ) fh -> f_decoded_iov ;
430+ d [1 ] = (OPAL_PTRDIFF_TYPE ) & fh -> f_decoded_iov [0 ].iov_len ;
431+
432+ base = d [0 ];
433+ for (i = 0 ; i < 2 ; i ++ ) {
434+ d [i ] -= base ;
435+ }
436+
437+ ompi_datatype_create_struct (2 ,
438+ blocklen ,
439+ d ,
440+ types ,
441+ & fh -> f_iov_type );
442+ ompi_datatype_commit (& fh -> f_iov_type );
443+
444+ return OMPI_SUCCESS ;
445+ }
446+ else {
447+ return OMPI_ERROR ;
448+ }
449+ }
450+
380451
0 commit comments