From 7ec28e8a4e0cad7515a6daa11dd20a2380c70b31 Mon Sep 17 00:00:00 2001
From: Lionel Eyraud-Dubois <lionel.eyraud-dubois@inria.fr>
Date: Thu, 12 May 2022 14:32:52 +0200
Subject: [PATCH] descriptors: Add an arg parameter to the rank_of functions to
 enable the use of more complex solutions.

---
 compute/pzgenm2.c                   | 15 +++++----
 compute/pzgepdf_qdwh.c              | 15 +++++----
 compute/pzhetrd_he2hb.c             |  7 ++--
 compute/pzlange.c                   | 17 +++++-----
 compute/pzlansy.c                   | 13 ++++----
 compute/pzlatms.c                   | 13 ++++----
 compute/pzplrnk.c                   |  9 ++---
 compute/zcesca.c                    | 15 +++++----
 compute/zgemm.c                     |  5 +--
 compute/zgetrf.c                    |  7 ++--
 compute/zgram.c                     |  9 ++---
 compute/zhemm.c                     |  9 ++---
 compute/zsymm.c                     |  9 ++---
 compute/ztile.c                     |  9 ++---
 control/chameleon_f77.c             | 11 +++---
 control/compute_z.h                 | 17 +++++-----
 control/descriptor.c                | 52 +++++++++++++++++++++--------
 control/descriptor.h                | 11 +++---
 control/descriptor_rec.c            | 17 ++++++----
 example/lapack_to_chameleon/step3.c | 15 +++++----
 include/chameleon.h                 | 13 +++++---
 include/chameleon/struct.h          |  6 ++--
 testing/testing_zgetrf.c            |  9 ++---
 testing/testing_zprint.c            | 11 +++---
 24 files changed, 187 insertions(+), 127 deletions(-)

