forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: make force and stress of sDFT support GPU (#5487)
* refactor force in sdft * refactor stress in sDFT * make stress_ekin GPU * finish sdft GPU * fix compile * add annotations * fix bug of stress and force * modify
- Loading branch information
1 parent
5b1777c
commit f2e91bd
Showing
62 changed files
with
1,645 additions
and
1,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "parallel_device.h" | ||
#ifdef __MPI | ||
namespace Parallel_Common | ||
{ | ||
void bcast_data(std::complex<double>* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Bcast(object, n * 2, MPI_DOUBLE, 0, comm); | ||
} | ||
void bcast_data(std::complex<float>* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Bcast(object, n * 2, MPI_FLOAT, 0, comm); | ||
} | ||
void bcast_data(double* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Bcast(object, n, MPI_DOUBLE, 0, comm); | ||
} | ||
void bcast_data(float* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Bcast(object, n, MPI_FLOAT, 0, comm); | ||
} | ||
void reduce_data(std::complex<double>* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Allreduce(MPI_IN_PLACE, object, n * 2, MPI_DOUBLE, MPI_SUM, comm); | ||
} | ||
void reduce_data(std::complex<float>* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Allreduce(MPI_IN_PLACE, object, n * 2, MPI_FLOAT, MPI_SUM, comm); | ||
} | ||
void reduce_data(double* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Allreduce(MPI_IN_PLACE, object, n, MPI_DOUBLE, MPI_SUM, comm); | ||
} | ||
void reduce_data(float* object, const int& n, const MPI_Comm& comm) | ||
{ | ||
MPI_Allreduce(MPI_IN_PLACE, object, n, MPI_FLOAT, MPI_SUM, comm); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.