Skip to content

Commit

Permalink
Merge pull request #234 from gitpeterwind/cplx
Browse files Browse the repository at this point in the history
bug fix and remove MPI_CXX type
  • Loading branch information
gitpeterwind authored Feb 14, 2024
2 parents 1697cef + 0a5b538 commit 56a5e8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utils/ComplexFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ DoubleMatrix calc_norm_overlap_matrix(MPI_FuncVector &BraKet) {
*
*/
void orthogonalize(double prec, MPI_FuncVector &Bra, MPI_FuncVector &Ket) {
// TODO: generalize for cases where Bra functions are not orthogonal to each other?
// TODO: generalize for cases where Ket functions are not orthogonal to each other?
ComplexMatrix S = mpifuncvec::calc_overlap_matrix(Bra, Ket);
int N = Bra.size();
int M = Ket.size();
Expand All @@ -2011,7 +2011,7 @@ void orthogonalize(double prec, MPI_FuncVector &Bra, MPI_FuncVector &Ket) {
ComplexMatrix rmat = ComplexMatrix::Zero(M, N);
for (int j = 0; j < N; j++) {
for (int i = 0; i < M; i++) {
rmat(i,j) = 0.0 - S(j,i)/Ketnorms(i);
rmat(i,j) = 0.0 - S.conjugate()(j,i)/Ketnorms(i);
}
}
MPI_FuncVector rotatedKet(N);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void mpi::allreduce_vector(DoubleVector &vec, MPI_Comm comm) {
void mpi::allreduce_vector(ComplexVector &vec, MPI_Comm comm) {
#ifdef MRCPP_HAS_MPI
int N = vec.size();
MPI_Allreduce(MPI_IN_PLACE, vec.data(), N, MPI_CXX_DOUBLE_COMPLEX, MPI_SUM, comm);
MPI_Allreduce(MPI_IN_PLACE, vec.data(), N, MPI_C_DOUBLE_COMPLEX, MPI_SUM, comm);
#endif
}

Expand All @@ -316,7 +316,7 @@ void mpi::allreduce_matrix(DoubleMatrix &mat, MPI_Comm comm) {
void mpi::allreduce_matrix(ComplexMatrix &mat, MPI_Comm comm) {
#ifdef MRCPP_HAS_MPI
int N = mat.size();
MPI_Allreduce(MPI_IN_PLACE, mat.data(), N, MPI_CXX_DOUBLE_COMPLEX, MPI_SUM, comm);
MPI_Allreduce(MPI_IN_PLACE, mat.data(), N, MPI_C_DOUBLE_COMPLEX, MPI_SUM, comm);
#endif
}

Expand Down

0 comments on commit 56a5e8f

Please sign in to comment.