From 8861fa1340a0fa6fe2ee5b3e4afbb932ddfaa299 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Mar 2013 19:23:11 +0100 Subject: [PATCH] define nlocal outside of OpenMP region --- src/USER-OMP/pppm_disp_omp.cpp | 6 +++--- src/USER-OMP/pppm_disp_tip4p_omp.cpp | 6 +++--- src/USER-OMP/pppm_omp.cpp | 2 +- src/USER-OMP/pppm_tip4p_omp.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/USER-OMP/pppm_disp_omp.cpp b/src/USER-OMP/pppm_disp_omp.cpp index 27f9b81da6..fba99f53b5 100644 --- a/src/USER-OMP/pppm_disp_omp.cpp +++ b/src/USER-OMP/pppm_disp_omp.cpp @@ -403,6 +403,7 @@ void PPPMDispOMP::make_rho_c() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out - nxlo_out + 1; @@ -433,7 +434,6 @@ void PPPMDispOMP::make_rho_c() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; @@ -491,6 +491,7 @@ void PPPMDispOMP::make_rho_g() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; @@ -520,7 +521,6 @@ void PPPMDispOMP::make_rho_g() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; @@ -593,6 +593,7 @@ void PPPMDispOMP::make_rho_a() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; @@ -622,7 +623,6 @@ void PPPMDispOMP::make_rho_a() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.cpp b/src/USER-OMP/pppm_disp_tip4p_omp.cpp index 2929ef0f91..fc2b043da2 100644 --- a/src/USER-OMP/pppm_disp_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_disp_tip4p_omp.cpp @@ -480,6 +480,7 @@ void PPPMDispTIP4POMP::make_rho_c() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out - nxlo_out + 1; @@ -512,7 +513,6 @@ void PPPMDispTIP4POMP::make_rho_c() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; @@ -575,6 +575,7 @@ void PPPMDispTIP4POMP::make_rho_g() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; @@ -604,7 +605,6 @@ void PPPMDispTIP4POMP::make_rho_g() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; @@ -677,6 +677,7 @@ void PPPMDispTIP4POMP::make_rho_a() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; @@ -706,7 +707,6 @@ void PPPMDispTIP4POMP::make_rho_a() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; diff --git a/src/USER-OMP/pppm_omp.cpp b/src/USER-OMP/pppm_omp.cpp index 3323197b74..89c0b4adad 100644 --- a/src/USER-OMP/pppm_omp.cpp +++ b/src/USER-OMP/pppm_omp.cpp @@ -338,6 +338,7 @@ void PPPMOMP::make_rho() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out - nxlo_out + 1; @@ -368,7 +369,6 @@ void PPPMOMP::make_rho() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; diff --git a/src/USER-OMP/pppm_tip4p_omp.cpp b/src/USER-OMP/pppm_tip4p_omp.cpp index 035b5136d6..64a5ee29ac 100644 --- a/src/USER-OMP/pppm_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_tip4p_omp.cpp @@ -394,6 +394,7 @@ void PPPMTIP4POMP::make_rho() // no local atoms => nothing else to do + const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out - nxlo_out + 1; @@ -426,7 +427,6 @@ void PPPMTIP4POMP::make_rho() // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads - const int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a;