From 569b4016446dcf22861f681820cca52d566e8140 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Tue, 28 Jul 2015 17:32:25 +0000
Subject: [PATCH] distribute data for descL in _incpiv algorithms

---
 compute/zgetrf_incpiv.c         |  2 +-
 control/morse_zf77.c            | 16 ++++++-------
 control/morse_zf90.F90          | 40 +++++++++++++++++++++++----------
 control/workspace.c             |  9 ++++----
 control/workspace.h             |  2 +-
 control/workspace_z.c           | 16 ++++++-------
 include/morse_z.h               |  8 +++----
 testing/testing_zgesv_incpiv.c  |  2 +-
 timing/time_zgesv_incpiv.c      |  2 +-
 timing/time_zgesv_incpiv_tile.c |  8 +++----
 timing/time_zgetrf_incpiv.c     | 10 ++++-----
 11 files changed, 65 insertions(+), 50 deletions(-)

diff --git a/compute/zgetrf_incpiv.c b/compute/zgetrf_incpiv.c
index 83efd8b0a..4b76cbb2e 100644
--- a/compute/zgetrf_incpiv.c
+++ b/compute/zgetrf_incpiv.c
@@ -204,7 +204,7 @@ int MORSE_zgetrf_incpiv_Tile(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV)
     MORSE_zgetrf_incpiv_Tile_Async(A, L, IPIV, sequence, &request);
     RUNTIME_barrier(morse);
     RUNTIME_desc_getoncpu(A);
-    
+
     status = sequence->status;
     morse_sequence_destroy(morse, sequence);
     return status;
diff --git a/control/morse_zf77.c b/control/morse_zf77.c
index 25308e68b..338743a56 100644
--- a/control/morse_zf77.c
+++ b/control/morse_zf77.c
@@ -909,20 +909,20 @@ void MORSE_ALLOC_WORKSPACE_ZGEQRF(int *M, int *N, MORSE_desc_t **T, int *p, int
 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); }
+void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV(int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgesv_incpiv(*N, descL, IPIV, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV_TILE (int *N, MORSE_desc_t **descL, int **IPIV, int *info)
-{ *info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile (*N, descL, IPIV); }
+void MORSE_ALLOC_WORKSPACE_ZGESV_INCPIV_TILE (int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile (*N, descL, IPIV, *p, *q); }
 
 //void MORSE_ALLOC_WORKSPACE_ZGESVD(int *M, int *N, MORSE_desc_t **descT, int *info)
 //{ *info = MORSE_Alloc_Workspace_zgesvd(*M, *N, descT); }
 
-void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV(int *M, int *N, MORSE_desc_t **descL, int **IPIV, int *info)
-{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv(*M, *N, descL, IPIV); }
+void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV(int *M, int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv(*M, *N, descL, IPIV, *p, *q); }
 
-void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV_TILE(int *N, MORSE_desc_t **descL, int **IPIV, int *info)
-{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(*N, descL, IPIV); }
+void MORSE_ALLOC_WORKSPACE_ZGETRF_INCPIV_TILE(int *N, MORSE_desc_t **descL, int **IPIV, int *p, int *q, int *info)
+{ *info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(*N, descL, IPIV, *p, *q); }
 
 //void MORSE_ALLOC_WORKSPACE_ZGETRI_TILE_ASYNC(MORSE_desc_t *A, MORSE_desc_t *W, int *info)
 //{ *info = MORSE_Alloc_Workspace_zgetri_Tile_Async(A, W); }
diff --git a/control/morse_zf90.F90 b/control/morse_zf90.F90
index c974c22d1..e544868ba 100644
--- a/control/morse_zf90.F90
+++ b/control/morse_zf90.F90
@@ -2875,7 +2875,7 @@ module morse_z
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgesv_incpiv_c(N,descL,IPIV) &
+         function MORSE_Alloc_Workspace_zgesv_incpiv_c(N,descL,IPIV,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgesv_incpiv')
             use iso_c_binding
             implicit none
@@ -2883,11 +2883,13 @@ module morse_z
             integer(kind=c_int), value :: N
             type(c_ptr) :: descL ! descL is **, so pass by reference
             type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgesv_incpiv_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV) &
+         function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgesv_incpiv_Tile')
             use iso_c_binding
             implicit none
@@ -2895,6 +2897,8 @@ module morse_z
             integer(kind=c_int), value :: N
             type(c_ptr) :: descL ! descL is **, so pass by reference
             type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c
       end interface
 
@@ -2913,7 +2917,7 @@ module morse_z
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,descL,IPIV) &
+         function MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,descL,IPIV,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgetrf_incpiv')
             use iso_c_binding
             implicit none
@@ -2922,11 +2926,13 @@ module morse_z
             integer(kind=c_int), value :: N
             type(c_ptr) :: descL ! descL is **, so pass by reference
             type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgetrf_incpiv_c
       end interface
 
       interface
-         function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV) &
+         function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV,p,q) &
           & bind(c, name='MORSE_Alloc_Workspace_zgetrf_incpiv_Tile')
             use iso_c_binding
             implicit none
