From 675308a2eb894a9888d34ce372a0652aa8eb139c Mon Sep 17 00:00:00 2001
From: Alycia Lisito <alycia.lisito@inria.fr>
Date: Tue, 11 Jun 2024 18:04:06 +0200
Subject: [PATCH] zgetrf: add quark, parsec and openmp zipiv_redux codelet and
 update runtime_descriptor_ipiv

---
 runtime/openmp/codelets/codelet_ipiv.c        |  3 +-
 .../openmp/codelets/codelet_zipiv_allreduce.c | 35 +++++++++++++++++++
 .../openmp/control/runtime_descriptor_ipiv.c  | 16 ++++++---
 runtime/parsec/codelets/codelet_ipiv.c        |  3 +-
 .../parsec/codelets/codelet_zipiv_allreduce.c | 35 +++++++++++++++++++
 .../parsec/control/runtime_descriptor_ipiv.c  | 16 ++++++---
 runtime/quark/codelets/codelet_ipiv.c         |  3 +-
 .../quark/codelets/codelet_zipiv_allreduce.c  | 35 +++++++++++++++++++
 .../quark/control/runtime_descriptor_ipiv.c   | 16 ++++++---
 9 files changed, 147 insertions(+), 15 deletions(-)
 create mode 100644 runtime/openmp/codelets/codelet_zipiv_allreduce.c
 create mode 100644 runtime/parsec/codelets/codelet_zipiv_allreduce.c
 create mode 100644 runtime/quark/codelets/codelet_zipiv_allreduce.c

diff --git a/runtime/openmp/codelets/codelet_ipiv.c b/runtime/openmp/codelets/codelet_ipiv.c
index d6386bb58..548d688fb 100644
--- a/runtime/openmp/codelets/codelet_ipiv.c
+++ b/runtime/openmp/codelets/codelet_ipiv.c
@@ -28,13 +28,14 @@ void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
 }
 
 void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
-                               CHAM_ipiv_t *ipiv, int k, int h )
+                               CHAM_ipiv_t *ipiv, int k, int h, int rank )
 {
     assert( 0 );
     (void)options;
     (void)ipiv;
     (void)k;
     (void)h;
+    (void)rank;
 }
 
 void INSERT_TASK_ipiv_to_perm( const RUNTIME_option_t *options,
diff --git a/runtime/openmp/codelets/codelet_zipiv_allreduce.c b/runtime/openmp/codelets/codelet_zipiv_allreduce.c
new file mode 100644
index 000000000..b08828325
--- /dev/null
+++ b/runtime/openmp/codelets/codelet_zipiv_allreduce.c
@@ -0,0 +1,35 @@
+/**
+ *
+ * @file openmp/codelet_zipiv_allreduce.c
+ *
+ * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
+ *                      Univ. Bordeaux. All rights reserved.
+ *
+ ***
+ *
+ * @brief Chameleon openmp codelets to do the reduction
+ *
+ * @version 1.3.0
+ * @author Alycia Lisito
+ * @date 2024-06-11
+ * @precisions normal z -> c d s
+ *
+ */
+#include "chameleon_openmp.h"
+
+void INSERT_TASK_zipiv_allreduce( CHAM_desc_t            *A,
+                                  const RUNTIME_option_t *options,
+                                  CHAM_ipiv_t            *ipiv,
+                                  int                    *proc_involved,
+                                  int                     k,
+                                  int                     h,
+                                  int                     n )
+{
+    (void)A;
+    (void)options;
+    (void)ipiv;
+    (void)proc_involved;
+    (void)k;
+    (void)h;
+    (void)n;
+}
diff --git a/runtime/openmp/control/runtime_descriptor_ipiv.c b/runtime/openmp/control/runtime_descriptor_ipiv.c
index 9514b6fd0..3a727f01c 100644
--- a/runtime/openmp/control/runtime_descriptor_ipiv.c
+++ b/runtime/openmp/control/runtime_descriptor_ipiv.c
@@ -12,21 +12,27 @@
  * @version 1.3.0
  * @author Mathieu Faverge
  * @author Matthieu Kuhn
+ * @author Alycia Lisito
+ * @author Florent Pruvost
  * @date 2024-03-16
  *
  */
 #include "chameleon_openmp.h"
 
-void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv,
+                          const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
-void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv,
+                           const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
 void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
@@ -37,19 +43,21 @@ void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
     return NULL;
 }
 
-void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
 }
 
-void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
diff --git a/runtime/parsec/codelets/codelet_ipiv.c b/runtime/parsec/codelets/codelet_ipiv.c
index b9ac7e054..46fee3ee8 100644
--- a/runtime/parsec/codelets/codelet_ipiv.c
+++ b/runtime/parsec/codelets/codelet_ipiv.c
@@ -28,13 +28,14 @@ void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
 }
 
 void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
-                               CHAM_ipiv_t *ipiv, int k, int h )
+                               CHAM_ipiv_t *ipiv, int k, int h, int rank )
 {
     assert( 0 );
     (void)options;
     (void)ipiv;
     (void)k;
     (void)h;
+    (void)rank;
 }
 
 static inline int
