From ec8b9e21dbb40c81d0ba94e730db192136daf595 Mon Sep 17 00:00:00 2001
From: Steve Plimpton <sjplimp@sandia.gov>
Date: Wed, 31 Aug 2016 13:28:26 -0600
Subject: [PATCH] sync with SVN

---
 doc/src/Section_howto.txt         |  4 ++--
 lib/kokkos/Makefile.kokkos        |  2 +-
 src/KOKKOS/pair_reax_c_kokkos.cpp | 14 ++++++++------
 src/compute_omega_chunk.cpp       | 31 ++++++++++++++++---------------
 src/fix_balance.cpp               |  3 +--
 src/math_extra.h                  | 21 ++++++++++++---------
 6 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/doc/src/Section_howto.txt b/doc/src/Section_howto.txt
index 8bd9ef805d..d88ab0c2de 100644
--- a/doc/src/Section_howto.txt
+++ b/doc/src/Section_howto.txt
@@ -2303,8 +2303,8 @@ fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
 
 compute cc1 all chunk/atom molecule
 fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out
-variable xave equal ave(f_1[2])
-variable xmax equal max(f_1[2])
+variable xave equal ave(f_1\[2\])
+variable xmax equal max(f_1\[2\])
 thermo 1000
 thermo_style custom step temp v_xave v_xmax :pre
 
diff --git a/lib/kokkos/Makefile.kokkos b/lib/kokkos/Makefile.kokkos
index af2a617752..c01ceaf64d 100644
--- a/lib/kokkos/Makefile.kokkos
+++ b/lib/kokkos/Makefile.kokkos
@@ -16,7 +16,7 @@ KOKKOS_USE_TPLS ?= ""
 #Options: c++11
 KOKKOS_CXX_STANDARD ?= "c++11"
 #Options: aggressive_vectorization,disable_profiling
-KOKKOS_OPTIONS ?= "aggressive_vectorization"
+KOKKOS_OPTIONS ?= ""
 
 #Default settings specific options
 #Options: force_uvm,use_ldg,rdc,enable_lambda
diff --git a/src/KOKKOS/pair_reax_c_kokkos.cpp b/src/KOKKOS/pair_reax_c_kokkos.cpp
index 9e0f06ef30..eba6fbb0b5 100644
--- a/src/KOKKOS/pair_reax_c_kokkos.cpp
+++ b/src/KOKKOS/pair_reax_c_kokkos.cpp
@@ -3878,14 +3878,16 @@ void PairReaxCKokkos<DeviceType>::ev_setup(int eflag, int vflag)
   // reallocate per-atom arrays if necessary
 
   if (eflag_atom && atom->nmax > maxeatom) {
-      memory->destroy_kokkos(k_eatom,eatom);
-      memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
-      v_eatom = k_eatom.view<DeviceType>();
+    maxeatom = atom->nmax;
+    memory->destroy_kokkos(k_eatom,eatom);
+    memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
+    v_eatom = k_eatom.view<DeviceType>();
   }
   if (vflag_atom && atom->nmax > maxvatom) {
-      memory->destroy_kokkos(k_vatom,vatom);
-      memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
-      v_vatom = k_vatom.view<DeviceType>();
+    maxvatom = atom->nmax;
+    memory->destroy_kokkos(k_vatom,vatom);
+    memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
+    v_vatom = k_vatom.view<DeviceType>();
   }
 
   // zero accumulators
diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp
index 58acc19c37..50f7db7aa7 100644
--- a/src/compute_omega_chunk.cpp
+++ b/src/compute_omega_chunk.cpp
@@ -27,7 +27,8 @@ using namespace LAMMPS_NS;
 
 ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg),
-  idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL)
+  idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), 
+  angmom(NULL), angmomall(NULL)
 {
   if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command");
 
@@ -192,13 +193,13 @@ void ComputeOmegaChunk::compute_array()
 
   double ione[3][3],inverse[3][3];
 
-  for (i = 0; i < nchunk; i++) {
-    ione[0][0] = inertiaall[i][0];
-    ione[1][1] = inertiaall[i][1];
-    ione[2][2] = inertiaall[i][2];
-    ione[0][1] = inertiaall[i][3];
-    ione[1][2] = inertiaall[i][4];
-    ione[0][2] = inertiaall[i][5];
+  for (m = 0; m < nchunk; m++) {
+    ione[0][0] = inertiaall[m][0];
+    ione[1][1] = inertiaall[m][1];
+    ione[2][2] = inertiaall[m][2];
+    ione[0][1] = inertiaall[m][3];
+    ione[1][2] = inertiaall[m][4];
+    ione[0][2] = inertiaall[m][5];
     ione[1][0] = ione[0][1];
     ione[2][1] = ione[1][2];
     ione[2][0] = ione[0][2];
@@ -221,15 +222,15 @@ void ComputeOmegaChunk::compute_array()
       ione[2][0]*ione[1][1]*ione[0][2];
 
     if (determinant > 0.0)
-      for (int i = 0; i < 3; i++)
-        for (int j = 0; j < 3; j++)
+      for (i = 0; i < 3; i++)
+        for (j = 0; j < 3; j++)
           inverse[i][j] /= determinant;
 
-    omega[i][0] = inverse[0][0]*angmom[i][0] + inverse[0][1]*angmom[i][1] +
-      inverse[0][2]*angmom[i][2];
-    omega[i][1] = inverse[1][0]*angmom[i][0] + inverse[1][1]*angmom[i][1] +
-      inverse[1][2]*angmom[i][2];
-    omega[i][2] = inverse[2][0]*angmom[i][0] + inverse[2][1]*angmom[i][1] +
+    omega[m][0] = inverse[0][0]*angmom[m][0] + inverse[0][1]*angmom[m][1] +
+      inverse[0][2]*angmom[m][2];
+    omega[m][1] = inverse[1][0]*angmom[m][0] + inverse[1][1]*angmom[m][1] +
+      inverse[1][2]*angmom[m][2];
+    omega[m][2] = inverse[2][0]*angmom[m][0] + inverse[2][1]*angmom[m][1] +
       inverse[2][2]*angmom[i][2];
   }
 }
diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp
index f29518515c..500498b463 100644
--- a/src/fix_balance.cpp
+++ b/src/fix_balance.cpp
@@ -35,8 +35,7 @@ enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED};    // several files
 /* ---------------------------------------------------------------------- */
 
 FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
