File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 21
21
runs-on : ${{ matrix.os }}
22
22
strategy :
23
23
matrix :
24
- os : [ubuntu-latest, macos-latest]
24
+ # setup-miniconda not compatible with macos-latest presently.
25
+ # https://github.com/conda-incubator/setup-miniconda/issues/344
26
+ os : [ubuntu-latest, macos-12]
25
27
26
28
steps :
27
29
- uses : actions/checkout@v2
35
37
key :
36
38
${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/mrchem-gha.yml') }}
37
39
38
- - uses : conda-incubator/setup-miniconda@v2
40
+ - uses : conda-incubator/setup-miniconda@v3
39
41
with :
40
42
auto-update-conda : true
41
43
auto-activate-base : false
Original file line number Diff line number Diff line change @@ -78,15 +78,18 @@ mrcpp::FunctionTreeVector<3> MRDFT::evaluate(mrcpp::FunctionTreeVector<3> &inp)
78
78
int n_start = (mrcpp::mpi::wrk_rank * nNodes) / mrcpp::mpi::wrk_size;
79
79
int n_end = ((mrcpp::mpi::wrk_rank + 1 ) * nNodes) / mrcpp::mpi::wrk_size;
80
80
DoubleVector XCenergy = DoubleVector::Zero (1 );
81
+ double sum = 0.0 ;
81
82
#pragma omp parallel
82
83
{
83
- #pragma omp for schedule(guided)
84
+ #pragma omp for schedule(guided) reduction (+: sum)
84
85
for (int n = n_start; n < n_end; n++) {
85
86
vector<mrcpp::FunctionNode<3 > *> xcNodes = xc_utils::fetch_nodes (n, PotVec);
86
87
functional ().makepot (inp, xcNodes);
87
- XCenergy[ 0 ] += xcNodes[0 ]->integrate ();
88
+ sum += xcNodes[0 ]->integrate ();
88
89
}
89
90
}
91
+ XCenergy[0 ] = sum;
92
+
90
93
// each mpi only has part of the results. All send their results to bank and then fetch
91
94
if (mrcpp::mpi::wrk_size > 1 ) {
92
95
// sum up the energy contrbutions from all mpi
You can’t perform that action at this time.
0 commit comments