@@ -2934,6 +2940,8 @@ module morse_z
             integer(kind=c_int), value :: N
             type(c_ptr) :: descL ! descL is **, so pass by reference
             type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
+            integer(kind=c_int), value :: p
+            integer(kind=c_int), value :: q
           end function MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c
       end interface
 
@@ -5269,17 +5277,19 @@ module morse_z
          info = MORSE_Alloc_Workspace_zgeqrf_c(M,N,T)
       end subroutine MORSE_Alloc_Workspace_zgeqrf
 
-      subroutine MORSE_Alloc_Workspace_zgesv_incpiv(N,L,IPIV,info)
+      subroutine MORSE_Alloc_Workspace_zgesv_incpiv(N,L,IPIV,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) :: IPIV ! IPIV is **, so pass by reference
          type(c_ptr) :: L ! L is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgesv_incpiv_c(N,L,IPIV)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgesv_incpiv_c(N,L,IPIV,p,q)
       end subroutine MORSE_Alloc_Workspace_zgesv_incpiv
 
-      subroutine MORSE_Alloc_Workspace_zgetrf_incpiv(M,N,L,IPIV,info)
+      subroutine MORSE_Alloc_Workspace_zgetrf_incpiv(M,N,L,IPIV,p,q,info)
          use iso_c_binding
          implicit none
          integer(kind=c_int), intent(out) :: info
@@ -5287,7 +5297,9 @@ module morse_z
          integer(kind=c_int), intent(in) :: N
          type(c_ptr) :: IPIV ! IPIV is **, so pass by reference
          type(c_ptr) :: L ! L is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,L,IPIV)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgetrf_incpiv_c(M,N,L,IPIV,p,q)
       end subroutine MORSE_Alloc_Workspace_zgetrf_incpiv
 
       subroutine MORSE_Alloc_Workspace_zgeev(N,T,info)
@@ -5430,24 +5442,28 @@ module morse_z
          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)
+      subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N,descL,IPIV,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) :: IPIV ! IPIV is **, so pass by reference
          type(c_ptr) :: descL ! descL is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgesv_incpiv_Tile_c(N,descL,IPIV,p,q)
       end subroutine MORSE_Alloc_Workspace_zgesv_incpiv_Tile
 
-      subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(N,descL,IPIV,info)
+      subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(N,descL,IPIV,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) :: IPIV ! IPIV is **, so pass by reference
          type(c_ptr) :: descL ! descL is **, so pass by reference
-         info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV)
+         integer(kind=c_int), value :: p
+         integer(kind=c_int), value :: q
+         info = MORSE_Alloc_Workspace_zgetrf_incpiv_Tile_c(N,descL,IPIV,p,q)
       end subroutine MORSE_Alloc_Workspace_zgetrf_incpiv_Tile
 
       subroutine MORSE_Alloc_Workspace_zgetri_Tile_Async(A,W,info)
diff --git a/control/workspace.c b/control/workspace.c
index ef41f2e02..d66577de4 100644
--- a/control/workspace.c
+++ b/control/workspace.c
@@ -108,7 +108,7 @@ int morse_alloc_ibnb_tile(int M, int N, MORSE_enum func, int type, MORSE_desc_t
 /*******************************************************************************
  *
  **/
-int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV)
+int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV, int p, int q)
 {
     int status;
     int NB, IB, MT, NT;
@@ -148,12 +148,11 @@ int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **des
         *IPIV = NULL;
         return MORSE_SUCCESS;
     }
