diff --git a/compute/pzpotrf.c b/compute/pzpotrf.c
index 45a78b9102bed055ae75457165eead0cd18b1ec2..bb26f257893f252a14cc9728bb7211f671c912c9 100644
--- a/compute/pzpotrf.c
+++ b/compute/pzpotrf.c
@@ -59,6 +59,8 @@ void morse_pzpotrf(MORSE_enum uplo, MORSE_desc_t *A,
     {
 #if !defined(CHAMELEON_SIMULATION)
         int nb = magma_get_zpotrf_nb(A->nb);
+#else
+        nb = A->nb;
 #endif
         ws_host = sizeof(MORSE_Complex64_t)*nb*nb;
     }
diff --git a/compute/pzpotrimm.c b/compute/pzpotrimm.c
index db4c65787b7a109edd197f82e0f45e6dcbffc266..7af7a300d7e99e53ebd07b33f222170b2b9dacb5 100644
--- a/compute/pzpotrimm.c
+++ b/compute/pzpotrimm.c
@@ -60,9 +60,11 @@ void morse_pzpotrimm(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_de
 #ifdef CHAMELEON_USE_MAGMA
     {
 #if !defined(CHAMELEON_SIMULATION)
-      int nb = magma_get_zpotrf_nb(A->nb);
+        int nb = magma_get_zpotrf_nb(A->nb);
+#else
+        nb = A->nb;
 #endif
-      RUNTIME_options_ws_alloc( &options, nb*nb, 0 );
+        RUNTIME_options_ws_alloc( &options, nb*nb, 0 );
     }
 #endif