Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 4b0d7d82 authored by adelmann's avatar adelmann :reminder_ribbon:
Browse files

Merge branch '8-run-time-error-with-multiple-cores' into 'master'

fix nlocal for all reduce

Closes #8

See merge request !10
parents fb02be23 fde2e981
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ public:
}
Kokkos::parallel_reduce(
"calc moments of particle distr.", numberOfParticles,
"calc moments of particle distr.", nlocal,
KOKKOS_LAMBDA(
const int k, double& cent0, double& cent1, double& cent2) {
cent0 += Rview(k)[0];
......@@ -72,16 +72,16 @@ public:
},
Kokkos::Sum<double>(loc_meanR[0]), Kokkos::Sum<double>(loc_meanR[1]), Kokkos::Sum<double>(loc_meanR[2]));
Kokkos::fence();
ippl::Comm->barrier();
MPI_Allreduce(loc_meanR, meanR, 3, MPI_DOUBLE, MPI_SUM, ippl::Comm->getCommunicator());
ippl::Comm->barrier();
for(int i=0; i<3; i++){
meanR[i] = meanR[i]/(1.*numberOfParticles);
}
Kokkos::parallel_for(
numberOfParticles,KOKKOS_LAMBDA(
nlocal, KOKKOS_LAMBDA(
const int k) {
Rview(k)[0] -= meanR[0];
Rview(k)[1] -= meanR[1];
......@@ -118,16 +118,16 @@ public:
},
Kokkos::Sum<double>(loc_meanP[0]), Kokkos::Sum<double>(loc_meanP[1]), Kokkos::Sum<double>(loc_meanP[2]));
Kokkos::fence();
ippl::Comm->barrier();
MPI_Allreduce(loc_meanP, meanP, 3, MPI_DOUBLE, MPI_SUM, ippl::Comm->getCommunicator());
ippl::Comm->barrier();
for(int i=0; i<3; i++){
meanP[i] = meanP[i]/(1.*numberOfParticles);
}
Kokkos::parallel_for(
numberOfParticles,KOKKOS_LAMBDA(
nlocal, KOKKOS_LAMBDA(
const int k) {
Pview(k)[0] -= meanP[0];
Pview(k)[1] -= meanP[1];
......@@ -140,7 +140,7 @@ public:
// correct the mean
double avrgpz = opalDist_m->getAvrgpz();
Kokkos::parallel_for(
numberOfParticles,KOKKOS_LAMBDA(
nlocal, KOKKOS_LAMBDA(
const int k) {
Pview(k)[2] += avrgpz;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment