Unverified Commit 34899ad8 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

some more OpenMP related warnings squashed and code simplified

parent d1bf4d57
Loading
Loading
Loading
Loading
+1 −0
Changes for src/QEQ/fix_qeq.cpp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -476,6 +476,7 @@ int FixQEq::pack_forward_comm(int n, int *list, double *buf,
    for(m = 0; m < n; m++) buf[m] = t[list[m]];
  else if( pack_flag == 4 )
    for(m = 0; m < n; m++) buf[m] = atom->q[list[m]];
  else m = 0;

  return m;
}
+6 −9
Changes for src/USER-OMP/domain_omp.cpp: 6 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -44,11 +44,10 @@ void DomainOMP::pbc()
  imageint    * _noalias const image = atom->image;
  const int nlocal = atom->nlocal;

  int i;
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
  for (i = 0; i < nlocal; i++) {
  for (int i = 0; i < nlocal; i++) {
    imageint idim,otherdims;

    if (xperiodic) {
@@ -142,12 +141,11 @@ void DomainOMP::lamda2x(int n)
{
  dbl3_t * _noalias const x = (dbl3_t *)&atom->x[0][0];
  const int num = n;
  int i;

#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
  for (i = 0; i < num; i++) {
  for (int i = 0; i < num; i++) {
    x[i].x = h[0]*x[i].x + h[5]*x[i].y + h[4]*x[i].z + boxlo[0];
    x[i].y = h[1]*x[i].y + h[3]*x[i].z + boxlo[1];
    x[i].z = h[2]*x[i].z + boxlo[2];
@@ -163,12 +161,11 @@ void DomainOMP::x2lamda(int n)
{
  dbl3_t * _noalias const x = (dbl3_t *)&atom->x[0][0];
  const int num = n;
  int i;

#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
  for (i = 0; i < num; i++) {
  for (int i = 0; i < num; i++) {
    double delta0 = x[i].x - boxlo[0];
    double delta1 = x[i].y - boxlo[1];
    double delta2 = x[i].z - boxlo[2];
+6 −8
Changes for src/USER-OMP/fix_gravity_omp.cpp: 6 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -63,19 +63,17 @@ void FixGravityOMP::post_force(int /* vflag */)
  const double xacc_thr = xacc;
  const double yacc_thr = yacc;
  const double zacc_thr = zacc;
  double massone;

  int i;
  eflag = 0;
  double grav = 0.0;

  if (rmass) {
#if defined(_OPENMP)
#pragma omp parallel for private(i,massone) default(none) reduction(-:grav)
#pragma omp parallel for default(none) reduction(-:grav)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        massone = rmass[i];
        const double massone = rmass[i];
        f[i][0] += massone*xacc_thr;
        f[i][1] += massone*yacc_thr;
        f[i][2] += massone*zacc_thr;
@@ -83,11 +81,11 @@ void FixGravityOMP::post_force(int /* vflag */)
      }
  } else {
#if defined(_OPENMP)
#pragma omp parallel for private(i,massone) default(none) reduction(-:grav)
#pragma omp parallel for default(none) reduction(-:grav)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        massone = mass[type[i]];
        const double massone = mass[type[i]];
        f[i][0] += massone*xacc_thr;
        f[i][1] += massone*yacc_thr;
        f[i][2] += massone*zacc_thr;
+8 −10
Changes for src/USER-OMP/fix_nve_omp.cpp: 8 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -37,14 +37,13 @@ void FixNVEOMP::initial_integrate(int /* vflag */)
  const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
  const int * const mask = atom->mask;
  const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
  int i;

  if (atom->rmass) {
    const double * const rmass = atom->rmass;
#if defined (_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        const double dtfm = dtf / rmass[i];
        v[i].x += dtfm * f[i].x;
@@ -59,9 +58,9 @@ void FixNVEOMP::initial_integrate(int /* vflag */)
    const double * const mass = atom->mass;
    const int * const type = atom->type;
#if defined (_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        const double dtfm = dtf / mass[type[i]];
        v[i].x += dtfm * f[i].x;
@@ -84,14 +83,13 @@ void FixNVEOMP::final_integrate()
  const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
  const int * const mask = atom->mask;
  const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
  int i;

  if (atom->rmass) {
    const double * const rmass = atom->rmass;
#if defined (_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        const double dtfm = dtf / rmass[i];
        v[i].x += dtfm * f[i].x;
@@ -103,9 +101,9 @@ void FixNVEOMP::final_integrate()
    const double * const mass = atom->mass;
    const int * const type = atom->type;
#if defined (_OPENMP)
#pragma omp parallel for private(i) default(none) schedule(static)
#pragma omp parallel for default(none) schedule(static)
#endif
    for (i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) {
        const double dtfm = dtf / mass[type[i]];
        v[i].x += dtfm * f[i].x;
+8 −10
Changes for src/USER-OMP/fix_nve_sphere_omp.cpp: 8 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ void FixNVESphereOMP::initial_integrate(int /* vflag */)
  const double * const rmass = atom->rmass;
  const int * const mask = atom->mask;
  const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
  int i;

  // set timestep here since dt may have changed or come via rRESPA
  const double dtfrotate = dtf / INERTIA;
@@ -50,9 +49,9 @@ void FixNVESphereOMP::initial_integrate(int /* vflag */)
  // update v,x,omega for all particles
  // d_omega/dt = torque / inertia
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none)
#pragma omp parallel for default(none)
#endif
  for (i = 0; i < nlocal; i++) {
  for (int i = 0; i < nlocal; i++) {
    if (mask[i] & groupbit) {
      const double dtfm = dtf / rmass[i];
      v[i][0] += dtfm * f[i][0];
@@ -77,9 +76,9 @@ void FixNVESphereOMP::initial_integrate(int /* vflag */)
    double * const * const mu = atom->mu;
    if (dlm == NODLM) {
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none)
#pragma omp parallel for default(none)
#endif
      for (i = 0; i < nlocal; i++) {
      for (int i = 0; i < nlocal; i++) {
        double g0,g1,g2,msq,scale;
        if (mask[i] & groupbit) {
          if (mu[i][3] > 0.0) {
@@ -96,10 +95,10 @@ void FixNVESphereOMP::initial_integrate(int /* vflag */)
      }
    } else {
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none)
#pragma omp parallel for default(none)
#endif
      // Integrate orientation following Dullweber-Leimkuhler-Maclachlan scheme
      for (i = 0; i < nlocal; i++) {
      for (int i = 0; i < nlocal; i++) {
        vector w, w_temp, a;
        matrix Q, Q_temp, R;

@@ -215,7 +214,6 @@ void FixNVESphereOMP::final_integrate()
  const double * const radius = atom->radius;
  const int * const mask = atom->mask;
  const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
  int i;

  // set timestep here since dt may have changed or come via rRESPA

@@ -225,9 +223,9 @@ void FixNVESphereOMP::final_integrate()
  // d_omega/dt = torque / inertia

#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none)
#pragma omp parallel for default(none)
#endif
  for (i = 0; i < nlocal; i++)
  for (int i = 0; i < nlocal; i++)
    if (mask[i] & groupbit) {
      const double dtfm = dtf / rmass[i];
      v[i][0] += dtfm * f[i][0];
Loading