From 0cde8abe6ab21758cdf0ff48565e2dec09fbc2e7 Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <pedro.gonnet@durham.ac.uk>
Date: Fri, 23 Aug 2013 10:11:43 +0000
Subject: [PATCH] add initialization of nodeID array.

Former-commit-id: 4b48d46fbdbd81d76a4548a8f6059c662f0a6515
---
 src/engine.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/engine.c b/src/engine.c
index 6c07f784f0..4d9e669b81 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -227,13 +227,13 @@ void engine_repartition ( struct engine *e ) {
     if ( nodeID == 0 ) {
     
         /* Check that the edge weights are fully symmetric. */
-        for ( cid = 0 ; cid < nr_cells ; cid++ )
+        /* for ( cid = 0 ; cid < nr_cells ; cid++ )
             for ( k = 0 ; k < 26 ; k++ ) {
                 cjd = inds[ cid*26 + k ];
                 for ( j = 26*cjd ; inds[j] != cid ; j++ );
                 if ( weights_e[ cid*26+k ] != weights_e[ j ] )
                     error( "Unsymmetric edge weights detected (%i vs %i)." , weights_e[ cid*26+k ] , weights_e[ j ] );
-                }
+                } */
     
         /* Allocate and fill the connection array. */
         idx_t *offsets;
@@ -250,6 +250,10 @@ void engine_repartition ( struct engine *e ) {
         options[ METIS_OPTION_NUMBERING ] = 0;
         options[ METIS_OPTION_CONTIG ] = 1;
         
+        /* Set the initial partition, although this is probably ignored. */
+        for ( k = 0 ; k < nr_cells ; k++ )
+            nodeIDs[k] = cells[k].nodeID;
+            
         /* Call METIS. */
         int one = 1;
         idx_t objval;
-- 
GitLab