From 12cb13263c22ca385e4d86caa6700312dae5458a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?FEL=C5=A0=C3=96CI=20Marek?= <marek.felsoci@inria.fr>
Date: Sun, 5 Nov 2023 18:20:43 +0100
Subject: [PATCH] Remove HMAT option for shuffle clustering

---
 include/main.h |  6 ------
 src/hmat.c     | 24 ++++++------------------
 src/main.c     |  1 -
 3 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/include/main.h b/include/main.h
index 88cdb79..8420c70 100644
--- a/include/main.h
+++ b/include/main.h
@@ -45,12 +45,6 @@ extern ScalarType stype;
 /*! \brief  Wavelength (for oscillatory kernels). */
 extern double lambda;
 
-/*! \brief  Flag to use Hmat shuffle clustering (default is 0).
-
-  It can be changed with --use_hmat_shuffle (read in readFlagsTestHMAT() in hmat.c)
-*/
-extern int use_hmat_shuffle;
-
 /*! \brief Value of the Hmat shuffle clustering minimum divider (minimum number of children per box, default is 2)
 
   It can be changed with "--hmat_divider_min" (read in readFlagsTestHMAT() in hmat.c)
diff --git a/src/hmat.c b/src/hmat.c
index 3e4c3b0..339a6ba 100644
--- a/src/hmat.c
+++ b/src/hmat.c
@@ -20,12 +20,6 @@ int init_hmat_interface() {
 }
 
 int readFlagsTestHMAT(int *argc, char ***argv) {
-  /* Flag to use Hmat shuffle clustering */
-  if (MpfArgHasName(argc, *argv, 1, "--use_hmat_shuffle")) {
-    use_hmat_shuffle=1;
-    printf("Using Hmat shuffle clustering\n") ;
-  }
-
   /* Value of the Hmat shuffle clustering minimum divider (minimum number of children per box) */
   if (MpfArgGetInt(argc, *argv, 1, "--hmat_divider_min", &divider_min)) {
     printf("Reading Hmat shuffle clustering minimum divider = %d\n", divider_min) ;
@@ -349,19 +343,13 @@ HMAT_desc_t *HMAT_generate_matrix( hmat_interface_t *hi ) {
   hmat_clustering_algorithm_t *clustering = NULL;
   hmat_cluster_tree_builder_t *ct_builder;
 
-  if (use_hmat_shuffle) {
-    clustering = hmat_create_shuffle_clustering( hmat_create_clustering_median(),
-                                                 divider_min, divider_max );
-    ct_builder = hmat_create_cluster_tree_builder( clustering );
-  } else {
-    clustering = hmat_create_clustering_median();
-    if(mpf_hmat_settings.max_leaf_size > 0) {
-      printf("HMat maximum leaf size: %d\n", mpf_hmat_settings.max_leaf_size);
-      clustering = hmat_create_clustering_max_dof(clustering, mpf_hmat_settings.max_leaf_size);
-    }
-    hmat_set_clustering_divider(clustering, 2);
-    ct_builder = hmat_create_cluster_tree_builder( clustering );
+  clustering = hmat_create_clustering_median();
+  if(mpf_hmat_settings.max_leaf_size > 0) {
+    printf("HMat maximum leaf size: %d\n", mpf_hmat_settings.max_leaf_size);
+    clustering = hmat_create_clustering_max_dof(clustering, mpf_hmat_settings.max_leaf_size);
   }
+  hmat_set_clustering_divider(clustering, 2);
+  ct_builder = hmat_create_cluster_tree_builder( clustering );
 
   double *points = createCylinder();
   hmat_cluster_tree_t *cluster_tree = hmat_create_cluster_tree_from_builder( points, 3, nbPts,
diff --git a/src/main.c b/src/main.c
index ca3cba4..8f5fcba 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,7 +19,6 @@ int simplePrec = 0;
 int complexALGO = 1;
 ScalarType stype = DOUBLE_COMPLEX;
 double lambda;
-int use_hmat_shuffle = 0;
 int divider_min = 2;
 int divider_max = 4;
 int use_hodlr = 0;
-- 
GitLab