From 43e4881d022703e704697d666c1506f905280cd0 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Wed, 26 Jun 2024 11:22:34 +0200
Subject: [PATCH] examples: specify if the matrix is replicated or not

---
 examples/example_lap1.c  | 3 +++
 examples/example_lap2.c  | 3 +++
 examples/example_mdof1.c | 3 +++
 examples/example_mdof2.c | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/examples/example_lap1.c b/examples/example_lap1.c
index 38b3f90a..89b67cb6 100644
--- a/examples/example_lap1.c
+++ b/examples/example_lap1.c
@@ -127,6 +127,9 @@ spm_example_create_laplacian( spmatrix_t *spm )
     spm->nnz     = nnz;
     spm->dof     = 1;
 
+    /* The full matrix is replicated on all nodes */
+    spm->replicated = 1;
+
     /*
      * Update the computed fields.
      * If dof < 0, please see example_user2.c
diff --git a/examples/example_lap2.c b/examples/example_lap2.c
index d82fa562..5db98f90 100644
--- a/examples/example_lap2.c
+++ b/examples/example_lap2.c
@@ -146,6 +146,9 @@ spm_example_create_laplacian( spmatrix_t *spm )
     spm->rowptr  = rowptr;
     spm->values  = values;
 
+    /* The full matrix is replicated on all nodes */
+    spm->replicated = 1;
+
     /*
      * Update the computed fields.
      */
diff --git a/examples/example_mdof1.c b/examples/example_mdof1.c
index e81177bb..d6bc18a6 100644
--- a/examples/example_mdof1.c
+++ b/examples/example_mdof1.c
@@ -179,6 +179,9 @@ spm_example_create_laplacian( spmatrix_t *spm )
     spm->nnz    += dim1 * (dim2 - 1) * dim3; /* Connexions along second axe */
     spm->nnz    += dim1 * dim2 * (dim3 - 1); /* Connexions along third axe  */
 
+    /* The full matrix is replicated on all nodes */
+    spm->replicated = 1;
+
     /* Force gN to allocate dof array in spmAlloc() */
     spm->gN  = spm->n;
     spm->dof = -1;
diff --git a/examples/example_mdof2.c b/examples/example_mdof2.c
index 394f4855..de2ffa94 100644
--- a/examples/example_mdof2.c
+++ b/examples/example_mdof2.c
@@ -173,6 +173,9 @@ spm_example_create_laplacian( spmatrix_t *spm )
     spm->rowptr  = rowptr;
     spm->values  = values;
 
+    /* The full matrix is replicated on all nodes */
+    spm->replicated = 1;
+
     /*
      * Update the computed fields.
      */
-- 
GitLab