diff --git a/compute/pzpotrf.c b/compute/pzpotrf.c
index 152422a5b0c18c07f3e9b89072fcb4ef717e20ea..45a78b9102bed055ae75457165eead0cd18b1ec2 100644
--- a/compute/pzpotrf.c
+++ b/compute/pzpotrf.c
@@ -3,7 +3,7 @@
  * @copyright (c) 2009-2014 The University of Tennessee and The University
  *                          of Tennessee Research Foundation.
  *                          All rights reserved.
- * @copyright (c) 2012-2014 Inria. All rights reserved.
+ * @copyright (c) 2012-2016 Inria. All rights reserved.
  * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
  *
  **/
@@ -24,6 +24,7 @@
  * @author Mathieu Faverge
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
+ * @author Florent Pruvost
  * @date 2010-11-15
  * @precisions normal z -> s d c
  *
@@ -56,7 +57,9 @@ void morse_pzpotrf(MORSE_enum uplo, MORSE_desc_t *A,
 #ifdef CHAMELEON_USE_MAGMA
     if (0) /* Disable the workspace as long as it is is not used*/
     {
+#if !defined(CHAMELEON_SIMULATION)
         int nb = magma_get_zpotrf_nb(A->nb);
+#endif
         ws_host = sizeof(MORSE_Complex64_t)*nb*nb;
     }
 #endif
diff --git a/compute/pzpotrimm.c b/compute/pzpotrimm.c
index 8f7345db6578753db08af413052b5935c6a151e4..db4c65787b7a109edd197f82e0f45e6dcbffc266 100644
--- a/compute/pzpotrimm.c
+++ b/compute/pzpotrimm.c
@@ -3,7 +3,7 @@
  * @copyright (c) 2009-2014 The University of Tennessee and The University
  *                          of Tennessee Research Foundation.
  *                          All rights reserved.
- * @copyright (c) 2012-2014 Inria. All rights reserved.
+ * @copyright (c) 2012-2016 Inria. All rights reserved.
  * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
  *
  **/
@@ -59,7 +59,9 @@ 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);
+#endif
       RUNTIME_options_ws_alloc( &options, nb*nb, 0 );
     }
 #endif