-  Fix(lmp, narg, arg),
-  fp(NULL), nimbalance(0), imbalance(NULL), imb_fix(NULL), balance(NULL), irregular(NULL)
+  Fix(lmp, narg, arg), fp(NULL)
 {
   if (narg < 6) error->all(FLERR,"Illegal fix balance command");
 
diff --git a/src/math_extra.h b/src/math_extra.h
index 0bfc7193a4..3c00f7a4fc 100755
--- a/src/math_extra.h
+++ b/src/math_extra.h
@@ -35,7 +35,8 @@ namespace MathExtra {
   inline void negate3(double *v);
   inline void scale3(double s, double *v);
   inline void add3(const double *v1, const double *v2, double *ans);
-  inline void scaleadd3(double s, const double *v1, const double *v2, double *ans);
+  inline void scaleadd3(double s, const double *v1, const double *v2, 
+                        double *ans);
   inline void sub3(const double *v1, const double *v2, double *ans);
   inline double len3(const double *v);
   inline double lensq3(const double *v);
@@ -389,8 +390,8 @@ inline void MathExtra::times3(const double m[3][3], const double m2[3][3],
    multiply the transpose of mat1 times mat2
 ------------------------------------------------------------------------- */
 
-inline void MathExtra::transpose_times3(const double m[3][3], const double m2[3][3],
-                                 double ans[3][3])
+inline void MathExtra::transpose_times3(const double m[3][3], 
+                                        const double m2[3][3],double ans[3][3])
 {
   ans[0][0] = m[0][0]*m2[0][0] + m[1][0]*m2[1][0] + m[2][0]*m2[2][0];
   ans[0][1] = m[0][0]*m2[0][1] + m[1][0]*m2[1][1] + m[2][0]*m2[2][1];
@@ -407,8 +408,8 @@ inline void MathExtra::transpose_times3(const double m[3][3], const double m2[3]
    multiply mat1 times transpose of mat2
 ------------------------------------------------------------------------- */
 
-inline void MathExtra::times3_transpose(const double m[3][3], const double m2[3][3],
-                                 double ans[3][3])
+inline void MathExtra::times3_transpose(const double m[3][3], 
+                                        const double m2[3][3],double ans[3][3])
 {
   ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[0][1] + m[0][2]*m2[0][2];
   ans[0][1] = m[0][0]*m2[1][0] + m[0][1]*m2[1][1] + m[0][2]*m2[1][2];
@@ -423,7 +424,7 @@ inline void MathExtra::times3_transpose(const double m[3][3], const double m2[3]
 
 /* ----------------------------------------------------------------------
    invert a matrix
-   does NOT checks for singular or badly scaled matrix
+   does NOT check for singular or badly scaled matrix
 ------------------------------------------------------------------------- */
 
 inline void MathExtra::invert3(const double m[3][3], double ans[3][3])
@@ -631,7 +632,7 @@ inline void MathExtra::invquatvec(double *a, double *b, double *c)
 ------------------------------------------------------------------------- */
 
 inline void MathExtra::axisangle_to_quat(const double *v, const double angle,
-                                  double *quat)
+                                         double *quat)
 {
   double halfa = 0.5*angle;
   double sina = sin(halfa);
@@ -663,7 +664,8 @@ inline void MathExtra::rotation_generator_x(const double m[3][3],
    Apply principal rotation generator about y to rotation matrix m
 ------------------------------------------------------------------------- */
 
-inline void MathExtra::rotation_generator_y(const double m[3][3], double ans[3][3])
+inline void MathExtra::rotation_generator_y(const double m[3][3], 
+                                            double ans[3][3])
 {
   ans[0][0] = m[0][2];
   ans[0][1] = 0;
@@ -680,7 +682,8 @@ inline void MathExtra::rotation_generator_y(const double m[3][3], double ans[3][
    Apply principal rotation generator about z to rotation matrix m
 ------------------------------------------------------------------------- */
 
-inline void MathExtra::rotation_generator_z(const double m[3][3], double ans[3][3])
+inline void MathExtra::rotation_generator_z(const double m[3][3], 
+                                            double ans[3][3])
 {
   ans[0][0] = -m[0][1];
   ans[0][1] = m[0][0];
-- 
GitLab