From 24d6e77212a7ff971061c787165f4d1c1b548931 Mon Sep 17 00:00:00 2001
From: Abdullah Alperen <alperena@msu.edu>
Date: Fri, 9 Nov 2018 14:52:08 -0500
Subject: [PATCH] PuReMD: fix errors regarding matrix format

---
 PuReMD/src/allocate.c   | 3 +--
 PuReMD/src/init_md.c    | 7 ++++++-
 PuReMD/src/reax_types.h | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/PuReMD/src/allocate.c b/PuReMD/src/allocate.c
index 77b4164d..862aa0e1 100644
--- a/PuReMD/src/allocate.c
+++ b/PuReMD/src/allocate.c
@@ -1048,8 +1048,8 @@ void ReAllocate( reax_system *system, control_params *control,
                 break;
             }
         }
-    }
 #endif
+    }
 
     if ( mpi_flag )
     {
@@ -1094,7 +1094,6 @@ void ReAllocate( reax_system *system, control_params *control,
 #endif
 
         /* reallocate mpi buffers */
-
         Deallocate_MPI_Buffers( mpi_data );
         ret = Allocate_MPI_Buffers( mpi_data, system->est_recv,
                                     system->my_nbrs, msg );
diff --git a/PuReMD/src/init_md.c b/PuReMD/src/init_md.c
index b8115820..4e3000b5 100644
--- a/PuReMD/src/init_md.c
+++ b/PuReMD/src/init_md.c
@@ -596,8 +596,13 @@ int  Init_Lists( reax_system *system, control_params *control,
     }
     else
     {
+#if defined(NEUTRAL_TERRITORY)
+        far_nbr_list_format = FULL_LIST;
+        cm_format = SYM_FULL_MATRIX;
+#else
         far_nbr_list_format = HALF_LIST;
         cm_format = SYM_HALF_MATRIX;
+#endif
     }
 
     //for( i = 0; i < MAX_NBRS; ++i ) nrecv[i] = system->my_nbrs[i].est_recv;
@@ -647,7 +652,7 @@ int  Init_Lists( reax_system *system, control_params *control,
 #if defined(NEUTRAL_TERRITORY)
     Allocate_Matrix( &(workspace->H), matrix_dim, Htop, cm_format, comm );
 #else
-    Allocate_Matrix( &(workspace->H), system->local_cap, Htop, comm );
+    Allocate_Matrix( &(workspace->H), system->local_cap, Htop, cm_format, comm );
 #endif
     workspace->L = NULL;
     workspace->U = NULL;
diff --git a/PuReMD/src/reax_types.h b/PuReMD/src/reax_types.h
index 9957f148..464bfb3a 100644
--- a/PuReMD/src/reax_types.h
+++ b/PuReMD/src/reax_types.h
@@ -40,7 +40,7 @@
 /************* SOME DEFS - crucial for reax_types.h *********/
 
 #define PURE_REAX
-//#define NT_DEBUG
+#define NEUTRAL_TERRITORY
 //#define LAMMPS_REAX
 //#define DEBUG
 //#define DEBUG_FOCUS
-- 
GitLab