@@ -416,38 +416,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
416416 MPI_Aint mpi_lb = -1 , mpi_extent = -1 ;
417417 PVFS_offset pvfs_lb = -1 ;
418418 PVFS_size pvfs_extent = -1 ;
419- int has_lb_ub = 0 ;
420-
421- /* When converting into a PVFS_Request_struct, we no longer
422- * can use MPI_LB and MPI_UB. Therfore, we have to do the
423- * following.
424- * We simply ignore all the MPI_LB and MPI_UB types and
425- * get the lb and extent and pass it on through a
426- * PVFS resized_req */
427-
428- arr_count = 0 ;
429- for (i = 0 ; i < arr_int [0 ]; i ++ )
430- {
431- if (arr_dtype [i ] != MPI_LB &&
432- arr_dtype [i ] != MPI_UB )
433- {
434- arr_count ++ ;
435- }
436- }
437-
438- if (arr_int [0 ] != arr_count )
439- {
440- MPI_Type_get_extent (* mpi_dtype , & mpi_lb , & mpi_extent );
441- pvfs_lb = mpi_lb ;
442- pvfs_extent = mpi_extent ;
443- if ((pvfs_arr_len = ADIOI_Malloc (arr_count * sizeof (int )))
444- == NULL )
445- {
446- fprintf (stderr , "convert_mpi_pvfs2_dtype: "
447- "Failed to allocate pvfs_arr_len\n" );
448- }
449- has_lb_ub = 1 ;
450- }
419+ arr_count = arr_int [0 ];
451420
452421 if ((old_pvfs_dtype_arr
453422 = ADIOI_Malloc (arr_count * sizeof (PVFS_Request ))) == NULL )
@@ -464,70 +433,15 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
464433 arr_count = 0 ;
465434 for (i = 0 ; i < arr_int [0 ]; i ++ )
466435 {
467- if (arr_dtype [i ] != MPI_LB &&
468- arr_dtype [i ] != MPI_UB )
469- {
470436 leaf = convert_mpi_pvfs2_dtype (
471437 & arr_dtype [i ], & old_pvfs_dtype_arr [arr_count ]);
472438 if (leaf != 1 )
473439 MPI_Type_free (& arr_dtype [i ]);
474440 pvfs_arr_disp [arr_count ] =
475441 (PVFS_size ) arr_addr [i ];
476- if (has_lb_ub )
477- {
478- pvfs_arr_len [arr_count ] =
479- arr_int [i + 1 ];
480- }
481442 arr_count ++ ;
482- }
483443 }
484444
485- /* If a MPI_UB or MPI_LB did exist, we have to
486- * resize the datatype */
487- if (has_lb_ub )
488- {
489- PVFS_Request * tmp_pvfs_dtype = NULL ;
490- if ((tmp_pvfs_dtype = ADIOI_Malloc (sizeof (PVFS_Request ))) == NULL )
491- fprintf (stderr , "convert_mpi_pvfs2_dtype: "
492- "Failed to allocate PVFS_Request\n" );
493-
494- ret = PVFS_Request_struct (arr_count , pvfs_arr_len ,
495- pvfs_arr_disp ,
496- old_pvfs_dtype_arr , tmp_pvfs_dtype );
497- if (ret != 0 )
498- fprintf (stderr , "Error in PVFS_Request_struct\n" );
499-
500- arr_count = 0 ;
501- for (i = 0 ; i < arr_int [0 ]; i ++ )
502- {
503- if (arr_dtype [i ] != MPI_LB &&
504- arr_dtype [i ] != MPI_UB )
505- {
506- PVFS_Request_free (& old_pvfs_dtype_arr [arr_count ]);
507- arr_count ++ ;
508- }
509- }
510-
511- #ifdef DEBUG_DTYPE
512- fprintf (stderr , "STRUCT(WITHOUT %d LB or UB)(%d,[" ,
513- arr_int [0 ] - arr_count , arr_count );
514- for (i = 0 ; i < arr_count ; i ++ )
515- fprintf (stderr , "(%d,%Ld) " ,
516- pvfs_arr_len [i ],
517- pvfs_arr_disp [i ]);
518- fprintf (stderr , "]\n" );
519- fprintf (stderr , "RESIZED(LB = %Ld, EXTENT = %Ld)\n" ,
520- pvfs_lb , pvfs_extent );
521- #endif
522- ret = PVFS_Request_resized (* tmp_pvfs_dtype ,
523- pvfs_lb , pvfs_extent , pvfs_dtype );
524- if (ret != 0 )
525- fprintf (stderr , "Error in PVFS_Request_resize\n" );
526-
527- PVFS_Request_free (tmp_pvfs_dtype );
528- ADIOI_Free (tmp_pvfs_dtype );
529- }
530- else /* No MPI_LB or MPI_UB datatypes */
531445 {
532446 ret = PVFS_Request_struct (arr_int [0 ], & arr_int [1 ],
533447 pvfs_arr_disp ,
@@ -537,9 +451,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
537451
538452 for (i = 0 ; i < arr_int [0 ]; i ++ )
539453 {
540- if (arr_dtype [i ] != MPI_LB &&
541- arr_dtype [i ] != MPI_UB )
542- PVFS_Request_free (& old_pvfs_dtype_arr [i ]);
454+ PVFS_Request_free (& old_pvfs_dtype_arr [i ]);
543455 }
544456
545457#ifdef DEBUG_DTYPE
0 commit comments