diff --git a/Source/Fortran/PSMatrixModule.F90 b/Source/Fortran/PSMatrixModule.F90 index 82908e95..07726018 100644 --- a/Source/Fortran/PSMatrixModule.F90 +++ b/Source/Fortran/PSMatrixModule.F90 @@ -460,7 +460,11 @@ RECURSIVE SUBROUTINE ConstructMatrixFromMatrixMarket_ps(this, file_name, & & MAX_LINE_LENGTH*bytes_per_character IF (local_offset + local_data_size_plus_buffer .GT. & & total_file_size) THEN - local_data_size_plus_buffer = (total_file_size - local_offset) + local_data_size_plus_buffer = total_file_size - local_offset + END IF + IF (this%process_grid%global_rank .EQ. & + & this%process_grid%total_processors-1) THEN + local_data_size_plus_buffer = total_file_size - local_offset END IF ELSE local_data_size_plus_buffer = 0