-
-    *desc = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
+    /* TODO: Fix the distribution for IPIV */
     *IPIV = (int*)malloc( size );
 
-    /* TODO: Fix the distribution for L / IPIV */
-    **desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, 1, 1 );
+    *desc = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
+    **desc = morse_desc_init(type, IB, NB, IB*NB, lm, ln, 0, 0, lm, ln, p, q );
 
     if ( morse_desc_mat_alloc(*desc) ) {
         morse_error("morse_alloc_ipiv", "malloc() failed");
diff --git a/control/workspace.h b/control/workspace.h
index 46be2c86d..bcac24cca 100644
--- a/control/workspace.h
+++ b/control/workspace.h
@@ -33,7 +33,7 @@ extern "C" {
  *  Internal routines
  **/
 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);
+int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **desc, void **IPIV, int p, int q);
 
 #ifdef __cplusplus
 }
diff --git a/control/workspace_z.c b/control/workspace_z.c
index 0e72e7e31..6ca8df01d 100644
--- a/control/workspace_z.c
+++ b/control/workspace_z.c
@@ -333,8 +333,8 @@ int MORSE_Alloc_Workspace_zgelqf_Tile(int M, int N, MORSE_desc_t **descT, int p,
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgesv_incpiv(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_zgesv_incpiv(int N, MORSE_desc_t **descL, int **IPIV, int p, int q) {
+    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
 
 /** ***************************************************************************
  *
@@ -363,9 +363,9 @@ int MORSE_Alloc_Workspace_zgesv_incpiv(int N, MORSE_desc_t **descL, int **IPIV)
  *          \retval MORSE_SUCCESS successful exit
  *
  *****************************************************************************/
-int MORSE_Alloc_Workspace_zgesv_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV)
+int MORSE_Alloc_Workspace_zgesv_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV, int p, int q)
 {
-    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV);
+    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q);
 }
 /** ***************************************************************************
  *
@@ -436,8 +436,8 @@ int MORSE_Alloc_Workspace_zgesvd(int M, int N, MORSE_desc_t **descT, int p, int
  * @sa MORSE_zgetrf_incpiv_Tile_Async
  *
  ******************************************************************************/
-int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV) {
-    return morse_alloc_ipiv(M, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV); }
+int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV, int p, int q) {
+    return morse_alloc_ipiv(M, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
 
 /** ***************************************************************************
  *
@@ -465,8 +465,8 @@ 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, int p, int q) {
+    return morse_alloc_ipiv(N, N, MORSE_FUNC_ZGESV, MorseComplexDouble, descL, (void**)IPIV, p, q); }
 
 /** ***************************************************************************
  *
diff --git a/include/morse_z.h b/include/morse_z.h
index 17867b899..6ac73d92c 100644
--- a/include/morse_z.h
+++ b/include/morse_z.h
@@ -261,8 +261,8 @@ int MORSE_zunmqr_Tile_Async(MORSE_enum side, MORSE_enum trans, MORSE_desc_t *A,
 /** ****************************************************************************
  *  Declarations of workspace allocation functions (tile layout) - alphabetical order
  **/
-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_zgesv_incpiv(        int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
+int MORSE_Alloc_Workspace_zgetrf_incpiv(int M, int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
 
 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);
@@ -286,8 +286,8 @@ int MORSE_Alloc_Workspace_zgetri_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *W);
 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);
+int MORSE_Alloc_Workspace_zgesv_incpiv_Tile (int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
+int MORSE_Alloc_Workspace_zgetrf_incpiv_Tile(int N, MORSE_desc_t **descL, int **IPIV, int p, int q);
 
 /** ****************************************************************************
  *  Auxiliary function prototypes
diff --git a/testing/testing_zgesv_incpiv.c b/testing/testing_zgesv_incpiv.c
index e3d8ab5a4..83254d745 100644
--- a/testing/testing_zgesv_incpiv.c
+++ b/testing/testing_zgesv_incpiv.c
@@ -220,7 +220,7 @@ int testing_zgesv_incpiv(int argc, char **argv)
             B2[LDB*j+i] = B1[LDB*j+i];
 
     /* MORSE ZGESV */
-    MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &IPIV);
+    MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &IPIV, 1, 1);
     MORSE_zgesv_incpiv(N, NRHS, A2, LDA, L, IPIV, B2, LDB);
 
     printf("\n");
