Skip to content
Snippets Groups Projects
Commit 9ed2a444 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

add check for unsymmetric weights.

Former-commit-id: 186f3da57f8948e0784ae1686f19f1a2bb34e14e
parent 9cbbf9a2
No related branches found
No related tags found
No related merge requests found
...@@ -100,7 +100,7 @@ void engine_repartition ( struct engine *e ) { ...@@ -100,7 +100,7 @@ void engine_repartition ( struct engine *e ) {
float sid_scale[13] = { 0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 , float sid_scale[13] = { 0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 ,
0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 , 0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 ,
0.5788 }; 0.5788 };
float wscale = 0.001; float wscale = 0.0001;
/* Clear the repartition flag. */ /* Clear the repartition flag. */
e->forcerepart = 0; e->forcerepart = 0;
...@@ -226,6 +226,15 @@ void engine_repartition ( struct engine *e ) { ...@@ -226,6 +226,15 @@ void engine_repartition ( struct engine *e ) {
/* As of here, only one node needs to compute the partition. */ /* As of here, only one node needs to compute the partition. */
if ( nodeID == 0 ) { if ( nodeID == 0 ) {
/* Check that the edge weights are fully symmetric. */
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. */ /* Allocate and fill the connection array. */
idx_t *offsets; idx_t *offsets;
if ( ( offsets = (idx_t *)malloc( sizeof(idx_t) * (nr_cells + 1) ) ) == NULL ) if ( ( offsets = (idx_t *)malloc( sizeof(idx_t) * (nr_cells + 1) ) ) == NULL )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment