diff --git a/Examples/ComplexMatrix/main.cc b/Examples/ComplexMatrix/main.cc index ecac3525..ecef25eb 100644 --- a/Examples/ComplexMatrix/main.cc +++ b/Examples/ComplexMatrix/main.cc @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) { // Setup the process grid. NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_rows, - process_columns, process_slices, true); + process_columns, process_slices); if (NTPoly::GetGlobalIsRoot()) { NTPoly::ActivateLogger(); } diff --git a/Examples/GraphTheory/main.cc b/Examples/GraphTheory/main.cc index abe996df..c1b4bf10 100644 --- a/Examples/GraphTheory/main.cc +++ b/Examples/GraphTheory/main.cc @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { // Setup the process grid. NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_rows, - process_columns, process_slices, true); + process_columns, process_slices); if (NTPoly::GetGlobalIsRoot()) { NTPoly::ActivateLogger(); } diff --git a/Examples/HydrogenAtom/main.cc b/Examples/HydrogenAtom/main.cc index 4a6c781b..895817d5 100644 --- a/Examples/HydrogenAtom/main.cc +++ b/Examples/HydrogenAtom/main.cc @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { // Setup the process grid. NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_rows, - process_columns, process_slices, true); + process_columns, process_slices); if (NTPoly::GetGlobalIsRoot()) { NTPoly::ActivateLogger(); } diff --git a/Examples/MatrixMaps/main.cc b/Examples/MatrixMaps/main.cc index 11288dbd..59cea7ef 100644 --- a/Examples/MatrixMaps/main.cc +++ b/Examples/MatrixMaps/main.cc @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) { } // Setup the process grid. - NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_slices, true); + NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_slices); if (NTPoly::GetGlobalIsRoot()) { NTPoly::ActivateLogger(); } diff --git a/Examples/PremadeMatrix/main.cc b/Examples/PremadeMatrix/main.cc index 6f086836..429aa3c7 100644 --- a/Examples/PremadeMatrix/main.cc +++ b/Examples/PremadeMatrix/main.cc @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { // Setup the process grid. NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_rows, - process_columns, process_slices, true); + process_columns, process_slices); if (NTPoly::GetGlobalIsRoot()) { NTPoly::ActivateLogger(); } diff --git a/Source/C/ProcessGrid_c.h b/Source/C/ProcessGrid_c.h index f9889411..3aa6ef14 100644 --- a/Source/C/ProcessGrid_c.h +++ b/Source/C/ProcessGrid_c.h @@ -4,13 +4,10 @@ void ConstructGlobalProcessGrid_wrp(const int *world_comm, const int *process_rows, const int *process_columns, - const int *process_slices, - const bool *be_verbose); + const int *process_slices); void ConstructGlobalProcessGrid_onlyslice_wrp(const int *world_comm, - const int *process_slices, - const bool *be_verbose); -void ConstructGlobalProcessGrid_default_wrp(const int *world_comm, - const bool *be_verbose); + const int *process_slices); +void ConstructGlobalProcessGrid_default_wrp(const int *world_comm); void CopyProcessGrid_wrp(const int *ih_old_grid, int *ih_new_grid); int GetGlobalMySlice_wrp(); int GetGlobalMyColumn_wrp(); diff --git a/Source/CPlusPlus/ProcessGrid.cc b/Source/CPlusPlus/ProcessGrid.cc index 6812432c..9ebbdeda 100644 --- a/Source/CPlusPlus/ProcessGrid.cc +++ b/Source/CPlusPlus/ProcessGrid.cc @@ -73,40 +73,36 @@ ProcessGrid::~ProcessGrid() { DestructProcessGrid_wrp(ih_this); } //////////////////////////////////////////////////////////////////////////////// void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_rows, - int process_columns, int process_slices, - bool be_verbose) { + int process_columns, int process_slices) { MPI_Fint temp_comm = MPI_Comm_c2f(world_comm); ConstructGlobalProcessGrid_wrp(&temp_comm, &process_rows, &process_columns, - &process_slices, &be_verbose); + &process_slices); } //////////////////////////////////////////////////////////////////////////////// void ConstructGlobalProcessGrid(int process_rows, int process_columns, - int process_slices, bool be_verbose) { + int process_slices) { MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD); ConstructGlobalProcessGrid_wrp(&temp_comm, &process_rows, &process_columns, - &process_slices, &be_verbose); + &process_slices); } //////////////////////////////////////////////////////////////////////////////// -void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices, - bool be_verbose) { +void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices) { MPI_Fint temp_comm = MPI_Comm_c2f(world_comm); - ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices, - &be_verbose); + ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices); } //////////////////////////////////////////////////////////////////////////////// -void ConstructGlobalProcessGrid(int process_slices, bool be_verbose) { +void ConstructGlobalProcessGrid(int process_slices) { MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD); - ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices, - &be_verbose); + ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices); } //////////////////////////////////////////////////////////////////////////////// -void ConstructGlobalProcessGrid(bool be_verbose) { +void ConstructGlobalProcessGrid() { MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD); - ConstructGlobalProcessGrid_default_wrp(&temp_comm, &be_verbose); + ConstructGlobalProcessGrid_default_wrp(&temp_comm); } //////////////////////////////////////////////////////////////////////////////// diff --git a/Source/CPlusPlus/ProcessGrid.h b/Source/CPlusPlus/ProcessGrid.h index f5f98803..419940c9 100644 --- a/Source/CPlusPlus/ProcessGrid.h +++ b/Source/CPlusPlus/ProcessGrid.h @@ -76,31 +76,24 @@ class ProcessGrid { //! \param[in] process_rows number of grid rows. //! \param[in] process_columns number of grid columns. //! \param[in] process_slices number of grid slices. -//! \param[in] be_verbose verbosity flag. void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_rows, - int process_columns, int process_slices, - bool be_verbose = false); + int process_columns, int process_slices); //! Construct the global process grid from comm world //! \param[in] process_rows number of grid rows. //! \param[in] process_columns number of grid columns. //! \param[in] process_slices number of grid slices. -//! \param[in] be_verbose verbosity flag. void ConstructGlobalProcessGrid(int process_rows, int process_columns, - int process_slices, bool be_verbose = false); + int process_slices); //! Construct the global process grid. //! \param[in] world_comm a communicator that every process in the grid is //! a part of. //! \param[in] process_slices number of grid slices. -//! \param[in] be_verbose verbosity flag. -void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices, - bool be_verbose = false); +void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices); //! Construct the global process grid from comm world //! \param[in] process_slices number of grid slices. -//! \param[in] be_verbose verbosity flag. -void ConstructGlobalProcessGrid(int process_slices, bool be_verbose = false); +void ConstructGlobalProcessGrid(int process_slices); //! Construct the global process grid from comm world -//! \param[in] be_verbose verbosity flag. -void ConstructGlobalProcessGrid(bool be_verbose = false); +void ConstructGlobalProcessGrid(); //! Get the slice of the current process. int GetGlobalMySlice(); //! Get the column of the current process. diff --git a/Source/Fortran/ProcessGridModule.F90 b/Source/Fortran/ProcessGridModule.F90 index 3d909477..94e1a814 100644 --- a/Source/Fortran/ProcessGridModule.F90 +++ b/Source/Fortran/ProcessGridModule.F90 @@ -82,7 +82,7 @@ MODULE ProcessGridModule CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Setup the default process grid. SUBROUTINE ConstructProcessGrid_full(world_comm, process_rows, & - & process_columns, process_slices, be_verbose_in) + & process_columns, process_slices) !> A communicator that every process in the grid is a part of. INTEGER, INTENT(IN) :: world_comm !> The number of grid rows. @@ -91,33 +91,18 @@ SUBROUTINE ConstructProcessGrid_full(world_comm, process_rows, & INTEGER, INTENT(IN) :: process_columns !> The number of grid slices. INTEGER, INTENT(IN) :: process_slices - !> Set true to print process grid info. - LOGICAL, INTENT(IN), OPTIONAL :: be_verbose_in - !! Local Data - LOGICAL :: be_verbose - - !! Process Optional Parameters - IF (PRESENT(be_verbose_in)) THEN - be_verbose = be_verbose_in - ELSE - be_verbose = .FALSE. - END IF CALL ConstructNewProcessGrid(global_grid, world_comm, process_rows, & & process_columns, process_slices) END SUBROUTINE ConstructProcessGrid_full !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Setup a process grid specifying only the slices - SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, & - & be_verbose_in) + SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in) !> A communicator that every process in the grid is a part of. INTEGER, INTENT(IN) :: world_comm !> The number of grid slices. INTEGER, INTENT(IN), OPTIONAL :: process_slices_in - !> Set true to print process grid info. - LOGICAL, INTENT(IN), OPTIONAL :: be_verbose_in !! Local Data - LOGICAL :: be_verbose INTEGER :: process_rows, process_columns, process_slices INTEGER :: total_processors INTEGER :: ierr @@ -126,12 +111,6 @@ SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, & CALL MPI_COMM_SIZE(world_comm, total_processors, ierr) !! Process Optional Parameters - IF (PRESENT(be_verbose_in)) THEN - be_verbose = be_verbose_in - ELSE - be_verbose = .FALSE. - END IF - IF (PRESENT(process_slices_in)) THEN process_slices = process_slices_in ELSE @@ -144,7 +123,7 @@ SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, & !! Now call the full setup CALL ConstructProcessGrid(world_comm, process_rows, process_columns, & - & process_slices, be_verbose) + & process_slices) END SUBROUTINE ConstructProcessGrid_onlyslice !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Construct a process grid. diff --git a/Source/Wrapper/ProcessGridModule_wrp.F90 b/Source/Wrapper/ProcessGridModule_wrp.F90 index ab191be6..23432342 100644 --- a/Source/Wrapper/ProcessGridModule_wrp.F90 +++ b/Source/Wrapper/ProcessGridModule_wrp.F90 @@ -40,34 +40,30 @@ MODULE ProcessGridModule_wrp CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Wrap the process grid construction routine. SUBROUTINE ConstructGlobalProcessGrid_wrp(world_comm_, process_rows_, & - & process_columns_, process_slices_, be_verbose) & + & process_columns_, process_slices_) & & BIND(c,name="ConstructGlobalProcessGrid_wrp") INTEGER(kind=c_int), INTENT(IN) :: world_comm_ INTEGER(kind=c_int), INTENT(IN) :: process_rows_ INTEGER(kind=c_int), INTENT(IN) :: process_columns_ INTEGER(kind=c_int), INTENT(IN) :: process_slices_ - LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose CALL ConstructProcessGrid(world_comm_, process_rows_, process_columns_, & - & process_slices_, LOGICAL(be_verbose)) + & process_slices_) END SUBROUTINE ConstructGlobalProcessGrid_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Wrap the process grid construction routine. SUBROUTINE ConstructGlobalProcessGrid_onlyslice_wrp(world_comm_, & - & process_slices_, be_verbose) & + & process_slices_) & & BIND(c,name="ConstructGlobalProcessGrid_onlyslice_wrp") INTEGER(kind=c_int), INTENT(IN) :: world_comm_ INTEGER(kind=c_int), INTENT(IN) :: process_slices_ - LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose - CALL ConstructProcessGrid(world_comm_, process_slices_in=process_slices_, & - & be_verbose_in=LOGICAL(be_verbose)) + CALL ConstructProcessGrid(world_comm_, process_slices_in=process_slices_) END SUBROUTINE ConstructGlobalProcessGrid_onlyslice_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Wrap the process grid construction routine. - SUBROUTINE ConstructGlobalProcessGrid_default_wrp(world_comm_, be_verbose) & + SUBROUTINE ConstructGlobalProcessGrid_default_wrp(world_comm_) & & BIND(c,name="ConstructGlobalProcessGrid_default_wrp") INTEGER(kind=c_int), INTENT(IN) :: world_comm_ - LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose - CALL ConstructProcessGrid(world_comm_, be_verbose_in=LOGICAL(be_verbose)) + CALL ConstructProcessGrid(world_comm_) END SUBROUTINE ConstructGlobalProcessGrid_default_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Get the slice of the current process. diff --git a/UnitTests/test_chemistry.py b/UnitTests/test_chemistry.py index 1135730d..18a936f7 100644 --- a/UnitTests/test_chemistry.py +++ b/UnitTests/test_chemistry.py @@ -26,7 +26,7 @@ def create_matrices(self): fock = rand(self.mat_dim, self.mat_dim, density=1.0) if self.is_complex: fock += 1j * rand(self.mat_dim, self.mat_dim, density=1.0) - fock = fock + fock.H + fock = fock + fock.getH() else: fock = fock + fock.T overlap = rand(self.mat_dim, self.mat_dim, density=1.0) @@ -76,7 +76,7 @@ def setUpClass(self): rows = int(environ['PROCESS_ROWS']) columns = int(environ['PROCESS_COLUMNS']) slices = int(environ['PROCESS_SLICES']) - nt.ConstructGlobalProcessGrid(rows, columns, slices, True) + nt.ConstructGlobalProcessGrid(rows, columns, slices) @classmethod def tearDownClass(self): @@ -320,7 +320,7 @@ def test_wom_gc(self): we = [1.0/(1 + exp(beta*(x - mu))) for x in w] if self.is_complex: - DOrth = v @ diag(we) @ matrix(v).H + DOrth = v @ diag(we) @ matrix(v).getH() else: DOrth = v @ diag(we) @ v.T D = ISQ.dot(DOrth).dot(ISQ) @@ -381,7 +381,7 @@ def test_wom_c(self): while abs(trace(DOrth) - self.nel) > 1e-12: we = [1.0/(1 + exp(beta*(x - mu))) for x in w] if self.is_complex: - DOrth = v @ diag(we) @ matrix(v).H + DOrth = v @ diag(we) @ matrix(v).getH() else: DOrth = v @ diag(we) @ v.T D = ISQ.dot(DOrth).dot(ISQ) diff --git a/UnitTests/test_matrix.py b/UnitTests/test_matrix.py index 90ee3d14..f8bb4632 100644 --- a/UnitTests/test_matrix.py +++ b/UnitTests/test_matrix.py @@ -114,7 +114,7 @@ def test_readsymmetric(self): '''Test routines to read and write matrices.''' for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex, square=True) - matrix1 = matrix1 + matrix1.H + matrix1 = matrix1 + matrix1.getH() mmwrite(self.file1, matrix1) matrix2 = self.SMatrix(self.file1) matrix2.WriteToMatrixMarket(self.file2) @@ -226,7 +226,7 @@ def test_multiply(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1) mmwrite(self.file2, matrix2) alpha = uniform(1.0, 2.0) @@ -254,7 +254,7 @@ def test_multiply_nt(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1) mmwrite(self.file2, matrix2.T) alpha = uniform(1.0, 2.0) @@ -282,7 +282,7 @@ def test_multiply_tn(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1.T) mmwrite(self.file2, matrix2) alpha = uniform(1.0, 2.0) @@ -310,7 +310,7 @@ def test_multiply_tt(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1.T) mmwrite(self.file2, matrix2.T) alpha = uniform(1.0, 2.0) @@ -338,7 +338,7 @@ def test_multiply_zero(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = 0 * param.create_matrix(complex=self.complex).H + matrix2 = 0 * param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1) mmwrite(self.file2, matrix2) alpha = uniform(1.0, 2.0) @@ -443,7 +443,7 @@ def test_conjugatetranspose(self): matrix2T.Conjugate() matrix2T.WriteToMatrixMarket(self.file2) - CheckMat = matrix1.H + CheckMat = matrix1.getH() ResultMat = mmread(self.file2) self._compare_mat(CheckMat, ResultMat) diff --git a/UnitTests/test_psmatrix.py b/UnitTests/test_psmatrix.py index 7e3ce896..6ab75e53 100644 --- a/UnitTests/test_psmatrix.py +++ b/UnitTests/test_psmatrix.py @@ -577,7 +577,7 @@ def test_conjugatetranspose(self): matrix1 = param.create_matrix(self.complex) self.write_matrix(matrix1, self.input_file1) - self.CheckMat = matrix1.H + self.CheckMat = matrix1.getH() ntmatrix1 = nt.Matrix_ps(self.input_file1, False) ntmatrix2 = nt.Matrix_ps(ntmatrix1.GetActualDimension()) diff --git a/UnitTests/test_psmatrixalgebra.py b/UnitTests/test_psmatrixalgebra.py index 8726a1a2..724ad0d2 100644 --- a/UnitTests/test_psmatrixalgebra.py +++ b/UnitTests/test_psmatrixalgebra.py @@ -300,7 +300,7 @@ def test_asymmetry(self): else: ntmatrix1 = nt.Matrix_ps(param.rows) - diff = matrix1 - matrix1.H + diff = matrix1 - matrix1.getH() ref = norm(diff.todense(), ord=inf) comp = ntmatrix1.MeasureAsymmetry() comm.barrier() @@ -320,7 +320,7 @@ def test_symmetrize(self): else: ntmatrix1 = nt.Matrix_ps(param.rows) - self.CheckMat = 0.5 * (matrix1 + matrix1.H) + self.CheckMat = 0.5 * (matrix1 + matrix1.getH()) ntmatrix1 = nt.Matrix_ps(self.input_file1, False) ntmatrix1.Symmetrize() ntmatrix1.WriteToMatrixMarket(self.result_file) diff --git a/UnitTests/test_solvers.py b/UnitTests/test_solvers.py index 953e8ef3..8282f3a5 100644 --- a/UnitTests/test_solvers.py +++ b/UnitTests/test_solvers.py @@ -663,7 +663,7 @@ def test_hornerfunction(self): val[i] = 0 for j in range(0, len(coef)): val[i] = val[i] + coef[j] * (temp**j) - temp_poly = dot(dot(vec, diag(val)), vec.H) + temp_poly = dot(dot(vec, diag(val)), vec.getH()) self.CheckMat = csr_matrix(temp_poly) # Result Matrix @@ -702,7 +702,7 @@ def test_patersonstockmeyerfunction(self): val[i] = 0 for j in range(0, len(coef)): val[i] = val[i] + coef[j] * (temp**j) - temp_poly = dot(dot(vec, diag(val)), vec.H) + temp_poly = dot(dot(vec, diag(val)), vec.getH()) self.CheckMat = csr_matrix(temp_poly) # Result Matrix @@ -1189,16 +1189,16 @@ def create_matrix(self, SPD=None, scaled=None, diag_dom=None, rank=None, from numpy import diag mat = rand(self.mat_dim, self.mat_dim, density=1.0) mat += 1j * rand(self.mat_dim, self.mat_dim, density=1.0) - mat = mat + mat.H + mat = mat + mat.getH() if SPD: - mat = mat.H.dot(mat) + mat = mat.getH().dot(mat) if diag_dom: identity_matrix = identity(self.mat_dim) mat = mat + identity_matrix * self.mat_dim if scaled: mat = (1.0 / self.mat_dim) * mat if rank: - mat = mat[rank:].dot(mat[rank:].H) + mat = mat[rank:].dot(mat[rank:].getH()) if add_gap: w, v = eigh(mat.todense()) gap = (w[-1] - w[0]) / 2.0