diff --git a/timing/time_zgesv_incpiv.c b/timing/time_zgesv_incpiv.c
index fe9112315..c0c3faa9f 100644
--- a/timing/time_zgesv_incpiv.c
+++ b/timing/time_zgesv_incpiv.c
@@ -45,7 +45,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_zplrnt( N, N,    A, LDA,   51 );
     MORSE_zplrnt( N, NRHS, X, LDB, 5673 );
 
-    MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &piv);
+    MORSE_Alloc_Workspace_zgesv_incpiv(N, &L, &piv, P, Q);
 
     /* Save A and b  */
     PASTE_CODE_ALLOCATE_COPY( Acpy, check, MORSE_Complex64_t, A, LDA, N    );
diff --git a/timing/time_zgesv_incpiv_tile.c b/timing/time_zgesv_incpiv_tile.c
index a8d2c1a2e..98094313e 100644
--- a/timing/time_zgesv_incpiv_tile.c
+++ b/timing/time_zgesv_incpiv_tile.c
@@ -30,12 +30,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_desc_t *descL;
     int *piv;
     PASTE_CODE_IPARAM_LOCALS( iparam );
-    
+
     if ( M != N ) {
         fprintf(stderr, "This timing works only with M == N\n");
         return -1;
     }
-    
+
     /* Allocate Data */
     PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N    );
     PASTE_CODE_ALLOCATE_MATRIX_TILE( descX, 1,      MORSE_Complex64_t, MorseComplexDouble, LDB, N, NRHS );
@@ -54,12 +54,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     }
 
     /* Allocate Workspace */
-    MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N, &descL, &piv);
+    MORSE_Alloc_Workspace_zgesv_incpiv_Tile(N, &descL, &piv, P, Q);
 
     START_TIMING();
     MORSE_zgesv_incpiv_Tile( descA, descL, piv, descX );
     STOP_TIMING();
-    
+
     /* Allocate Workspace */
     MORSE_Dealloc_Workspace(&descL);
 
diff --git a/timing/time_zgetrf_incpiv.c b/timing/time_zgetrf_incpiv.c
index 671ce7c70..de0568592 100644
--- a/timing/time_zgetrf_incpiv.c
+++ b/timing/time_zgetrf_incpiv.c
@@ -31,7 +31,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     MORSE_desc_t *L;
     int *piv;
     PASTE_CODE_IPARAM_LOCALS( iparam );
-    
+
     if ( M != N && check ) {
         fprintf(stderr, "Check cannot be perfomed with M != N\n");
         check = 0;
@@ -39,12 +39,12 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
 
     /* Allocate Data */
     PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
-    
+
     /* Initialize Data */
     MORSE_zplrnt(M, N, A, LDA, 3456);
 
     /* Allocate Workspace */
-    MORSE_Alloc_Workspace_zgesv_incpiv( min(M,N), &L, &piv);
+    MORSE_Alloc_Workspace_zgesv_incpiv( min(M,N), &L, &piv, P, Q);
 
     /* Save AT in lapack layout for check */
     PASTE_CODE_ALLOCATE_COPY( Acpy, check, MORSE_Complex64_t, A, LDA, N );
@@ -52,7 +52,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
     START_TIMING();
     MORSE_zgetrf_incpiv( M, N, A, LDA, L, piv );
     STOP_TIMING();
-    
+
     /* Check the solution */
     if ( check )
     {
@@ -66,7 +66,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
                                               &(dparam[IPARAM_ANORM]), 
                                               &(dparam[IPARAM_BNORM]), 
                                               &(dparam[IPARAM_XNORM]));
-        
+
         free( Acpy ); free( B ); free( X );
     }
 
-- 
GitLab