Loading src/MatrixTypes_Native.f90 +8 −9 Original line number Diff line number Diff line Loading @@ -1973,9 +1973,9 @@ SUBROUTINE writematrix_DenseSquareMatrixType(matrix,format_mode,file_mode,filen TYPE(FortranFileType) :: matrix_file INTEGER(SIK) :: i,j INTEGER(SIK) :: file_format,matrix_type REQUIRE(matrix%isInit) CHARACTER(LEN=80) :: tmpfilename REQUIRE(matrix%isInit) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN file_format=format_mode Loading Loading @@ -2277,14 +2277,14 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, REAL(SRK),ALLOCATABLE :: tmpval(:) REAL(SRK) :: realvalue TYPE(FortranFileType) :: matrix_file REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) INTEGER(KIND=MPI_OFFSET_KIND) ::baseoffset ! Note it is assume that the number of elements is smaller than 10^14 character(len=50), ALLOCATABLE :: text(:) CHARACTER(LEN=80):: tmpfilename INTEGER(SIK) :: file_format REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN Loading Loading @@ -2327,7 +2327,7 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, CALL MPI_File_open(MPI_COMM_WORLD, TRIM(tmpfilename),& MPI_MODE_APPEND+MPI_MODE_WRONLY, MPI_INFO_NULL, filehdl,mpierr) call MPI_FILE_GET_POSITION(filehdl,baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) nBatch=MIN(10000,matrix%nLocal) ALLOCATE(text(nBatch)) icounter=0 Loading Loading @@ -2416,7 +2416,7 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, !WRITE CALL MPI_FILE_GET_POSITION(filehdl, baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) baseoffset = baseoffset+writeoffset(rank+1) * SIK CALL MPI_File_write_at_all(filehdl,baseoffset, tmpiarray, nLocal, & MPI_INTEGER, MPI_STATUS_IGNORE,mpierr) Loading Loading @@ -2457,14 +2457,13 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file REAL(SRK),ALLOCATABLE :: tmpval(:) REAL(SRK) :: realvalue TYPE(FortranFileType) :: matrix_file REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) INTEGER(KIND=MPI_OFFSET_KIND) ::baseoffset ! Note it is assume that the number of elements is smaller than 10^14 character(len=50), ALLOCATABLE :: text(:) CHARACTER(LEN=80):: tmpfilename INTEGER(SIK) :: file_format REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN Loading Loading @@ -2509,7 +2508,7 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file CALL MPI_File_open(MPI_COMM_WORLD, TRIM(tmpfilename),& MPI_MODE_APPEND+MPI_MODE_WRONLY, MPI_INFO_NULL, filehdl,mpierr) call MPI_FILE_GET_POSITION(filehdl,baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) nBatch=MIN(10000,nLocal) ALLOCATE(text(nBatch)) icounter=0 Loading Loading @@ -2625,7 +2624,7 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file ! !WRITE CALL MPI_FILE_GET_POSITION(filehdl, baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) baseoffset = baseoffset+writeoffset(rank+1) * SIK CALL MPI_File_write_at_all(filehdl,baseoffset, tmpiarray, nLocal, & MPI_INTEGER, MPI_STATUS_IGNORE,mpierr) Loading unit_tests/testMatrixTypes/testMatrixTypes.f90 +4 −4 Original line number Diff line number Diff line Loading @@ -830,7 +830,7 @@ SUBROUTINE testMatrix() CALL mat%set(4,4,4.0_SRK) ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) ! Test both the VectorType and native interfaces IF(ALLOCATED(dummyvec)) DEALLOCATE(dummyvec) ALLOCATE(dummyvec(4)) Loading Loading @@ -1232,7 +1232,7 @@ SUBROUTINE testMatrix() ASSERT(bool, 'tridiag%get(...)') !column three check ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) !test with out of bounds i,j, make sure no crash. SELECT TYPE(thisMatrix) TYPE IS(TriDiagMatrixType) Loading Loading @@ -1516,7 +1516,7 @@ SUBROUTINE testMatrix() ENDDO ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) ! Check for non-trivial vector dummyvec=(/1._SRK,2._SRK,3._SRK,4._SRK/) SELECT TYPE(thisMatrix) Loading Loading @@ -1628,7 +1628,7 @@ SUBROUTINE testMatrix() ENDDO ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) !Test BLAS_matvec COMPONENT_TEST("denseRect%matvec") x=1.0_SRK Loading unit_tests/testMatrixTypes/testMatrixTypesParallel.f90 +2 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ SUBROUTINE testDistrBandMatrix() CALL thisMatrix%set(3,5,9._SRK) CALL thisMatrix%assemble() CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) SELECTTYPE(thisMatrix) TYPE IS(DistributedBandedMatrixType) IF(rank == 0) THEN Loading Loading @@ -598,7 +598,7 @@ SUBROUTINE testDistrBlockBandMatrix() CALL thisMatrix%set(6,6,1._SRK) CALL thisMatrix%assemble() CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) IF(ALLOCATED(distrVec1)) DEALLOCATE(distrVec1) IF(ALLOCATED(distrVec2)) DEALLOCATE(distrVec2) ALLOCATE(NativeDistributedVectorType :: distrVec1) Loading Loading
src/MatrixTypes_Native.f90 +8 −9 Original line number Diff line number Diff line Loading @@ -1973,9 +1973,9 @@ SUBROUTINE writematrix_DenseSquareMatrixType(matrix,format_mode,file_mode,filen TYPE(FortranFileType) :: matrix_file INTEGER(SIK) :: i,j INTEGER(SIK) :: file_format,matrix_type REQUIRE(matrix%isInit) CHARACTER(LEN=80) :: tmpfilename REQUIRE(matrix%isInit) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN file_format=format_mode Loading Loading @@ -2277,14 +2277,14 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, REAL(SRK),ALLOCATABLE :: tmpval(:) REAL(SRK) :: realvalue TYPE(FortranFileType) :: matrix_file REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) INTEGER(KIND=MPI_OFFSET_KIND) ::baseoffset ! Note it is assume that the number of elements is smaller than 10^14 character(len=50), ALLOCATABLE :: text(:) CHARACTER(LEN=80):: tmpfilename INTEGER(SIK) :: file_format REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN Loading Loading @@ -2327,7 +2327,7 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, CALL MPI_File_open(MPI_COMM_WORLD, TRIM(tmpfilename),& MPI_MODE_APPEND+MPI_MODE_WRONLY, MPI_INFO_NULL, filehdl,mpierr) call MPI_FILE_GET_POSITION(filehdl,baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) nBatch=MIN(10000,matrix%nLocal) ALLOCATE(text(nBatch)) icounter=0 Loading Loading @@ -2416,7 +2416,7 @@ SUBROUTINE writematrix_DistributedBandedMatrixType(matrix,format_mode,file_mode, !WRITE CALL MPI_FILE_GET_POSITION(filehdl, baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) baseoffset = baseoffset+writeoffset(rank+1) * SIK CALL MPI_File_write_at_all(filehdl,baseoffset, tmpiarray, nLocal, & MPI_INTEGER, MPI_STATUS_IGNORE,mpierr) Loading Loading @@ -2457,14 +2457,13 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file REAL(SRK),ALLOCATABLE :: tmpval(:) REAL(SRK) :: realvalue TYPE(FortranFileType) :: matrix_file REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) INTEGER(KIND=MPI_OFFSET_KIND) ::baseoffset ! Note it is assume that the number of elements is smaller than 10^14 character(len=50), ALLOCATABLE :: text(:) CHARACTER(LEN=80):: tmpfilename INTEGER(SIK) :: file_format REQUIRE(matrix%isInit) REQUIRE(matrix%isAssembled) file_format=ASCII_MATLAB IF(PRESENT(format_mode)) THEN Loading Loading @@ -2509,7 +2508,7 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file CALL MPI_File_open(MPI_COMM_WORLD, TRIM(tmpfilename),& MPI_MODE_APPEND+MPI_MODE_WRONLY, MPI_INFO_NULL, filehdl,mpierr) call MPI_FILE_GET_POSITION(filehdl,baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) nBatch=MIN(10000,nLocal) ALLOCATE(text(nBatch)) icounter=0 Loading Loading @@ -2625,7 +2624,7 @@ SUBROUTINE writematrix_DistributedBlockBandedMatrixType(matrix,format_mode,file ! !WRITE CALL MPI_FILE_GET_POSITION(filehdl, baseoffset,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET_KIND, 0,matrix%comm,mpierr) CALL MPI_Bcast(baseoffset, 1, MPI_OFFSET, 0,matrix%comm,mpierr) baseoffset = baseoffset+writeoffset(rank+1) * SIK CALL MPI_File_write_at_all(filehdl,baseoffset, tmpiarray, nLocal, & MPI_INTEGER, MPI_STATUS_IGNORE,mpierr) Loading
unit_tests/testMatrixTypes/testMatrixTypes.f90 +4 −4 Original line number Diff line number Diff line Loading @@ -830,7 +830,7 @@ SUBROUTINE testMatrix() CALL mat%set(4,4,4.0_SRK) ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) ! Test both the VectorType and native interfaces IF(ALLOCATED(dummyvec)) DEALLOCATE(dummyvec) ALLOCATE(dummyvec(4)) Loading Loading @@ -1232,7 +1232,7 @@ SUBROUTINE testMatrix() ASSERT(bool, 'tridiag%get(...)') !column three check ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) !test with out of bounds i,j, make sure no crash. SELECT TYPE(thisMatrix) TYPE IS(TriDiagMatrixType) Loading Loading @@ -1516,7 +1516,7 @@ SUBROUTINE testMatrix() ENDDO ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) ! Check for non-trivial vector dummyvec=(/1._SRK,2._SRK,3._SRK,4._SRK/) SELECT TYPE(thisMatrix) Loading Loading @@ -1628,7 +1628,7 @@ SUBROUTINE testMatrix() ENDDO ENDSELECT CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) !Test BLAS_matvec COMPONENT_TEST("denseRect%matvec") x=1.0_SRK Loading
unit_tests/testMatrixTypes/testMatrixTypesParallel.f90 +2 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ SUBROUTINE testDistrBandMatrix() CALL thisMatrix%set(3,5,9._SRK) CALL thisMatrix%assemble() CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) SELECTTYPE(thisMatrix) TYPE IS(DistributedBandedMatrixType) IF(rank == 0) THEN Loading Loading @@ -598,7 +598,7 @@ SUBROUTINE testDistrBlockBandMatrix() CALL thisMatrix%set(6,6,1._SRK) CALL thisMatrix%assemble() CALL thisMatrix%writematrix() CALL thisMatrix%writematrix(Format_Model=2) CALL thisMatrix%writematrix(Format_Mode=2) IF(ALLOCATED(distrVec1)) DEALLOCATE(distrVec1) IF(ALLOCATED(distrVec2)) DEALLOCATE(distrVec2) ALLOCATE(NativeDistributedVectorType :: distrVec1) Loading