diff --git a/compute/pzgenm2.c b/compute/pzgenm2.c
index 36b0ae6ee..77c07aa17 100644
--- a/compute/pzgenm2.c
+++ b/compute/pzgenm2.c
@@ -12,11 +12,12 @@
  *
  * @brief Chameleon parallel algorithm to compute 2-norm estimator.
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
  * @author Dalal Sukkari
  * @author Alycia Lisito
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -67,7 +68,7 @@ chameleon_pzgenm2( double tol, const CHAM_desc_t *A, double *result,
      */
     chameleon_desc_init( &DROW, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, A->nb, A->nb,
                          A->p, A->n, 0, 0, A->p, A->n, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     /**
      * NRMX must be allocated with GLOBAL to be able to access the norm value
      * after flushing the descriptor.
@@ -75,7 +76,7 @@ chameleon_pzgenm2( double tol, const CHAM_desc_t *A, double *result,
      */
     chameleon_desc_init( &NRMX, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 2, 1, 2,
                          A->p * 2, A->q, 0, 0, A->p * 2, A->q, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     /**
      * Start by computing the initial vector of the iterative process, and that
@@ -171,13 +172,13 @@ chameleon_pzgenm2( double tol, const CHAM_desc_t *A, double *result,
 
     chameleon_desc_init( &NRMSX, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 2, 1, 2,
                          A->p * 2, A->q, 0, 0, A->p * 2, A->q, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     chameleon_desc_init( &X,  CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble, 1, A->nb, A->nb,
                          A->p, A->n, 0, 0, A->p, A->n, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     chameleon_desc_init( &SX, CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble, A->mb, 1, A->mb,
                          A->m, A->q, 0, 0, A->m, A->q, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     cnt = 0;
     e0  = 0.;
diff --git a/compute/pzgepdf_qdwh.c b/compute/pzgepdf_qdwh.c
index 1f369ff3a..3cace25b8 100644
--- a/compute/pzgepdf_qdwh.c
+++ b/compute/pzgepdf_qdwh.c
@@ -11,10 +11,11 @@
  *
  * @brief Chameleon QDWH Polar Decomposition parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
  * @author Hatem Ltaief
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -109,23 +110,23 @@ chameleon_pzgepdf_qdwh_init( const CHAM_desc_t *U, const CHAM_desc_t *H,
                          ChamComplexDouble, ib, nb, ib * nb,
                          ib * U->mt, nb * U->nt, 0, 0,
                          ib * U->mt, nb * U->nt, U->p, U->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     chameleon_desc_init( TT1, CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, ib, nb, ib * nb,
                          ib * U->mt, nb * U->nt, 0, 0,
                          ib * U->mt, nb * U->nt, H->p, H->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( TS2, CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, ib, nb, ib * nb,
                          ib * H->mt, nb * H->nt, 0, 0,
                          ib * H->mt, nb * H->nt, U->p, U->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     chameleon_desc_init( TT2, CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, ib, nb, ib * nb,
                          ib * H->mt, nb * H->nt, 0, 0,
                          ib * H->mt, nb * H->nt, H->p, H->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     /*
      * Create the adapted trees to perform the QR factorizations
@@ -170,7 +171,7 @@ chameleon_pzgepdf_qdwh_init( const CHAM_desc_t *U, const CHAM_desc_t *H,
                          ChamComplexDouble, U->mb, U->nb, U->mb * U->nb,
                          U->n, U->m, 0, 0,
                          U->n, U->m, U->p, U->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     /*
      * Allocate the data descriptors for the lookahead if needed
diff --git a/compute/pzhetrd_he2hb.c b/compute/pzhetrd_he2hb.c
index 7d416d185..288cc9382 100644
--- a/compute/pzhetrd_he2hb.c
+++ b/compute/pzhetrd_he2hb.c
@@ -11,13 +11,14 @@
  *
  * @brief Chameleon zhetrd_he2hb parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Hatem Ltaief
  * @author Azzam Haidar
  * @author Mathieu Faverge
  * @author Samuel Thibault
  * @author Alycia Lisito
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -94,7 +95,7 @@ void chameleon_pzhetrd_he2hb(cham_uplo_t uplo,
     chameleon_desc_init( &AT, CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble, A->mb, A->nb, (A->mb*A->nb),
                          chameleon_min(A->mt, A->nt) * A->mb, A->nb, 0, 0,
                          chameleon_min(A->mt, A->nt) * A->mb, A->nb, 1, 1,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     /* Let's extract the diagonal in a temporary copy that contains A and A' */
     for (k = 1; k < A->nt; k++){
diff --git a/compute/pzlange.c b/compute/pzlange.c
index fd29e505e..4944d8fb4 100644
--- a/compute/pzlange.c
+++ b/compute/pzlange.c
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon zlange parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @comment This file has been automatically generated
  *          from Plasma 2.6.0 for CHAMELEON 0.9.2
  * @author Emmanuel Agullo
  * @author Mathieu Faverge
  * @author Florent Pruvost
  * @author Alycia Lisito
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -403,7 +404,7 @@ void chameleon_pzlange_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_dia
 
         chameleon_desc_init( &Wcol, CHAMELEON_MAT_ALLOC_TILE, ChamRealDouble, 1, A->nb, A->nb,
                              workmt, worknt * A->nb, 0, 0, workmt, worknt * A->nb, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         wcol_init = 1;
 
         /*
@@ -411,7 +412,7 @@ void chameleon_pzlange_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_dia
          */
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, 1, 1,
                              A->p, worknt, 0, 0, A->p, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
 
         break;
 
@@ -423,12 +424,12 @@ void chameleon_pzlange_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_dia
 
         chameleon_desc_init( &Wcol, CHAMELEON_MAT_ALLOC_TILE, ChamRealDouble, A->mb, 1, A->mb,
                              workmt * A->mb, worknt, 0, 0, workmt * A->mb, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         wcol_init = 1;
 
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, 1, 1,
                              workmt, A->q, 0, 0, workmt, A->q, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         break;
 
         /*
@@ -440,7 +441,7 @@ void chameleon_pzlange_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_dia
         alpha = 1.;
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 2, 1, 2,
                              workmt*2, worknt, 0, 0, workmt*2, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         break;
 
         /*
@@ -452,7 +453,7 @@ void chameleon_pzlange_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_dia
 
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, 1, 1,
                              workmt, worknt, 0, 0, workmt, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
     }
 
     /* Initialize workspaces */
diff --git a/compute/pzlansy.c b/compute/pzlansy.c
index c19aada11..9c427cee9 100644
--- a/compute/pzlansy.c
+++ b/compute/pzlansy.c
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon zlansy parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @comment This file has been automatically generated
  *          from Plasma 2.6.0 for CHAMELEON 0.9.2
  * @author Emmanuel Agullo
  * @author Mathieu Faverge
  * @author Florent Pruvost
  * @author Alycia Lisito
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> c d s
  *
  */
@@ -330,7 +331,7 @@ void chameleon_pzlansy_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_tra
 
         chameleon_desc_init( &Wcol, CHAMELEON_MAT_ALLOC_TILE, ChamRealDouble, A->mb, 1, A->mb,
                              workmt * A->mb, worknt, 0, 0, workmt * A->mb, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         wcol_init = 1;
 
         /*
@@ -338,7 +339,7 @@ void chameleon_pzlansy_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_tra
          */
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, 1, 1,
                              workmt, A->q, 0, 0, workmt, A->q, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         break;
 
         /*
@@ -350,7 +351,7 @@ void chameleon_pzlansy_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_tra
         alpha = 1.;
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 2, 1, 2,
                              workmt*2, worknt, 0, 0, workmt*2, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         break;
 
         /*
@@ -362,7 +363,7 @@ void chameleon_pzlansy_generic( cham_normtype_t norm, cham_uplo_t uplo, cham_tra
 
         chameleon_desc_init( &Welt, CHAMELEON_MAT_ALLOC_GLOBAL, ChamRealDouble, 1, 1, 1,
                              workmt, worknt, 0, 0, workmt, worknt, A->p, A->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
     }
 
     /* Initialize workspaces */
diff --git a/compute/pzlatms.c b/compute/pzlatms.c
index 3881a9f9d..c8e1fa5a9 100644
--- a/compute/pzlatms.c
+++ b/compute/pzlatms.c
@@ -10,9 +10,10 @@
  *
  * @brief Chameleon zlatms parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -212,12 +213,12 @@ void chameleon_pzlatms( cham_dist_t idist, unsigned long long int seed, cham_sym
                              ChamComplexDouble, ib, descU.nb, ib * descU.nb,
                              ib * descU.mt, descU.nb * descU.nt, 0, 0,
                              ib * descU.mt, descU.nb * descU.nt, descU.p, descU.q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         chameleon_desc_init( &descTT, CHAMELEON_MAT_ALLOC_TILE,
                              ChamComplexDouble, ib, descU.nb, ib * descU.nb,
                              ib * descU.mt, descU.nb * descU.nt, 0, 0,
                              ib * descU.mt, descU.nb * descU.nt, descU.p, descU.q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
 
         /* U <= qr(U) */
         chameleon_pzgeqrf_param( 1, kt, &qrtree, &descU,
@@ -283,12 +284,12 @@ void chameleon_pzlatms( cham_dist_t idist, unsigned long long int seed, cham_sym
                              ChamComplexDouble, ib, descV.nb, ib * descV.nb,
                              ib * descV.mt, descV.nb * descV.nt, 0, 0,
                              ib * descV.mt, descV.nb * descV.nt, descV.p, descV.q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         chameleon_desc_init( &descTT, CHAMELEON_MAT_ALLOC_TILE,
                              ChamComplexDouble, ib, descV.nb, ib * descV.nb,
                              ib * descV.mt, descV.nb * descV.nt, 0, 0,
                              ib * descV.mt, descV.nb * descV.nt, descV.p, descV.q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
 
         /* V <= qr(V) */
         chameleon_pzgelqf_param( 1, kt, &qrtree, &descV,
diff --git a/compute/pzplrnk.c b/compute/pzplrnk.c
index c4367c4cc..368ddec75 100644
--- a/compute/pzplrnk.c
+++ b/compute/pzplrnk.c
@@ -9,10 +9,11 @@
  *
  * @brief Chameleon zplrnk parallel algorithm
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
  * @author Florent Pruvost
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -48,12 +49,12 @@ void chameleon_pzplrnk( int K, CHAM_desc_t *C,
                          ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                          C->mt * C->mb, C->nb * C->q, 0, 0,
                          C->mt * C->mb, C->nb * C->q, C->p, C->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
     chameleon_desc_init( &WB, CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                          C->mb * C->p, C->nt * C->nb, 0, 0,
                          C->mb * C->p, C->nt * C->nb, C->p, C->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     KT = (K + C->mb - 1) / C->mb;
     myp = C->myrank / C->q;
diff --git a/compute/zcesca.c b/compute/zcesca.c
index 36c735842..76489d42f 100644
--- a/compute/zcesca.c
+++ b/compute/zcesca.c
@@ -9,9 +9,10 @@
  *
  * @brief Chameleon zcesca wrappers
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Florent Pruvost
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c z
  *
  */
@@ -61,31 +62,31 @@ void *CHAMELEON_zcesca_WS_Alloc( const CHAM_desc_t *A )
                          ChamComplexDouble, 1, A->nb, A->nb,
                          workmt, A->n, 0, 0,
                          workmt, A->n, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( &(options->Wgrow), CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, A->mb, 1, A->mb,
                          A->m, worknt, 0, 0,
                          A->m, worknt, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( &(options->Wgelt), CHAMELEON_MAT_ALLOC_TILE,
                          ChamComplexDouble, 1, 1, 1,
                          1, worknt, 0, 0,
                          1, worknt, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( &(options->Wdcol), CHAMELEON_MAT_ALLOC_TILE,
                          ChamRealDouble, 2, A->nb, 2*A->nb,
                          2*workmt, A->n, 0, 0,
                          2*workmt, A->n, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( &(options->Wdrow), CHAMELEON_MAT_ALLOC_TILE,
                          ChamRealDouble, A->mb, 2, 2*A->mb,
                          A->m, 2*worknt, 0, 0,
                          A->m, 2*worknt, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     return (void*)options;
 }
diff --git a/compute/zgemm.c b/compute/zgemm.c
index def663153..d8892fe79 100644
--- a/compute/zgemm.c
+++ b/compute/zgemm.c
@@ -18,6 +18,7 @@
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
  * @author Florent Pruvost
+ * @author Lionel Eyraud-Dubois
  * @date 2023-07-05
  * @precisions normal z -> s d c
  *
@@ -182,12 +183,12 @@ void *CHAMELEON_zgemm_WS_Alloc( cham_trans_t       transA __attribute__((unused)
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mt * C->mb, C->nb * C->q * lookahead, 0, 0,
                              C->mt * C->mb, C->nb * C->q * lookahead, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         chameleon_desc_init( &(options->WB), CHAMELEON_MAT_ALLOC_TILE,
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mb * C->p * lookahead, C->nt * C->nb, 0, 0,
                              C->mb * C->p * lookahead, C->nt * C->nb, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
     }
 
     return (void*)options;
diff --git a/compute/zgetrf.c b/compute/zgetrf.c
index 72c595373..4a39cb5bb 100644
--- a/compute/zgetrf.c
+++ b/compute/zgetrf.c
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon zgetrf wrappers
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Omar Zenati
  * @author Mathieu Faverge
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
  * @author Florent Pruvost
  * @author Matthieu Kuhn
- * @date 2023-02-21
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  * @precisions normal z -> s d c
  *
@@ -86,7 +87,7 @@ CHAMELEON_zgetrf_WS_Alloc( const CHAM_desc_t *A )
                              ChamComplexDouble, 1, A->nb, A->nb,
                              A->mt, A->nt * A->nb, 0, 0,
                              A->mt, A->nt * A->nb, A->p, A->q,
-                             NULL, NULL, A->get_rankof_init );
+                             NULL, NULL, A->get_rankof_init, A->get_rankof_init_arg );
     }
 
     return ws;
diff --git a/compute/zgram.c b/compute/zgram.c
index fac51926e..141f0ffcd 100644
--- a/compute/zgram.c
+++ b/compute/zgram.c
@@ -9,11 +9,12 @@
  *
  * @brief Chameleon zgram wrappers
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
  * @author Florent Pruvost
  * @author Philippe Swartvagher
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c z
  *
  */
@@ -64,13 +65,13 @@ void *CHAMELEON_zgram_WS_Alloc( const CHAM_desc_t *A )
                          ChamRealDouble, 2, A->nb, 2*A->nb,
                          2*workmt, A->n, 0, 0,
                          2*workmt, A->n, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     chameleon_desc_init( &(options->Welt), CHAMELEON_MAT_ALLOC_TILE,
                          ChamRealDouble, 2, 1, 2,
                          2, worknt, 0, 0,
                          2, worknt, A->p, A->q,
-                         NULL, NULL, NULL );
+                         NULL, NULL, NULL, NULL );
 
     return (void*)options;
 }
diff --git a/compute/zhemm.c b/compute/zhemm.c
index 92ea46502..8b01715c4 100644
--- a/compute/zhemm.c
+++ b/compute/zhemm.c
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon zhemm wrappers
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @comment This file has been automatically generated
  *          from Plasma 2.5.0 for CHAMELEON 0.9.2
  * @author Mathieu Faverge
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
  * @author Florent Pruvost
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> c
  *
  */
@@ -158,12 +159,12 @@ void *CHAMELEON_zhemm_WS_Alloc( cham_side_t        side __attribute__((unused)),
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mt * C->mb, C->nb * C->q * lookahead, 0, 0,
                              C->mt * C->mb, C->nb * C->q * lookahead, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         chameleon_desc_init( &(options->WB), CHAMELEON_MAT_ALLOC_TILE,
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mb * C->p * lookahead, C->nt * C->nb, 0, 0,
                              C->mb * C->p * lookahead, C->nt * C->nb, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
     }
 
     return (void*)options;
diff --git a/compute/zsymm.c b/compute/zsymm.c
index fe680aa28..f493497b8 100644
--- a/compute/zsymm.c
+++ b/compute/zsymm.c
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon zsymm wrappers
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @comment This file has been automatically generated
  *          from Plasma 2.5.0 for CHAMELEON 0.9.2
  * @author Mathieu Faverge
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
  * @author Florent Pruvost
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -158,12 +159,12 @@ void *CHAMELEON_zsymm_WS_Alloc( cham_side_t        side __attribute__((unused)),
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mt * C->mb, C->nb * C->q * lookahead, 0, 0,
                              C->mt * C->mb, C->nb * C->q * lookahead, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
         chameleon_desc_init( &(options->WB), CHAMELEON_MAT_ALLOC_TILE,
                              ChamComplexDouble, C->mb, C->nb, (C->mb * C->nb),
                              C->mb * C->p * lookahead, C->nt * C->nb, 0, 0,
                              C->mb * C->p * lookahead, C->nt * C->nb, C->p, C->q,
-                             NULL, NULL, NULL );
+                             NULL, NULL, NULL, NULL );
     }
 
     return (void*)options;
diff --git a/compute/ztile.c b/compute/ztile.c
index bdcfd29e7..2e2707908 100644
--- a/compute/ztile.c
+++ b/compute/ztile.c
@@ -11,12 +11,13 @@
  *
  * @brief Chameleon auxiliary routines
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Jakub Kurzak
  * @author Mathieu Faverge
  * @author Cedric Castagnede
  * @author Florent Pruvost
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> s d c
  *
  */
@@ -139,7 +140,7 @@ int CHAMELEON_zLap2Desc( cham_uplo_t uplo, CHAMELEON_Complex64_t *Af77, int LDA,
     /* Create the B descriptor to handle the Lapack format matrix */
     status = CHAMELEON_Desc_Create_User( &B, Af77, ChamComplexDouble, A->mb, A->nb, A->bsiz,
                                          LDA, A->n, 0, 0, A->m, A->n, 1, 1,
-                                         chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+                                         chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
     if ( status != CHAMELEON_SUCCESS ) {
         chameleon_error("CHAMELEON_zTile_to_Lapack", "Failed to create the descriptor");
         return status;
@@ -223,7 +224,7 @@ int CHAMELEON_zDesc2Lap( cham_uplo_t uplo, CHAM_desc_t *A, CHAMELEON_Complex64_t
     /* Create the B descriptor to handle the Lapack format matrix */
     status = CHAMELEON_Desc_Create_User( &B, Af77, ChamComplexDouble, A->mb, A->nb, A->bsiz,
                                          LDA, A->n, 0, 0, A->m, A->n, 1, 1,
-                                         chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+                                         chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
     if ( status != CHAMELEON_SUCCESS ) {
         chameleon_error("CHAMELEON_zTile_to_Lapack", "Failed to create the descriptor");
         return status;
diff --git a/control/chameleon_f77.c b/control/chameleon_f77.c
index 21a6316ee..648c80793 100644
--- a/control/chameleon_f77.c
+++ b/control/chameleon_f77.c
@@ -11,13 +11,14 @@
  *
  * @brief Chameleon Fortran77 interface
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Bilel Hadri
  * @author Cedric Castagnede
  * @author Florent Pruvost
  * @author Mathieu Faverge
  * @author Philippe Virouleau
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  */
 #include "control/common.h"
@@ -80,16 +81,18 @@ extern "C" {
                                 void* (*get_blkaddr)( const CHAM_desc_t*, int, int ),
                                 int   (*get_blkldd) ( const CHAM_desc_t*, int      ),
                                 int   (*get_rankof) ( const CHAM_desc_t*, int, int ),
+                                void* get_rankof_arg,
                                 int *INFO)
     {   *INFO = CHAMELEON_Desc_Create_User(descptr, mat, *dtyp, *mb, *nb, *bsiz, *lm, *ln, *i, *j, *m, *n, *p, *q,
-                                       get_blkaddr, get_blkldd, get_rankof); }
+                                           get_blkaddr, get_blkldd, get_rankof, get_rankof_arg); }
     void CHAMELEON_DESC_CREATE_OOC_USER(CHAM_desc_t **descptr, cham_flttype_t *dtyp,
                                     int *mb, int *nb, int *bsiz, int *lm, int *ln,
                                     int *i, int *j, int *m, int *n, int *p, int *q,
                                     int (*get_rankof) ( const CHAM_desc_t*, int, int ),
+                                    void* get_rankof_arg,
                                     int *INFO)
     {   *INFO = CHAMELEON_Desc_Create_OOC_User(descptr, *dtyp, *mb, *nb, *bsiz, *lm, *ln, *i, *j, *m, *n, *p, *q,
-                                           get_rankof); }
+                                               get_rankof, get_rankof_arg); }
 
     void CHAMELEON_DESC_DESTROY(CHAM_desc_t **desc, int *INFO)
     {   *INFO = CHAMELEON_Desc_Destroy(desc); }
diff --git a/control/compute_z.h b/control/compute_z.h
index 634bd2d5c..8bec9da5f 100644
--- a/control/compute_z.h
+++ b/control/compute_z.h
@@ -11,7 +11,7 @@
  *
  * @brief Chameleon computational functions header
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @comment This file has been automatically generated
  *          from Plasma 2.5.0 for CHAMELEON 0.9.2
  * @author Jakub Kurzak
@@ -21,7 +21,8 @@
  * @author Florent Pruvost
  * @author Alycia Lisito
  * @author Matthieu Kuhn
- * @date 2023-02-21
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> c d s
  *
  */
@@ -219,7 +220,7 @@ chameleon_zdesc_alloc_diag( CHAM_desc_t *descA, int nb, int m, int n, int p, int
                                 diag_m, nb, 0, 0, diag_m, nb, p, q,
                                 chameleon_getaddr_diag,
                                 chameleon_getblkldd_ccrb,
-                                chameleon_getrankof_2d_diag );
+                                chameleon_getrankof_2d_diag, NULL );
 }
 
 #define chameleon_zdesc_alloc( descA, mb, nb, lm, ln, i, j, m, n, free) \
@@ -228,7 +229,7 @@ chameleon_zdesc_alloc_diag( CHAM_desc_t *descA, int nb, int m, int n, int p, int
         rc = chameleon_desc_init( &(descA), CHAMELEON_MAT_ALLOC_GLOBAL, \
                                   ChamComplexDouble, (mb), (nb), ((mb)*(nb)), \
                                   (m), (n), (i), (j), (m), (n), 1, 1,   \
-                                  NULL, NULL, NULL );                   \
+                                  NULL, NULL, NULL, NULL );             \
         if ( rc != CHAMELEON_SUCCESS ) {                                \
             {free;}                                                     \
             return rc;                                                  \
@@ -254,7 +255,7 @@ chameleon_zdesc_copy_and_restrict( const CHAM_desc_t *descIn,
                               m, n, 0, 0, m, n, descIn->p, descIn->q,
                               descIn->get_blkaddr,
                               descIn->get_blkldd,
-                              descIn->get_rankof_init );
+                              descIn->get_rankof_init, descIn->get_rankof_init_arg );
     return rc;
 }
 
@@ -273,13 +274,13 @@ chameleon_zlap2tile( CHAM_context_t *chamctxt,
         /* Initialize the Lapack descriptor */
         chameleon_desc_init( descAl, A, ChamComplexDouble, mb, nb, (mb)*(nb),
                             lm, ln, 0, 0, m, n, 1, 1,
-                            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL  );
+                             chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
         descAl->styp = ChamCM;
 
         /* Initialize the tile descriptor */
         chameleon_desc_init( descAt, CHAMELEON_MAT_ALLOC_TILE, ChamComplexDouble, mb, nb, (mb)*(nb),
                              lm, ln, 0, 0, m, n, 1, 1,
-                             chameleon_getaddr_ccrb, chameleon_getblkldd_ccrb, NULL );
+                             chameleon_getaddr_ccrb, chameleon_getblkldd_ccrb, NULL, NULL );
 
         if ( mode & ChamDescInput ) {
             chameleon_pzlacpy( uplo, descAl, descAt, seq, req );
@@ -289,7 +290,7 @@ chameleon_zlap2tile( CHAM_context_t *chamctxt,
         /* Initialize the tile descriptor */
         chameleon_desc_init( descAt, A, ChamComplexDouble, mb, nb, (mb)*(nb),
                              lm, ln, 0, 0, m, n, 1, 1,
-                             chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+                             chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
     }
     return CHAMELEON_SUCCESS;
 }
diff --git a/control/descriptor.c b/control/descriptor.c
index c5e4ca2d2..1436ad25d 100644
--- a/control/descriptor.c
+++ b/control/descriptor.c
@@ -18,7 +18,8 @@
  * @author Guillaume Sylvand
  * @author Raphael Boucherie
  * @author Samuel Thibault
- * @date 2023-07-04
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  ***
  *
@@ -169,6 +170,9 @@ void chameleon_desc_init_tiles( CHAM_desc_t *desc, blkrankof_fct_t rankof )
  * @param[in] get_rankof
  *          A function that return the MPI rank of the tile A(m,n).
  *
+ * @param[in] get_rankof_arg
+ *          A pointer to custom data that can be used by the get_rankof function
+ *
  ******************************************************************************
  *
  * @return  The descriptor with the matrix description parameters set.
@@ -179,7 +183,8 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat
                                   int lm, int ln, int m, int n, int p, int q,
                                   blkaddr_fct_t   get_blkaddr,
                                   blkldd_fct_t    get_blkldd,
-                                  blkrankof_fct_t get_rankof )
+                                  blkrankof_fct_t get_rankof,
+                                  void           *get_rankof_arg )
 {
     CHAM_context_t *chamctxt;
     int rc = CHAMELEON_SUCCESS;
@@ -200,6 +205,7 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat
     desc->get_blkldd  = get_blkldd  ? get_blkldd  : chameleon_getblkldd_ccrb;
     desc->get_rankof  = chameleon_getrankof_tile;
     desc->get_rankof_init = get_rankof ? get_rankof : chameleon_getrankof_2d;
+    desc->get_rankof_init_arg = get_rankof_arg;
 
     /* Matrix properties */
     desc->dtyp = dtyp;
@@ -492,9 +498,17 @@ CHAMELEON_Desc_SubMatrix( CHAM_desc_t *descA, int i, int j, int m, int n )
 int CHAMELEON_Desc_Create( CHAM_desc_t **descptr, void *mat, cham_flttype_t dtyp, int mb, int nb, int bsiz,
                            int lm, int ln, int i, int j, int m, int n, int p, int q )
 {
+    blkrankof_fct_t get_rankof = NULL;
+
+    /* if (getenv("CHAMELEON_1Dx1D_DISTRIBUTION")){ */
+    /*     printf("[CHAMELEON] : Using 1Dx1D distribubtion\n"); */
+    /*     get_rankof = chameleon_getrankof_custom; */
+    /*     load_dist(&custom_dist_a, m, n, mb, nb); */
+    /* } */
+
     return CHAMELEON_Desc_Create_User( descptr, mat, dtyp, mb, nb, bsiz,
                                        lm, ln, i, j, m, n, p, q,
-                                       NULL, NULL, NULL );
+                                       NULL, NULL, get_rankof, NULL );
 }
 
 /**
@@ -564,6 +578,9 @@ int CHAMELEON_Desc_Create( CHAM_desc_t **descptr, void *mat, cham_flttype_t dtyp
  * @param[in] get_rankof
  *          A function that return the MPI rank of the tile A(m,n).
  *
+ * @param[in] get_rankof_arg
+ *          A pointer to custom data that can be used by the get_rankof function
+ *
  ******************************************************************************
  *
  * @retval CHAMELEON_SUCCESS successful exit
@@ -573,7 +590,8 @@ int CHAMELEON_Desc_Create_User( CHAM_desc_t **descptr, void *mat, cham_flttype_t
                                 int lm, int ln, int i, int j, int m, int n, int p, int q,
                                 blkaddr_fct_t   get_blkaddr,
                                 blkldd_fct_t    get_blkldd,
-                                blkrankof_fct_t get_rankof )
+                                blkrankof_fct_t get_rankof,
+                                void* get_rankof_arg )
 {
     CHAM_context_t *chamctxt;
     CHAM_desc_t *desc;
@@ -594,7 +612,7 @@ int CHAMELEON_Desc_Create_User( CHAM_desc_t **descptr, void *mat, cham_flttype_t
 
     chameleon_desc_init( desc, mat, dtyp, mb, nb, bsiz,
                          lm, ln, i, j, m, n, p, q,
-                         get_blkaddr, get_blkldd, get_rankof );
+                         get_blkaddr, get_blkldd, get_rankof, get_rankof_arg );
 
     status = chameleon_desc_check( desc );
     if (status != CHAMELEON_SUCCESS) {
@@ -663,6 +681,9 @@ int CHAMELEON_Desc_Create_User( CHAM_desc_t **descptr, void *mat, cham_flttype_t
  * @param[in] get_rankof
  *          A function that return the MPI rank of the tile A(m,n).
  *
+ * @param[in] get_rankof_arg
+ *          A pointer to custom data that can be used by the get_rankof function
+ *
  ******************************************************************************
  *
  * @retval CHAMELEON_SUCCESS successful exit
@@ -670,7 +691,7 @@ int CHAMELEON_Desc_Create_User( CHAM_desc_t **descptr, void *mat, cham_flttype_t
  */
 int CHAMELEON_Desc_Create_OOC_User(CHAM_desc_t **descptr, cham_flttype_t dtyp, int mb, int nb, int bsiz,
                                    int lm, int ln, int i, int j, int m, int n, int p, int q,
-                                   blkrankof_fct_t get_rankof )
+                                   blkrankof_fct_t get_rankof, void* get_rankof_arg )
 {
 #if !defined (CHAMELEON_SCHED_STARPU)
     (void)descptr; (void)dtyp; (void)mb; (void)nb; (void)bsiz;
@@ -683,7 +704,7 @@ int CHAMELEON_Desc_Create_OOC_User(CHAM_desc_t **descptr, cham_flttype_t dtyp, i
     int rc;
     rc = CHAMELEON_Desc_Create_User( descptr, CHAMELEON_MAT_OOC, dtyp, mb, nb, bsiz,
                                      lm, ln, i, j, m, n, p, q,
-                                     chameleon_getaddr_null, NULL, get_rankof );
+                                     chameleon_getaddr_null, NULL, get_rankof, get_rankof_arg );
     return rc;
 #endif
 }
@@ -751,7 +772,7 @@ int CHAMELEON_Desc_Create_OOC(CHAM_desc_t **descptr, cham_flttype_t dtyp, int mb
 {
     return CHAMELEON_Desc_Create_User( descptr, CHAMELEON_MAT_OOC, dtyp, mb, nb, bsiz,
                                        lm, ln, i, j, m, n, p, q,
-                                       chameleon_getaddr_null, NULL, NULL );
+                                       chameleon_getaddr_null, NULL, NULL, NULL );
 }
 
 /**
@@ -785,7 +806,7 @@ CHAM_desc_t *CHAMELEON_Desc_Copy( const CHAM_desc_t *descin, void *mat )
     CHAMELEON_Desc_Create_User( &descout, mat,
                                 descin->dtyp, descin->mb, descin->nb, descin->bsiz,
                                 descin->lm, descin->ln, descin->i, descin->j, descin->m, descin->n, descin->p, descin->q,
-                                NULL, NULL, descin->get_rankof_init );
+                                NULL, NULL, descin->get_rankof_init, descin->get_rankof_init_arg );
     return descout;
 }
 
@@ -820,7 +841,7 @@ CHAM_desc_t *CHAMELEON_Desc_CopyOnZero( const CHAM_desc_t *descin, void *mat )
     CHAMELEON_Desc_Create_User( &descout, mat,
                                 descin->dtyp, descin->mb, descin->nb, descin->bsiz,
                                 descin->lm, descin->ln, descin->i, descin->j, descin->m, descin->n, 1, 1,
-                                NULL, NULL, descin->get_rankof_init );
+                                NULL, NULL, descin->get_rankof_init, descin->get_rankof_init_arg );
     return descout;
 }
 
@@ -1043,7 +1064,8 @@ CHAMELEON_Desc_Print( const CHAM_desc_t *desc )
  */
 int CHAMELEON_Desc_Change_Distribution( cham_uplo_t      uplo,
                                         CHAM_desc_t     *desc,
-                                        blkrankof_fct_t  new_get_rankof )
+                                        blkrankof_fct_t  new_get_rankof,
+                                        void*            new_get_rankof_arg )
 {
     int                 status;
     CHAM_context_t     *chamctxt;
@@ -1057,7 +1079,7 @@ int CHAMELEON_Desc_Change_Distribution( cham_uplo_t      uplo,
 
     chameleon_sequence_create( chamctxt, &sequence );
 
-    CHAMELEON_Desc_Change_Distribution_Async( uplo, desc, new_get_rankof, sequence );
+    CHAMELEON_Desc_Change_Distribution_Async( uplo, desc, new_get_rankof, new_get_rankof_arg, sequence );
 
     RUNTIME_desc_flush( desc, sequence );
     chameleon_sequence_wait( chamctxt, sequence );
@@ -1098,6 +1120,7 @@ int CHAMELEON_Desc_Change_Distribution( cham_uplo_t      uplo,
 int CHAMELEON_Desc_Change_Distribution_Async( cham_uplo_t         uplo,
                                               CHAM_desc_t        *desc,
                                               blkrankof_fct_t     new_get_rankof,
+                                              void*               new_get_rankof_arg,
                                               RUNTIME_sequence_t *sequence )
 {
     CHAM_context_t *chamctxt;
@@ -1111,7 +1134,8 @@ int CHAMELEON_Desc_Change_Distribution_Async( cham_uplo_t         uplo,
     }
 
     /* Nothing to do if the new mapping is the same as the original one */
-    if ( ( new_get_rankof == desc->get_rankof_init ) ||
+    if ( ( ( new_get_rankof     == desc->get_rankof_init    ) &&
+           ( new_get_rankof_arg == desc->get_rankof_init_arg) ) ||
          ( RUNTIME_comm_size( chamctxt ) == 1 ) )
     {
         return CHAMELEON_SUCCESS;
@@ -1132,6 +1156,8 @@ int CHAMELEON_Desc_Change_Distribution_Async( cham_uplo_t         uplo,
     }
 #endif
 
+    desc->get_rankof_init_arg = new_get_rankof_arg;
+
     for ( n = 0; n < desc->nt; n++ ) {
         mmin = ( uplo == ChamLower ) ? chameleon_min( n,   desc->mt ) : 0;
         mmax = ( uplo == ChamUpper ) ? chameleon_min( n+1, desc->mt ) : desc->mt;
diff --git a/control/descriptor.h b/control/descriptor.h
index 96bf0bf0b..38153b6b2 100644
--- a/control/descriptor.h
+++ b/control/descriptor.h
@@ -19,7 +19,8 @@
  * @author Guillaume Sylvand
  * @author Raphael Boucherie
  * @author Samuel Thibault
- * @date 2023-07-04
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  */
 #ifndef _chameleon_descriptor_h_
@@ -48,7 +49,8 @@ int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat
                                   int lm, int ln, int m, int n, int p, int q,
                                   void* (*get_blkaddr)( const CHAM_desc_t*, int, int ),
                                   int   (*get_blkldd) ( const CHAM_desc_t*, int      ),
-                                  int   (*get_rankof) ( const CHAM_desc_t*, int, int ) );
+                                  int   (*get_rankof) ( const CHAM_desc_t*, int, int ),
+                                  void* get_rankof_arg );
 
 
 static inline int chameleon_desc_init( CHAM_desc_t *desc, void *mat,
@@ -57,7 +59,8 @@ static inline int chameleon_desc_init( CHAM_desc_t *desc, void *mat,
                                        int m,  int n,  int p, int q,
                                        void* (*get_blkaddr)( const CHAM_desc_t*, int, int ),
                                        int   (*get_blkldd) ( const CHAM_desc_t*, int      ),
-                                       int   (*get_rankof) ( const CHAM_desc_t*, int, int ) )
+                                       int   (*get_rankof) ( const CHAM_desc_t*, int, int ),
+                                       void* get_rankof_arg)
 {
     assert( i == 0 );
     assert( j == 0 );
@@ -66,7 +69,7 @@ static inline int chameleon_desc_init( CHAM_desc_t *desc, void *mat,
     (void)i;
     (void)j;
     return chameleon_desc_init_internal( desc, NULL, mat, dtyp, mb, nb, lm, ln, m, n, p, q,
-                                         get_blkaddr, get_blkldd, get_rankof );
+                                         get_blkaddr, get_blkldd, get_rankof, get_rankof_arg );
 }
 
 CHAM_desc_t* chameleon_desc_submatrix( CHAM_desc_t *descA, int i, int j, int m, int n );
diff --git a/control/descriptor_rec.c b/control/descriptor_rec.c
index a69171411..058758b66 100644
--- a/control/descriptor_rec.c
+++ b/control/descriptor_rec.c
@@ -11,10 +11,11 @@
  *
  * @brief Chameleon descriptors routines
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Mathieu Faverge
  * @author Gwenole Lucas
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  */
 #include "control/common.h"
@@ -24,7 +25,8 @@ static int
 chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, cham_flttype_t dtyp,
                           int *mb, int *nb,
                           int lm, int ln, int m, int n, int p, int q,
-                          blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd, blkrankof_fct_t get_rankof )
+                          blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd,
+                          blkrankof_fct_t get_rankof, void* get_rankof_arg )
 {
     CHAM_context_t *chamctxt;
     CHAM_desc_t    *desc;
@@ -49,7 +51,7 @@ chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, ch
     desc = (CHAM_desc_t*)malloc(sizeof(CHAM_desc_t));
     rc = chameleon_desc_init_internal( desc, name, mat, dtyp, mb[0], nb[0],
                                        lm, ln, m, n, p, q,
-                                       get_blkaddr, get_blkldd, get_rankof );
+                                       get_blkaddr, get_blkldd, get_rankof, get_rankof_arg );
     *descptr = desc;
 
     if ( rc != CHAMELEON_SUCCESS ) {
@@ -81,7 +83,7 @@ chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, ch
                                            tile->ld, tempnn, /* Abuse as ln is not used */
                                            tempmm, tempnn,
                                            1, 1,             /* can recurse only on local data */
-                                           chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL);
+                                           chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL);
 
             tile->format = CHAMELEON_TILE_DESC;
             tile->mat    = tiledesc;
@@ -98,7 +100,8 @@ chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, ch
 int
 CHAMELEON_Recursive_Desc_Create( CHAM_desc_t **descptr, void *mat, cham_flttype_t dtyp,
                                  int *mb, int *nb, int lm, int ln, int m, int n, int p, int q,
-                                 blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd, blkrankof_fct_t get_rankof )
+                                 blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd,
+                                 blkrankof_fct_t get_rankof, void* get_rankof_arg )
 {
     /*
      * The first layer must be allocated, otherwise we will give unitialized
@@ -109,5 +112,5 @@ CHAMELEON_Recursive_Desc_Create( CHAM_desc_t **descptr, void *mat, cham_flttype_
 
     return chameleon_recdesc_create( "A", descptr, mat, dtyp,
                                      mb, nb, lm, ln, m, n, p, q,
-                                     get_blkaddr, get_blkldd, get_rankof );
+                                     get_blkaddr, get_blkldd, get_rankof, get_rankof_arg );
 }
diff --git a/example/lapack_to_chameleon/step3.c b/example/lapack_to_chameleon/step3.c
index ac32b0d3f..aae96bab7 100644
--- a/example/lapack_to_chameleon/step3.c
+++ b/example/lapack_to_chameleon/step3.c
@@ -11,11 +11,12 @@
  *
  * @brief Chameleon step3 example
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Florent Pruvost
  * @author Mathieu Faverge
  * @author Philippe Virouleau
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  */
 #include "step3.h"
@@ -101,11 +102,11 @@ int main(int argc, char *argv[]) {
      *     returns the MPI rank of the tile m, n (0 here because we do not
      *     intend to use this program with MPI)
      */
-    CHAMELEON_Desc_Create_User(&descA, matA, ChamRealDouble,
-                           NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1,
-                           user_getaddr_arrayofpointers,
-                           user_getblkldd_arrayofpointers,
-                           user_getrankof_zero);
+    CHAMELEON_Desc_Create_User( &descA, matA, ChamRealDouble,
+                                NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1,
+                                user_getaddr_arrayofpointers,
+                                user_getblkldd_arrayofpointers,
+                                user_getrankof_zero, NULL );
 
     /*
      * We use the classical CHAMELEON way for accessing tiles for descripotrs
diff --git a/include/chameleon.h b/include/chameleon.h
index e8246474d..cce6539fc 100644
--- a/include/chameleon.h
+++ b/include/chameleon.h
@@ -17,6 +17,7 @@
  * @author Cedric Castagnede
  * @author Florent Pruvost
  * @author Philippe Virouleau
+ * @author Lionel Eyraud-Dubois
  * @date 2023-07-05
  *
  */
@@ -124,7 +125,8 @@ int CHAMELEON_Element_Size( cham_flttype_t type );
 
 int CHAMELEON_Desc_Create_User( CHAM_desc_t **desc, void *mat, cham_flttype_t dtyp, int mb, int nb, int bsiz,
                                 int lm, int ln, int i, int j, int m, int n, int p, int q,
-                                blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd, blkrankof_fct_t get_rankof );
+                                blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd,
+                                blkrankof_fct_t get_rankof, void* get_rankof_arg );
 
 int CHAMELEON_Desc_Create( CHAM_desc_t **desc, void *mat, cham_flttype_t dtyp,
                            int mb, int nb, int bsiz, int lm, int ln,
@@ -133,7 +135,7 @@ int CHAMELEON_Desc_Create( CHAM_desc_t **desc, void *mat, cham_flttype_t dtyp,
 int CHAMELEON_Desc_Create_OOC_User( CHAM_desc_t **desc, cham_flttype_t dtyp,
                                     int mb, int nb, int bsiz, int lm, int ln,
                                     int i, int j, int m, int n, int p, int q,
-                                    blkrankof_fct_t get_rankof );
+                                    blkrankof_fct_t get_rankof, void* get_rankof_arg );
 int CHAMELEON_Desc_Create_OOC( CHAM_desc_t **desc, cham_flttype_t dtyp,
                                int mb, int nb, int bsiz, int lm, int ln,
                                int i, int j, int m, int n, int p, int q );
@@ -150,10 +152,12 @@ int CHAMELEON_Desc_Flush  ( const CHAM_desc_t        *desc,
 
 int CHAMELEON_Desc_Change_Distribution( cham_uplo_t      uplo,
                                         CHAM_desc_t     *desc,
-                                        blkrankof_fct_t  new_get_rankof );
+                                        blkrankof_fct_t  new_get_rankof,
+                                        void*            new_get_rankof_arg );
 int CHAMELEON_Desc_Change_Distribution_Async( cham_uplo_t         uplo,
                                               CHAM_desc_t        *desc,
                                               blkrankof_fct_t     new_get_rankof,
+                                              void*               new_get_rankof_arg,
                                               RUNTIME_sequence_t *sequence );
 
 void CHAMELEON_Desc_Print( const CHAM_desc_t *desc );
@@ -188,7 +192,8 @@ int CHAMELEON_Request_Set     (RUNTIME_request_t *request, int param, int value)
 
 int  CHAMELEON_Recursive_Desc_Create( CHAM_desc_t **descptr, void *mat, cham_flttype_t dtyp,
                                       int *mb, int *nb, int lm, int ln, int m, int n, int p, int q,
-                                      blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd, blkrankof_fct_t get_rankof );
+                                      blkaddr_fct_t get_blkaddr, blkldd_fct_t get_blkldd,
+                                      blkrankof_fct_t get_rankof, void* get_rankof_arg );
 
 /**
  *
diff --git a/include/chameleon/struct.h b/include/chameleon/struct.h
index 2b324ef54..efa64a1c5 100644
--- a/include/chameleon/struct.h
+++ b/include/chameleon/struct.h
@@ -11,14 +11,15 @@
  *
  * @brief Chameleon structures
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Cedric Augonnet
  * @author Mathieu Faverge
  * @author Cedric Castagnede
  * @author Florent Pruvost
  * @author Samuel Thibault
  * @author Matthieu Kuhn
- * @date 2022-12-13
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  *
  */
 #ifndef _chameleon_struct_h_
@@ -93,6 +94,7 @@ struct chameleon_desc_s {
     blkrankof_fct_t get_rankof;
     // function to get chameleon tiles MPI rank
     blkrankof_fct_t get_rankof_init;
+    void* get_rankof_init_arg;
     CHAM_tile_t *tiles; // pointer to the array of tiles descriptors
     void *mat;        // pointer to the beginning of the matrix
     size_t A21;       // pointer to the beginning of the matrix A21
diff --git a/testing/testing_zgetrf.c b/testing/testing_zgetrf.c
index 92a82eb6b..4fb585532 100644
--- a/testing/testing_zgetrf.c
+++ b/testing/testing_zgetrf.c
@@ -9,12 +9,13 @@
  *
  * @brief Chameleon zgetrf testing
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Lucas Barros de Assis
  * @author Mathieu Faverge
  * @author Alycia Lisito
  * @author Matthieu Kuhn
- * @date 2023-02-21
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> c d s
  *
  */
@@ -93,11 +94,11 @@ testing_zgetrf_desc( run_arg_list_t *args, int check )
         CHAMELEON_Desc_Create_User(
             &descA0c, (void*)CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble,
             nb, nb, nb*nb, M, N, 0, 0, M, N, 1, 1,
-            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
         CHAMELEON_Desc_Create_User(
             &descIPIVc, (void*)CHAMELEON_MAT_ALLOC_GLOBAL, ChamInteger,
             nb, 1, nb, M, 1, 0, 0, M, 1, 1, 1,
-            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
 
         if ( diag == ChamUnit ) {
             CHAMELEON_zplgtr_Tile( 0,     ChamUpper, descA0c, seedA   );
diff --git a/testing/testing_zprint.c b/testing/testing_zprint.c
index 3aab544aa..bff288a02 100644
--- a/testing/testing_zprint.c
+++ b/testing/testing_zprint.c
@@ -9,11 +9,12 @@
  *
  * @brief Chameleon zprint testing
  *
- * @version 1.2.0
+ * @version 1.3.0
  * @author Lucas Barros de Assis
  * @author Mathieu Faverge
  * @author Alycia Lisito
- * @date 2022-02-22
+ * @author Lionel Eyraud-Dubois
+ * @date 2023-07-05
  * @precisions normal z -> c d s
  *
  */
@@ -62,7 +63,7 @@ testing_zprint_desc( run_arg_list_t *args, int check )
     fprintf( stdout, "--- Lapack layout ---\n" );
     rc = CHAMELEON_Desc_Create_User(
         &descA, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDA, N, 0, 0, M, N, P, Q,
-        chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+        chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
 
     if ( rc == CHAMELEON_SUCCESS ) {
         CHAMELEON_Desc_Print( descA );
@@ -79,7 +80,7 @@ testing_zprint_desc( run_arg_list_t *args, int check )
         rc = CHAMELEON_Recursive_Desc_Create(
             &descA, CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble,
             list_nb, list_nb, LDA, N, M, N, P, Q,
-            NULL, NULL, NULL );
+            NULL, NULL, NULL, NULL );
 
         if ( rc == CHAMELEON_SUCCESS ) {
             CHAMELEON_Desc_Print( descA );
@@ -90,7 +91,7 @@ testing_zprint_desc( run_arg_list_t *args, int check )
         rc = CHAMELEON_Recursive_Desc_Create(
             &descA, CHAMELEON_MAT_ALLOC_GLOBAL, ChamComplexDouble,
             list_nb, list_nb, LDA, N, M, N, P, Q,
-            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL );
+            chameleon_getaddr_cm, chameleon_getblkldd_cm, NULL, NULL );
 
         if ( rc == CHAMELEON_SUCCESS ) {
             CHAMELEON_Desc_Print( descA );
-- 
GitLab