diff --git a/runtime/parsec/codelets/codelet_zipiv_allreduce.c b/runtime/parsec/codelets/codelet_zipiv_allreduce.c
new file mode 100644
index 000000000..75e061164
--- /dev/null
+++ b/runtime/parsec/codelets/codelet_zipiv_allreduce.c
@@ -0,0 +1,35 @@
+/**
+ *
+ * @file parsec/codelet_zipiv_allreduce.c
+ *
+ * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
+ *                      Univ. Bordeaux. All rights reserved.
+ *
+ ***
+ *
+ * @brief Chameleon parsec codelets to do the reduction
+ *
+ * @version 1.3.0
+ * @author Alycia Lisito
+ * @date 2024-06-11
+ * @precisions normal z -> c d s
+ *
+ */
+#include "chameleon_parsec.h"
+
+void INSERT_TASK_zipiv_allreduce( CHAM_desc_t            *A,
+                                  const RUNTIME_option_t *options,
+                                  CHAM_ipiv_t            *ipiv,
+                                  int                    *proc_involved,
+                                  int                     k,
+                                  int                     h,
+                                  int                     n )
+{
+    (void)A;
+    (void)options;
+    (void)ipiv;
+    (void)proc_involved;
+    (void)k;
+    (void)h;
+    (void)n;
+}
diff --git a/runtime/parsec/control/runtime_descriptor_ipiv.c b/runtime/parsec/control/runtime_descriptor_ipiv.c
index 53621950f..6108199eb 100644
--- a/runtime/parsec/control/runtime_descriptor_ipiv.c
+++ b/runtime/parsec/control/runtime_descriptor_ipiv.c
@@ -12,21 +12,27 @@
  * @version 1.3.0
  * @author Mathieu Faverge
  * @author Matthieu Kuhn
+ * @author Alycia Lisito
+ * @author Florent Pruvost
  * @date 2024-03-16
  *
  */
 #include "chameleon_parsec.h"
 
-void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv,
+                          const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
-void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv,
+                           const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
 void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
@@ -37,19 +43,21 @@ void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
     return NULL;
 }
 
-void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
 }
 
-void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
diff --git a/runtime/quark/codelets/codelet_ipiv.c b/runtime/quark/codelets/codelet_ipiv.c
index ab982faf0..5fc849b89 100644
--- a/runtime/quark/codelets/codelet_ipiv.c
+++ b/runtime/quark/codelets/codelet_ipiv.c
@@ -28,13 +28,14 @@ void INSERT_TASK_ipiv_init( const RUNTIME_option_t *options,
 }
 
 void INSERT_TASK_ipiv_reducek( const RUNTIME_option_t *options,
-                               CHAM_ipiv_t *ipiv, int k, int h )
+                               CHAM_ipiv_t *ipiv, int k, int h, int rank )
 {
     assert( 0 );
     (void)options;
     (void)ipiv;
     (void)k;
     (void)h;
+    (void)rank;
 }
 
 static inline void
diff --git a/runtime/quark/codelets/codelet_zipiv_allreduce.c b/runtime/quark/codelets/codelet_zipiv_allreduce.c
new file mode 100644
index 000000000..e88269e93
--- /dev/null
+++ b/runtime/quark/codelets/codelet_zipiv_allreduce.c
@@ -0,0 +1,35 @@
+/**
+ *
+ * @file quark/codelet_zipiv_allreduce.c
+ *
+ * @copyright 2012-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
+ *                      Univ. Bordeaux. All rights reserved.
+ *
+ ***
+ *
+ * @brief Chameleon quark codelets to do the reduction
+ *
+ * @version 1.3.0
+ * @author Alycia Lisito
+ * @date 2024-06-11
+ * @precisions normal z -> c d s
+ *
+ */
+#include "chameleon_quark.h"
+
+void INSERT_TASK_zipiv_allreduce( CHAM_desc_t            *A,
+                                  const RUNTIME_option_t *options,
+                                  CHAM_ipiv_t            *ipiv,
+                                  int                    *proc_involved,
+                                  int                     k,
+                                  int                     h,
+                                  int                     n )
+{
+    (void)A;
+    (void)options;
+    (void)ipiv;
+    (void)proc_involved;
+    (void)k;
+    (void)h;
+    (void)n;
+}
diff --git a/runtime/quark/control/runtime_descriptor_ipiv.c b/runtime/quark/control/runtime_descriptor_ipiv.c
index 9edd6f041..f5fa28fe5 100644
--- a/runtime/quark/control/runtime_descriptor_ipiv.c
+++ b/runtime/quark/control/runtime_descriptor_ipiv.c
@@ -12,21 +12,27 @@
  * @version 1.3.0
  * @author Mathieu Faverge
  * @author Matthieu Kuhn
+ * @author Alycia Lisito
+ * @author Florent Pruvost
  * @date 2024-03-16
  *
  */
 #include "chameleon_quark.h"
 
-void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_create( CHAM_ipiv_t *ipiv,
+                          const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
-void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv )
+void RUNTIME_ipiv_destroy( CHAM_ipiv_t *ipiv,
+                           const CHAM_desc_t *desc )
 {
     assert( 0 );
     (void)ipiv;
+    (void)desc;
 }
 
 void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
@@ -37,19 +43,21 @@ void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
     return NULL;
 }
 
-void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
 }
 
-void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
+void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int rank, int m, int h )
 {
     assert( 0 );
     (void)ipiv;
+    (void)rank;
     (void)m;
     (void)h;
     return NULL;
-- 
GitLab