diff --git a/compute/pzgelqf.c b/compute/pzgelqf.c
index 9a4d905b71ea21ff655acfd96f9bd50aa5081f71..4609398fb0e3b265a72b013aa9a0fdf734d0add0 100644
--- a/compute/pzgelqf.c
+++ b/compute/pzgelqf.c
@@ -104,7 +104,7 @@ void morse_pzgelqf(MORSE_desc_t *A, MORSE_desc_t *T,
 
     /* necessary to avoid dependencies between tslqt and unmlq tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, (minMT-1)*A->mb, A->nb, 0, 0, (minMT-1)*A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, (minMT-1)*A->mb, A->nb, 0, 0, (minMT-1)*A->mb, A->nb, A->p, A->q);
 
     for (k = 0; k < min(A->mt, A->nt); k++) {
         tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzgelqfrh.c b/compute/pzgelqfrh.c
index ed558d94029d23f404652d65ed2d5184576b136d..08e1cc9fcddf5471e2a8157cd5e435e6ffb405cb 100644
--- a/compute/pzgelqfrh.c
+++ b/compute/pzgelqfrh.c
@@ -107,7 +107,7 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->nt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     for (k = 0; k < min(A->mt, A->nt); k++) {
         tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzgeqrf.c b/compute/pzgeqrf.c
index 269496f8abbe4d1fd3971e9b7d2e09e23047e0b3..98e5d3679144ae925637118a902b31716e927949 100644
--- a/compute/pzgeqrf.c
+++ b/compute/pzgeqrf.c
@@ -99,7 +99,7 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
 
     /* necessary to avoid dependencies between tsqrt and unmqr tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
 
     for (k = 0; k < minMNT; k++) {
         tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzgeqrfrh.c b/compute/pzgeqrfrh.c
index cfae9fc10b63f08b760688cb9394f953fcc953f6..35f433b65420afcf6a2d36b3d01cd4d8c96503c0 100644
--- a/compute/pzgeqrfrh.c
+++ b/compute/pzgeqrfrh.c
@@ -105,7 +105,7 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->mt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     K = min(A->mt, A->nt);
     for (k = 0; k < K; k++) {
diff --git a/compute/pzgetrf_incpiv.c b/compute/pzgetrf_incpiv.c
index f65813ed1b1f92b2c0da044394aac2286bace697..323338a425be2eb4af37845af7753cd6986aaaff 100644
--- a/compute/pzgetrf_incpiv.c
+++ b/compute/pzgetrf_incpiv.c
@@ -75,7 +75,7 @@ void morse_pzgetrf_incpiv(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
 
     for (k = 0; k < minMNT; k++) {
         tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzunglq.c b/compute/pzunglq.c
index fe487e52023eb821a6fbcd4f384f3623e8292475..d59c3ff8bf659b5d997cdbf58ae8abb6110846e0 100644
--- a/compute/pzunglq.c
+++ b/compute/pzunglq.c
@@ -93,7 +93,7 @@ void morse_pzunglq(MORSE_desc_t *A, MORSE_desc_t *Q, MORSE_desc_t *T,
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, minMT*A->mb, A->nb, 0, 0, minMT*A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, minMT*A->mb, A->nb, 0, 0, minMT*A->mb, A->nb, A->p, A->q);
 
     for (k = min(A->mt, A->nt)-1; k >= 0; k--) {
         tempAkm  = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzunglqrh.c b/compute/pzunglqrh.c
index 7f84b436de6f657e6c6432b582870441c70a5c9d..b175fbf32b0c4ce8667da7267fbb3ac9151fdcaa 100644
--- a/compute/pzunglqrh.c
+++ b/compute/pzunglqrh.c
@@ -92,7 +92,7 @@ void morse_pzunglqrh(MORSE_desc_t *A, MORSE_desc_t *Q,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->nt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     K = min(A->mt, A->nt);
     for (k = K-1; k >= 0; k--) {
diff --git a/compute/pzungqr.c b/compute/pzungqr.c
index 1c38b88bdc20d613eaccc64a85f97604d5b1df23..34155b7e97479e6a8264c8c0cdb6e756599d37cb 100644
--- a/compute/pzungqr.c
+++ b/compute/pzungqr.c
@@ -87,7 +87,7 @@ void morse_pzungqr(MORSE_desc_t *A, MORSE_desc_t *Q, MORSE_desc_t *T,
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
 
     for (k = min(A->mt, A->nt)-1; k >= 0; k--) {
         tempAkm  = k == A->mt-1 ? A->m-k*A->mb : A->mb;
diff --git a/compute/pzungqrrh.c b/compute/pzungqrrh.c
index 375ca04008e538820cc5108cd880ec77ed0b17b6..0869550c0f826da206f6faacbb0bdff4f12e4ef2 100644
--- a/compute/pzungqrrh.c
+++ b/compute/pzungqrrh.c
@@ -94,7 +94,7 @@ void morse_pzungqrrh(MORSE_desc_t *A, MORSE_desc_t *Q,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->mt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     K = min(A->mt, A->nt);
     for (k = K-1; k >= 0; k--) {
diff --git a/compute/pzunmlq.c b/compute/pzunmlq.c
index f81e3792396c7661042396c91445bef8a0cfeb60..ff2d32ac626e182d58f2b9dc076f43a46e468410 100644
--- a/compute/pzunmlq.c
+++ b/compute/pzunmlq.c
@@ -95,7 +95,7 @@ void morse_pzunmlq(MORSE_enum side, MORSE_enum trans,
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, minMT*A->mb, A->nb, 0, 0, minMT*A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, minMT*A->mb, A->nb, 0, 0, minMT*A->mb, A->nb, A->p, A->q);
 
     if (side == MorseLeft ) {
         if (trans == MorseNoTrans) {
diff --git a/compute/pzunmlqrh.c b/compute/pzunmlqrh.c
index dc5281acaa0535d41e58fca98231c4031564d320..bdab950a4560ecf4201ddeba13da30863e5cd0de 100644
--- a/compute/pzunmlqrh.c
+++ b/compute/pzunmlqrh.c
@@ -94,7 +94,7 @@ void morse_pzunmlqrh(MORSE_enum side, MORSE_enum trans,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->nt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     K = min(A->mt, A->nt);
     if (side == MorseLeft ) {
diff --git a/compute/pzunmqr.c b/compute/pzunmqr.c
index 7ce1a8227b39b800f05afbd48ae4dce20c0f1640..2c1631875d336d541e5efe217aea67903ffa2b51 100644
--- a/compute/pzunmqr.c
+++ b/compute/pzunmqr.c
@@ -87,7 +87,7 @@ void morse_pzunmqr(MORSE_enum side, MORSE_enum trans,
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
 
     if (A->m > A->n) {
         minM  = A->n;
diff --git a/compute/pzunmqrrh.c b/compute/pzunmqrrh.c
index 2240ca6eae6864c4bb955c958ed876f9bee18f1d..7f3d33d36b2822afc70140eb6a42b5f8aeaf5082 100644
--- a/compute/pzunmqrrh.c
+++ b/compute/pzunmqrrh.c
@@ -94,7 +94,7 @@ void morse_pzunmqrrh(MORSE_enum side, MORSE_enum trans,
     /* necessary to avoid dependencies between tasks regarding the diag tile */
     nblk = ( A->mt + BS -1 ) / BS;
     DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
-    morse_zdesc_alloc2(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb);
+    morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, nblk * A->mb, A->nb, 0, 0, nblk * A->mb, A->nb, A->p, A->q);
 
     K = min(A->mt, A->nt);
     if (side == MorseLeft ) {
diff --git a/compute/zgeqrf.c b/compute/zgeqrf.c
index 0311403e7b2f4493d4cfdc19886428322f6eade9..6ead321dd3dbc59037ae7b7bb517e9300e7cc38f 100644
--- a/compute/zgeqrf.c
+++ b/compute/zgeqrf.c
@@ -199,7 +199,7 @@ int MORSE_zgeqrf_Tile(MORSE_desc_t *A, MORSE_desc_t *T)
     MORSE_zgeqrf_Tile_Async(A, T, sequence, &request);
     RUNTIME_barrier(morse);
     RUNTIME_desc_getoncpu(A);
-    
+
     status = sequence->status;
     morse_sequence_destroy(morse, sequence);
     return status;
diff --git a/compute/zgeqrs.c b/compute/zgeqrs.c
index d424faf19df34b723058123d5d1e46b1a2736285..172177b9f5fefde03cee237cb04a7c857414f997 100644
--- a/compute/zgeqrs.c
+++ b/compute/zgeqrs.c
@@ -220,8 +220,9 @@ int MORSE_zgeqrs_Tile(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *B)
     MORSE_zgeqrs_Tile_Async(A, T, B, sequence, &request);
     RUNTIME_barrier(morse);
     RUNTIME_desc_getoncpu(A);
-        RUNTIME_desc_getoncpu(B);
-    
+    RUNTIME_desc_getoncpu(T);
+    RUNTIME_desc_getoncpu(B);
+
     status = sequence->status;
     morse_sequence_destroy(morse, sequence);
     return status;
diff --git a/control/compute_z.h b/control/compute_z.h
index d4bd691d5c72795b7e9c0d658725341acc7fdb65..959264ebb52b350b48a8059c20c101600f3f3225 100644
--- a/control/compute_z.h
+++ b/control/compute_z.h
@@ -31,10 +31,10 @@
 /***************************************************************************//**
  *  Macro for matrix conversion / Lapack interface
  **/
-#define morse_zdesc_alloc2(descA, mb, nb, lm, ln, i, j, m, n)         \
-    descA = morse_desc_init(                                          \
-        MorseComplexDouble, (mb), (nb), ((mb)*(nb)),                  \
-        (m), (n), (i), (j), (m), (n), 1, 1);                          \
+#define morse_zdesc_alloc_diag(descA, mb, nb, lm, ln, i, j, m, n, p, q) \
+    descA = morse_desc_init_diag(                                       \
+        MorseComplexDouble, (mb), (nb), ((mb)*(nb)),                    \
+        (m), (n), (i), (j), (m), (n), p, q);                            \
     morse_desc_mat_alloc( &(descA) );
 
 #define morse_zdesc_alloc( descA, mb, nb, lm, ln, i, j, m, n, free)   \
diff --git a/control/descriptor.c b/control/descriptor.c
index 8ceed3733f97cef1f2e9c17152f04326f3cd07a7..7c3bbc9a95c5d762864eadbdd3ceb344ba3b57fa 100644
--- a/control/descriptor.c
+++ b/control/descriptor.c
@@ -127,6 +127,95 @@ MORSE_desc_t morse_desc_init(MORSE_enum dtyp, int mb, int nb, int bsiz,
     return desc;
 }
 
+/*******************************************************************************
+ *  Internal static descriptor initializer for a block diagonal matrix
+ **/
+MORSE_desc_t morse_desc_init_diag(MORSE_enum dtyp, int mb, int nb, int bsiz,
+                                  int lm, int ln, int i, int j,
+                                  int m,  int n,  int p, int q)
+{
+    MORSE_desc_t desc;
+    desc.get_blkaddr = morse_getaddr_ccrb;
+    desc.get_blkldd  = morse_getblkldd_ccrb;
+    desc.get_rankof  = morse_getrankof_2d_diag;
+    // Matrix properties
+    desc.dtyp = dtyp;
+    // seems useless
+    //desc.styp = MorseCCRB;
+    desc.mb = mb;
+    desc.nb = nb;
+    desc.bsiz = bsiz;
+    // Large matrix parameters
+    desc.lm = lm;
+    desc.ln = ln;
+    // Large matrix derived parameters
+    desc.lmt = (lm%mb==0) ? (lm/mb) : (lm/mb+1);
+    desc.lnt = (ln%nb==0) ? (ln/nb) : (ln/nb+1);
+    // Submatrix parameters
+    desc.i = i;
+    desc.j = j;
+    desc.m = m;
+    desc.n = n;
+    // Submatrix derived parameters
+    desc.mt = (m == 0) ? 0 : (i+m-1)/mb - i/mb + 1;
+    desc.nt = (n == 0) ? 0 : (j+n-1)/nb - j/nb + 1;
+
+    desc.id = nbdesc; nbdesc++;
+    desc.occurences = 0;
+    desc.use_mat = 1;
+    desc.alloc_mat = 1;
+    desc.register_mat = 1;
+
+#if defined(CHAMELEON_USE_MPI)
+    MPI_Comm_rank( MPI_COMM_WORLD, &(desc.myrank) );
+#else
+    desc.myrank = 0;
+#endif
+
+    // Grid size
+    desc.p = p;
+    desc.q = q;
+
+    // Local dimensions in tiles
+    if ( desc.myrank < (p*q) ) {
+        desc.llmt = (desc.lmt + p - 1) / p;
+        desc.llnt = (desc.lnt + q - 1) / q;
+
+        // Local dimensions
+        if ( ((desc.lmt-1) % p) == (desc.myrank / q) ) {
+            desc.llm  = ( desc.llmt - 1 ) * mb + ((lm%mb==0) ? mb : (lm%mb));
+        } else {
+            desc.llm  =  desc.llmt * mb;
+        }
+
+        if ( ((desc.lnt-1) % q) == (desc.myrank % q) ) {
+            desc.lln  = ( desc.llnt - 1 ) * nb + ((ln%nb==0) ? nb : (ln%nb));
+        } else {
+            desc.lln  =  desc.llnt * nb;
+        }
+
+        desc.llm1 = (desc.llm/mb);
+        desc.lln1 = (desc.lln/nb);
+    } else {
+      desc.llmt = 0;
+      desc.llnt = 0;
+      desc.llm  = 0;
+      desc.lln  = 0;
+      desc.llm1 = 0;
+      desc.lln1 = 0;
+    }
+
+    // Matrix address
+    desc.mat = NULL;
+    desc.A21 = (size_t)(desc.llm - desc.llm%mb)*(size_t)(desc.lln - desc.lln%nb);
+    desc.A12 = (size_t)(           desc.llm%mb)*(size_t)(desc.lln - desc.lln%nb) + desc.A21;
+    desc.A22 = (size_t)(desc.llm - desc.llm%mb)*(size_t)(           desc.lln%nb) + desc.A12;
+
+    RUNTIME_desc_init( &desc );
+
+    return desc;
+}
+
 /*******************************************************************************
  *  Static descriptor initializer for users
  **/
@@ -386,6 +475,12 @@ int morse_desc_mat_free( MORSE_desc_t *desc )
  * @param[in] n
  *          Number of columns of the submatrix.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
diff --git a/control/descriptor.h b/control/descriptor.h
index 3f2f49cf8d45b10a2d08863342381dcc95101e67..cea0487762929573b4ffc44f9e3aaa37056a2586 100644
--- a/control/descriptor.h
+++ b/control/descriptor.h
@@ -47,9 +47,12 @@ inline static int   morse_getblkldd_ccrb(const MORSE_desc_t *A, int m);
  *  Data distributions
  */
 inline static int   morse_getrankof_2d(const MORSE_desc_t *desc, int m, int n);
+inline static int   morse_getrankof_2d_diag(const MORSE_desc_t *desc, int m, int n);
 
 MORSE_desc_t morse_desc_init(MORSE_enum dtyp, int mb, int nb, int bsiz,
                              int lm, int ln, int i, int j, int m, int n, int p, int q);
+MORSE_desc_t morse_desc_init_diag(MORSE_enum dtyp, int mb, int nb, int bsiz,
+                                  int lm, int ln, int i, int j, int m, int n, int p, int q);
 MORSE_desc_t morse_desc_init_user(MORSE_enum dtyp, int mb, int nb, int bsiz,
                                   int lm, int ln, int i, int j,
                                   int m,  int n,  int p, int q,
@@ -169,6 +172,15 @@ inline static int morse_getrankof_2d(const MORSE_desc_t *desc, int m, int n)
     return (m % desc->p) * desc->q + (n % desc->q);
 }
 
+/*******************************************************************************
+ *  Internal function to return MPI rank of element DIAG(m,0)
+ **/
+inline static int morse_getrankof_2d_diag(const MORSE_desc_t *desc, int m, int n)
+{
+    return (m % desc->p) * desc->q + (m % desc->q);
+}
+
+
 /*******************************************************************************
  * Detect if the tile is local or not
  **/
diff --git a/control/morse_zf77.c b/control/morse_zf77.c
index 447eecd6f44dc2159e599a88c07f56a99db604c5..25308e68bc7137650eb2093dc55872fcc2bac7b4 100644
--- a/control/morse_zf77.c
+++ b/control/morse_zf77.c
@@ -891,23 +891,23 @@ void MORSE_ZUNMQR_TILE_ASYNC(MORSE_enum *side, MORSE_enum *trans, MORSE_desc_t *
 //void MORSE_ALLOC_WORKSPACE_ZGEHRD(int *N, MORSE_desc_t **descT, int *info)
 //{ *info = MORSE_Alloc_Workspace_zgehrd(*N, descT); }
 
-void MORSE_ALLOC_WORKSPACE_ZGELQF(int *M, int *N, MORSE_desc_t **T, int *info)
-{ *info = MORSE_Alloc_Workspace_zgelqf(*M, *N, T); }
+void MORSE_ALLOC_WORKSPACE_ZGELQF(int *M, int *N, MORSE_desc_t **T, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgelqf(*M, *N, T, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGELQF_TILE(int *M, int *N, MORSE_desc_t **descT, int *info)
-{ *info = MORSE_Alloc_Workspace_zgelqf_Tile(*M, *N, descT); }
+void MORSE_ALLOC_WORKSPACE_ZGELQF_TILE(int *M, int *N, MORSE_desc_t **descT, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgelqf_Tile(*M, *N, descT, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGELS(int *M, int *N, MORSE_desc_t **T, int *info)
-{ *info = MORSE_Alloc_Workspace_zgels(*M, *N, T); }
+void MORSE_ALLOC_WORKSPACE_ZGELS(int *M, int *N, MORSE_desc_t **T, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgels(*M, *N, T, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGELS_TILE(int *M, int *N, MORSE_desc_t **descT, int *info)
-{ *info = MORSE_Alloc_Workspace_zgels_Tile(*M, *N, descT); }
+void MORSE_ALLOC_WORKSPACE_ZGELS_TILE(int *M, int *N, MORSE_desc_t **descT, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgels_Tile(*M, *N, descT, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGEQRF(int *M, int *N, MORSE_desc_t **T, int *info)
-{ *info = MORSE_Alloc_Workspace_zgeqrf(*M, *N, T); }
+void MORSE_ALLOC_WORKSPACE_ZGEQRF(int *M, int *N, MORSE_desc_t **T, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgeqrf(*M, *N, T, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGEQRF_TILE(int *M, int *N, MORSE_desc_t **descT, int *info)
-{ *info = MORSE_Alloc_Workspace_zgeqrf_Tile(*M, *N, descT); }
+void MORSE_ALLOC_WORKSPACE_ZGEQRF_TILE(int *M, int *N, MORSE_desc_t **descT, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgeqrf_Tile(*M, *N, descT, *p, *q); }
 
 void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV(int *N, MORSE_desc_t **descL, int **IPIV, int *info)
 { *info = MORSE_Alloc_Workspace_zgesv_incpiv(*N, descL, IPIV); }
diff --git a/control/morse_zf90.F90 b/control/morse_zf90.F90
index 827c91e74653ca215f874e6f369dc4b8ebc4b059..c974c22d1a26eb3a740b857593ce5e50f5864c71 100644
--- a/control/morse_zf90.F90
+++ b/control/morse_zf90.F90
@@ -2751,7 +2751,7 @@ module morse_z
     !  FORTRAN API - workspace allocation
     !
       interface
-         function MORSE_Alloc_Workspace_zgebrd_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zgebrd_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgebrd')
             use iso_c_binding
             implicit none
@@ -2759,33 +2759,39 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgebrd_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgeev_c(N,descT) &
+         function MORSE_Alloc_Workspace_zgeev_c(N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgeev')
             use iso_c_binding
             implicit none
             integer(kind=c_int) :: MORSE_Alloc_Workspace_zgeev_c
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgeev_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgehrd_c(N,descT) &
+         function MORSE_Alloc_Workspace_zgehrd_c(N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgehrd')
             use iso_c_binding
             implicit none
             integer(kind=c_int) :: MORSE_Alloc_Workspace_zgehrd_c
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgehrd_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgelqf_c(M,N,T) &
+         function MORSE_Alloc_Workspace_zgelqf_c(M,N,T,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgelqf')
             use iso_c_binding
             implicit none
@@ -2793,11 +2799,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: T ! T is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgelqf_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgelqf_Tile_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zgelqf_Tile_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgelqf_Tile')
             use iso_c_binding
             implicit none
@@ -2805,11 +2813,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgelqf_Tile_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgels_c(M,N,T) &
+         function MORSE_Alloc_Workspace_zgels_c(M,N,T,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgels')
             use iso_c_binding
             implicit none
@@ -2817,11 +2827,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: T ! T is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgels_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgels_Tile_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zgels_Tile_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgels_Tile')
             use iso_c_binding
             implicit none
@@ -2829,11 +2841,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgels_Tile_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgeqrf_c(M,N,T) &
+         function MORSE_Alloc_Workspace_zgeqrf_c(M,N,T,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgeqrf')
             use iso_c_binding
             implicit none
@@ -2841,11 +2855,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: T ! T is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgeqrf_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgeqrf_Tile_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zgeqrf_Tile_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgeqrf_Tile')
             use iso_c_binding
             implicit none
@@ -2853,6 +2869,8 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgeqrf_Tile_c
       end interface
 
@@ -2881,7 +2899,7 @@ module morse_z
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgesvd_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zgesvd_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgesvd')
             use iso_c_binding
             implicit none
@@ -2889,6 +2907,8 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgesvd_c
       end interface
 
@@ -2929,7 +2949,7 @@ module morse_z
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zheev_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zheev_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zheev')
             use iso_c_binding
             implicit none
@@ -2937,11 +2957,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zheev_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zheevd_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zheevd_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zheevd')
             use iso_c_binding
             implicit none
@@ -2949,11 +2971,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zheevd_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zhegv_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zhegv_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zhegv')
             use iso_c_binding
             implicit none
@@ -2961,11 +2985,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zhegv_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zhegvd_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zhegvd_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zhegvd')
             use iso_c_binding
             implicit none
@@ -2973,11 +2999,13 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zhegvd_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zhetrd_c(M,N,descT) &
+         function MORSE_Alloc_Workspace_zhetrd_c(M,N,descT,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zhetrd')
             use iso_c_binding
             implicit none
@@ -2985,6 +3013,8 @@ module morse_z
             integer(kind=c_int), value :: M
             integer(kind=c_int), value :: N
             type(c_ptr) :: descT ! descT is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zhetrd_c
       end interface
 
@@ -5269,113 +5299,135 @@ module morse_z
          info = MORSE_Alloc_Workspace_zgeev_c(N,T)
       end subroutine MORSE_Alloc_Workspace_zgeev
 
-      subroutine MORSE_Alloc_Workspace_zgebrd(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zgebrd(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgebrd_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgebrd_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zgebrd
 
-      subroutine MORSE_Alloc_Workspace_zgehrd(N,T,info)
+      subroutine MORSE_Alloc_Workspace_zgehrd(N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgehrd_c(N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgehrd_c(N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zgehrd
 
-      subroutine MORSE_Alloc_Workspace_zgesvd(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zgesvd(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgesvd_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgesvd_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zgesvd
 
-      subroutine MORSE_Alloc_Workspace_zheev(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zheev(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zheev_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zheev_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zheev
 
-      subroutine MORSE_Alloc_Workspace_zheevd(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zheevd(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zheevd_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zheevd_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zheevd
 
-      subroutine MORSE_Alloc_Workspace_zhegv(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zhegv(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zhegv_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zhegv_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zhegv
 
-      subroutine MORSE_Alloc_Workspace_zhegvd(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zhegvd(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zhegvd_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zhegvd_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zhegvd
 
-      subroutine MORSE_Alloc_Workspace_zhetrd(M,N,T,info)
+      subroutine MORSE_Alloc_Workspace_zhetrd(M,N,T,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: T ! T is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zhetrd_c(M,N,T)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zhetrd_c(M,N,T,p,q)
       end subroutine MORSE_Alloc_Workspace_zhetrd
 
-      subroutine MORSE_Alloc_Workspace_zgelqf_Tile(M,N,descT,info)
+      subroutine MORSE_Alloc_Workspace_zgelqf_Tile(M,N,descT,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: descT ! descT is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgelqf_Tile_c(M,N,descT)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgelqf_Tile_c(M,N,descT,p,q)
       end subroutine MORSE_Alloc_Workspace_zgelqf_Tile
 
-      subroutine MORSE_Alloc_Workspace_zgels_Tile(M,N,descT,info)
+      subroutine MORSE_Alloc_Workspace_zgels_Tile(M,N,descT,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: descT ! descT is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgels_Tile_c(M,N,descT)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgels_Tile_c(M,N,descT,p,q)
       end subroutine MORSE_Alloc_Workspace_zgels_Tile
 
-      subroutine MORSE_Alloc_Workspace_zgeqrf_Tile(M,N,descT,info)
+      subroutine MORSE_Alloc_Workspace_zgeqrf_Tile(M,N,descT,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
          integer(kind=c_int), intent(in) :: M
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: descT ! descT is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgeqrf_Tile_c(M,N,descT)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgeqrf_Tile_c(M,N,descT,p,q)
       end subroutine MORSE_Alloc_Workspace_zgeqrf_Tile
 
       subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N,descL,IPIV,info)
diff --git a/control/workspace.c b/control/workspace.c
index 192b1a0058b0870c29222f92ee7a3dd38a0e848f..ef41f2e02a4a706be8b63a56b34f97e3e169b964 100644
--- a/control/workspace.c
+++ b/control/workspace.c
@@ -38,7 +38,7 @@
 /*******************************************************************************
  *
  **/
-int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc)
+int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, int p, int q)
 {
     int status;
     int IB, NB, MT, NT;
@@ -85,8 +85,7 @@ int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t
         morse_error("morse_alloc_ibnb_tile", "malloc() failed");
         return MORSE_ERR_OUT_OF_RESOURCES;
     }
-    /* TODO: Fix the distribution of the workspace */
-    **desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, 1, 1);
+    **desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, p, q);
 
     /* Allocate matrix */
     if (morse_desc_mat_alloc(*desc)) {
diff --git a/control/workspace.h b/control/workspace.h
index 668f0452df51fd5b18fa315e458f2a5cc3404a50..46be2c86d03a92845dd316f05e0d6dcf7abb0063 100644
--- a/control/workspace.h
+++ b/control/workspace.h
@@ -32,7 +32,7 @@ extern "C" {
 /*******************************************************************************
  *  Internal routines
  **/
-int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc);
+int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, int p, int q);
 int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV);
 
 #ifdef __cplusplus
diff --git a/control/workspace_z.c b/control/workspace_z.c
index 3e784b04ea1aa9c208e9d57bec927d38f3f8d3c8..0e72e7e31151d3085ce3d211c948fb4a2a83cab6 100644
--- a/control/workspace_z.c
+++ b/control/workspace_z.c
@@ -54,8 +54,8 @@
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgeev(int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(N, N, MORSE_FUNC_ZGEEV, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgeev(int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(N, N, MORSE_FUNC_ZGEEV, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -79,8 +79,8 @@ int MORSE_Alloc_Workspace_zgeev(int N, MORSE_desc_t **descT) {
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgehrd(int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(N, N, MORSE_FUNC_ZGEHRD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgehrd(int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(N, N, MORSE_FUNC_ZGEHRD, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -106,8 +106,8 @@ int MORSE_Alloc_Workspace_zgehrd(int N, MORSE_desc_t **descT) {
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGEBRD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGEBRD, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -134,8 +134,8 @@ int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT) {
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgels(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgels(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -156,14 +156,20 @@ int MORSE_Alloc_Workspace_zgels(int M, int N, MORSE_desc_t **descT) {
  *          On exit, MORSE_desc_t *on workspace handle for storage of the extra
  *          T factors required by the tile QR or the tile LQ factorization.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgels_Tile(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgels_Tile(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -184,14 +190,20 @@ int MORSE_Alloc_Workspace_zgels_Tile(int M, int N, MORSE_desc_t **descT) {
  *          On exit, workspace handle for storage of the extra T factors
  *          required by the tile QR factorization.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgeqrf(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgeqrf(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -212,14 +224,20 @@ int MORSE_Alloc_Workspace_zgeqrf(int M, int N, MORSE_desc_t **descT) {
  *          On exit, MORSE_desc_t *on workspace handle for storage of the extra
  *          T factors required by the tile QR or the tile LQ factorization.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -240,14 +258,20 @@ int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT) {
  *          On exit, workspace handle for storage of the extra T factors required by the tile LQ
  *          factorization.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgelqf(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgelqf(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -267,14 +291,20 @@ int MORSE_Alloc_Workspace_zgelqf(int M, int N, MORSE_desc_t **descT) {
  *          On exit, MORSE_desc_t *on workspace handle for storage of the extra
  *          T factors required by the tile QR or the tile LQ factorization.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  ******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGELS, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -355,14 +385,20 @@ int MORSE_Alloc_Workspace_zgesv_incpiv_Tile(int N, MORSE_desc_t **descL, int **I
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile BRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGESVD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZGESVD, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -429,10 +465,9 @@ int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV)
-{
-    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV);
-}
+int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV) {
+    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV); }
+
 /** ***************************************************************************
  *
  * @ingroup Workspace
@@ -450,14 +485,20 @@ int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile TRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zheev(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEEV, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zheev(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEEV, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -476,14 +517,20 @@ int MORSE_Alloc_Workspace_zheev(int M, int N, MORSE_desc_t **descT) {
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile TRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zheevd(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEEVD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zheevd(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEEVD, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -502,14 +549,20 @@ int MORSE_Alloc_Workspace_zheevd(int M, int N, MORSE_desc_t **descT) {
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile TRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zhegv(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEGV, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zhegv(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEGV, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -528,14 +581,20 @@ int MORSE_Alloc_Workspace_zhegv(int M, int N, MORSE_desc_t **descT) {
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile TRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zhegvd(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEGVD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zhegvd(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHEGVD, MorseComplexDouble, descT, p, q); }
 
 /** ***************************************************************************
  *
@@ -554,11 +613,17 @@ int MORSE_Alloc_Workspace_zhegvd(int M, int N, MORSE_desc_t **descT) {
  * @param[out] descT
  *          On exit, workspace handle for storage of the extra T factors required by the tile TRD.
  *
+ * @param[in] p
+ *          2D-block cyclic distribution in rows.
+ *
+ * @param[in] q
+ *          2D-block cyclic distribution in columns.
+ *
  *******************************************************************************
  *
  * @return
  *          \retval MORSE_SUCCESS successful exit
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zhetrd(int M, int N, MORSE_desc_t **descT) {
-    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHETRD, MorseComplexDouble, descT); }
+int MORSE_Alloc_Workspace_zhetrd(int M, int N, MORSE_desc_t **descT, int p, int q) {
+    return morse_alloc_ibnb_tile(M, N, MORSE_FUNC_ZHETRD, MorseComplexDouble, descT, p, q); }
diff --git a/include/morse_z.h b/include/morse_z.h
index 503305b5c7a339186aa5457560e2b37e54d43fcd..17867b8994b4b25a62f6d7623de71659ef3f90c7 100644
--- a/include/morse_z.h
+++ b/include/morse_z.h
@@ -264,29 +264,28 @@ int MORSE_zunmqr_Tile_Async(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A,
 int MORSE_Alloc_Workspace_zgesv_incpiv(        int N, MORSE_desc_t **descL, int **IPIV);
 int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV);
 
-int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zgeev( int N,        MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zgehrd(int N,        MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zgelqf(int M, int N, MORSE_desc_t **T);
-int MORSE_Alloc_Workspace_zgels( int M, int N, MORSE_desc_t **T);
-int MORSE_Alloc_Workspace_zgeqrf(int M, int N, MORSE_desc_t **T);
-int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zheev( int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zheevd( int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zhegv( int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zhegvd( int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zhetrd(int M, int N, MORSE_desc_t **descT);
+int MORSE_Alloc_Workspace_zgebrd(int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zgeev( int N,        MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zgehrd(int N,        MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zgelqf(int M, int N, MORSE_desc_t **T, int p, int q);
+int MORSE_Alloc_Workspace_zgels( int M, int N, MORSE_desc_t **T, int p, int q);
+int MORSE_Alloc_Workspace_zgeqrf(int M, int N, MORSE_desc_t **T, int p, int q);
+int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zheev( int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zheevd( int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zhegv( int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zhegvd( int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zhetrd(int M, int N, MORSE_desc_t **descT, int p, int q);
 
 /** ****************************************************************************
  *  Declarations of workspace allocation functions (tile layout, asynchronous execution) - alphabetical order
  **/
-
 int MORSE_Alloc_Workspace_zgetri_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *W);
 
 /* Warning: Those functions are deprecated */
-int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zgels_Tile( int M, int N, MORSE_desc_t **descT);
-int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT);
+int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zgels_Tile( int M, int N, MORSE_desc_t **descT, int p, int q);
+int MORSE_Alloc_Workspace_zgeqrf_Tile(int M, int N, MORSE_desc_t **descT, int p, int q);
 int MORSE_Alloc_Workspace_zgesv_incpiv_Tile (int N, MORSE_desc_t **descL, int **IPIV);
 int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV);
 
diff --git a/testing/testing_zgels.c b/testing/testing_zgels.c
index 5cd1d0c792469896509c03d027515a0ec82d66fc..b2af88730dead5b118b09d39b64179e63ab9416b 100644
--- a/testing/testing_zgels.c
+++ b/testing/testing_zgels.c
@@ -270,7 +270,7 @@ int testing_zgels(int argc, char **argv)
         MORSE_Set(MORSE_HOUSEHOLDER_SIZE, rh);
     }
 
-    MORSE_Alloc_Workspace_zgels(M, N, &T);
+    MORSE_Alloc_Workspace_zgels(M, N, &T, 1, 1);
     memset(T->mat, 0, (T->llm*T->lln)*sizeof(MORSE_Complex64_t));
     eps = BLAS_dfpinfo( blas_eps );
 
diff --git a/timing/time_zgels.c b/timing/time_zgels.c
index 7d21f9d60bb10db42fcbecc9c502e6ad399aa74f..cee21ade65239f95adc89679e15897989d48bfc7 100644
--- a/timing/time_zgels.c
+++ b/timing/time_zgels.c
@@ -46,7 +46,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_zplrnt( M, N,    A, LDA,  453 );
     MORSE_zplrnt( M, NRHS, x, LDB, 5673 );
 
-    MORSE_Alloc_Workspace_zgels(M, N, &T);
+    MORSE_Alloc_Workspace_zgels(M, N, &T, P, Q);
     memset(T->mat, 0, (T->llm*T->lln)*sizeof(MorseComplexDouble));
 
     /* Save A and b  */
diff --git a/timing/time_zgels_tile.c b/timing/time_zgels_tile.c
index db28d7be64a4dc7a095016ad25b8eacf5b06514b..2460ecea77b55fa81261e5b6b71da460fe6fb395 100644
--- a/timing/time_zgels_tile.c
+++ b/timing/time_zgels_tile.c
@@ -45,7 +45,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_zplrnt_Tile( descX,  673 );
 
     /* Allocate Workspace */
-    MORSE_Alloc_Workspace_zgels_Tile(M, N, &descT);
+    MORSE_Alloc_Workspace_zgels_Tile(M, N, &descT, P, Q);
     memset(descT->mat, 0, (descT->llm*descT->lln)*sizeof(MorseComplexDouble));
 
     /* Save A and B for check */
@@ -54,7 +54,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
         MORSE_zlacpy_Tile(MorseUpperLower, descX, descB);
     }
 
-    /* Do the computations */
+    /* MORSE ZGELS */
     START_TIMING();
     MORSE_zgels_Tile( MorseNoTrans, descA, descT, descX );
     STOP_TIMING();
diff --git a/timing/time_zgeqrf.c b/timing/time_zgeqrf.c
index edce8a1af4fbbb21b4c10dbad0fa67aa231e428d..6b6686acfa24a3f7e22ad92a39c8427e8400fc4b 100644
--- a/timing/time_zgeqrf.c
+++ b/timing/time_zgeqrf.c
@@ -43,7 +43,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_zplrnt(M, N, A, LDA, 3456);
 
     /* Allocate Workspace */
-    MORSE_Alloc_Workspace_zgels(M, N, &T);
+    MORSE_Alloc_Workspace_zgels(M, N, &T, P, Q);
     memset(T->mat, 0, (T->llm*T->lln)*sizeof(MorseComplexDouble));
 
     /* Save AT in lapack layout for check */
diff --git a/timing/time_zgeqrf_tile.c b/timing/time_zgeqrf_tile.c
index fe5b5c79d7d4fa0d8ac96475ac379273134674a9..9980e56afdf16ec6f3ba82c5b84c58d251390f2c 100644
--- a/timing/time_zgeqrf_tile.c
+++ b/timing/time_zgeqrf_tile.c
@@ -44,10 +44,10 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     }
 
     /* Allocate Workspace */
-    MORSE_Alloc_Workspace_zgels_Tile(M, N, &descT);
+    MORSE_Alloc_Workspace_zgels_Tile(M, N, &descT, P, Q);
     memset(descT->mat, 0, (descT->llm*descT->lln)*sizeof(MorseComplexDouble));
 
-    /* Do the computations */
+    /* MORSE ZGEQRF */
     START_TIMING();
     MORSE_zgeqrf_Tile( descA, descT );
     STOP_TIMING();
@@ -62,19 +62,20 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
         /* Compute the solution */
         MORSE_zgeqrs_Tile( descA, descT, descX );
 
+        /* Check solution */
         dparam[IPARAM_ANORM] = MORSE_zlange_Tile(MorseInfNorm, descAC);
         dparam[IPARAM_BNORM] = MORSE_zlange_Tile(MorseInfNorm, descB);
         dparam[IPARAM_XNORM] = MORSE_zlange_Tile(MorseInfNorm, descX);
         MORSE_zgemm_Tile( MorseNoTrans, MorseNoTrans, 1.0, descAC, descX, -1.0, descB );
         dparam[IPARAM_RES] = MORSE_zlange_Tile(MorseInfNorm, descB);
-        PASTE_CODE_FREE_MATRIX( descX  );
-        PASTE_CODE_FREE_MATRIX( descAC );
+        PASTE_CODE_FREE_MATRIX( descX  )
+        PASTE_CODE_FREE_MATRIX( descAC )
         PASTE_CODE_FREE_MATRIX( descB  )
     }
 
     /* Free data */
     MORSE_Dealloc_Workspace(&descT);
-    PASTE_CODE_FREE_MATRIX( descA );
+    PASTE_CODE_FREE_MATRIX( descA )
 
     return 0;
 }
diff --git a/timing/time_zgetrf_nopiv_tile.c b/timing/time_zgetrf_nopiv_tile.c
index 58740d5fbc8d4843f39772aca88486bc29a0c020..07d7d9238ef7c08b55f964d7f757d86e13d006b1 100644
--- a/timing/time_zgetrf_nopiv_tile.c
+++ b/timing/time_zgetrf_nopiv_tile.c
@@ -39,18 +39,18 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     PASTE_CODE_ALLOCATE_MATRIX_TILE( descX,  check, MORSE_Complex64_t, MorseComplexDouble, LDB, M, NRHS );
     PASTE_CODE_ALLOCATE_MATRIX_TILE( descAC, check, MORSE_Complex64_t, MorseComplexDouble, LDA, M, N    );
     PASTE_CODE_ALLOCATE_MATRIX_TILE( descB,  check, MORSE_Complex64_t, MorseComplexDouble, LDB, M, NRHS );
-    
+
     MORSE_zplrnt_Tile(descA, 3456);
 
     /* Save A for check */
     if (check == 1){
         MORSE_zlacpy_Tile(MorseUpperLower, descA, descAC);
     }
-    
+
     START_TIMING();
     MORSE_zgetrf_nopiv_Tile( descA );
     STOP_TIMING();
-    
+
     /* Check the solution */
     if ( check )
     {
diff --git a/timing/time_zpotrf_tile.c b/timing/time_zpotrf_tile.c
index 1811be472a0715276fc7c9e012a1aa8afe888b04..11dedafb34a35b8dc229bd3653eb11ea0874f7f8 100644
--- a/timing/time_zpotrf_tile.c
+++ b/timing/time_zpotrf_tile.c
@@ -23,7 +23,6 @@
 #define _FADDS FADDS_POTRF( N )
 
 #include "./timing.c"
-#include "timing_zauxiliary.h"
 
 static int
 RunTest(int *iparam, double *dparam, morse_time_t *t_)
@@ -41,14 +40,13 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_zplghe_Tile( (double)N, descA, 51 );
 
     /* Save A for check */
-    //PASTE_TILE_TO_LAPACK( descA, A, check, MORSE_Complex64_t, LDA, N );
     if (check == 1){
         MORSE_zlacpy_Tile(MorseUpperLower, descA, descAC);
     }
 
     //RUNTIME_zlocality_allrestrict( STARPU_CUDA );
 
-    /* MORSE ZPOSV */
+    /* MORSE ZPOTRF */
     START_TIMING();
     MORSE_zpotrf_Tile(uplo, descA);
     STOP_TIMING();
@@ -56,39 +54,26 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     /* Check the solution */
     if ( check )
     {
+        /* Initialize and save B */
         MORSE_zplrnt_Tile( descB, 7672 );
-
-//        PASTE_TILE_TO_LAPACK( descB, B, check, MORSE_Complex64_t, LDB, NRHS );
-//        MORSE_zpotrs_Tile( uplo, descA, descB );
-//        PASTE_TILE_TO_LAPACK( descB, X, check, MORSE_Complex64_t, LDB, NRHS );
-//        /* LAPACK check */
-//        if ( MORSE_My_Mpi_Rank() == 0 ) {
-//            dparam[IPARAM_RES] = z_check_solution(N, N, NRHS, A, LDA, B, X, LDB,
-//                                                &(dparam[IPARAM_ANORM]),
-//                                                &(dparam[IPARAM_BNORM]),
-//                                                &(dparam[IPARAM_XNORM]));
-//        }
-
         MORSE_zlacpy_Tile(MorseUpperLower, descB, descX);
+
+        /* Compute the solution */
         MORSE_zpotrs_Tile( uplo, descA, descX );
+
+        /* Check solution */
         dparam[IPARAM_ANORM] = MORSE_zlange_Tile(MorseInfNorm, descAC);
         dparam[IPARAM_BNORM] = MORSE_zlange_Tile(MorseInfNorm, descB);
         dparam[IPARAM_XNORM] = MORSE_zlange_Tile(MorseInfNorm, descX);
-//		if ( MORSE_My_Mpi_Rank() == 0 )
-//			printf("Morse anorm, xnorm, bnorm: %e,%e,%e\n",dparam[IPARAM_ANORM],dparam[IPARAM_XNORM],dparam[IPARAM_BNORM]);
-		MORSE_zgemm_Tile( MorseNoTrans, MorseNoTrans, 1.0, descAC, descX, -1.0, descB );
-		dparam[IPARAM_RES] = MORSE_zlange_Tile(MorseInfNorm, descB);
+        MORSE_zgemm_Tile( MorseNoTrans, MorseNoTrans, 1.0, descAC, descX, -1.0, descB );
+        dparam[IPARAM_RES] = MORSE_zlange_Tile(MorseInfNorm, descB);
 
         PASTE_CODE_FREE_MATRIX( descB  );
-//        free( A );
-//        free( B );
-//        free( X );
         PASTE_CODE_FREE_MATRIX( descAC );
         PASTE_CODE_FREE_MATRIX( descX  );
 
     }
     PASTE_CODE_FREE_MATRIX( descA );
-    MORSE_TASK_dataflush_all();
 
     return 0;
 }
diff --git a/timing/timing.h b/timing/timing.h
index 00a542bc4a68d6657d45594925b8e3f73e4aefc9..cb0780684919b2dac536f5af46a1c7dc2de6255b 100644
--- a/timing/timing.h
+++ b/timing/timing.h
@@ -86,21 +86,23 @@ enum dparam_timing {
     int64_t IB    = iparam[IPARAM_IB];             \
     int64_t MB    = iparam[IPARAM_MB];             \
     int64_t NB    = iparam[IPARAM_NB];             \
+    int64_t P     = iparam[IPARAM_P];              \
+    int64_t Q     = iparam[IPARAM_Q];              \
     int64_t MT    = (M%MB==0) ? (M/MB) : (M/MB+1); \
     int64_t NT    = (N%NB==0) ? (N/NB) : (N/NB+1); \
     int check     = iparam[IPARAM_CHECK];          \
     int loud      = iparam[IPARAM_VERBOSE];        \
     (void)M;(void)N;(void)K;(void)NRHS;            \
     (void)LDA;(void)LDB;(void)LDC;                 \
-    (void)IB;(void)MB;(void)NB;(void)MT;(void)NT;  \
-    (void)check;(void)loud;
+    (void)IB;(void)MB;(void)NB;(void)P;(void)Q;    \
+    (void)MT;(void)NT;(void)check;(void)loud;
 
 /* Paste code to allocate a matrix in desc if cond_init is true */
 #define PASTE_CODE_ALLOCATE_MATRIX_TILE(_desc_, _cond_, _type_, _type2_, _lda_, _m_, _n_) \
     MORSE_desc_t *_desc_ = NULL;                                        \
     if( _cond_ ) {                                                      \
         MORSE_Desc_Create(&(_desc_), NULL, _type2_, MB, NB, MB*NB, _lda_, _n_, 0, 0, _m_, _n_, \
-                          iparam[IPARAM_P], iparam[IPARAM_Q]);          \
+                          P, Q);          \
     }
 
 #define PASTE_CODE_FREE_MATRIX(_desc_)                                  \
@@ -196,20 +198,20 @@ enum dparam_timing {
  *
  */
 #define START_TIMING()                \
+  t = -RUNTIME_get_time();            \
   START_DAG();                        \
   START_TRACING();                    \
-  START_DISTRIBUTED();                \
-  t = -RUNTIME_get_time();
+  START_DISTRIBUTED();
 
 #define STOP_TIMING()                 \
-  STOP_DISTRIBUTED();                 \
   t += RUNTIME_get_time();            \
-  STOP_TRACING();                     \
-  STOP_DAG();                         \
   if (iparam[IPARAM_PROFILE] == 2) {  \
     RUNTIME_kernelprofile_display();  \
     RUNTIME_schedprofile_display();   \
   }                                   \
-  *t_ = t;
+  *t_ = t;                            \
+  STOP_DISTRIBUTED();                 \
+  STOP_TRACING();                     \
+  STOP_DAG();
 
 #endif /* TIMING_H */