# setting NPP, NSUB\_X, NSUB\_E for OPENMP

**URL:** <https://forum.croco-ocean.org/t/setting-npp-nsub-x-nsub-e-for-openmp/436>\
**Category:** compilation-installation\
**Tags:** compilation-installation, dynamics-numerics\
**Created:** [February 24, 2023, 4:59pm UTC](https://forum.croco-ocean.org/t/setting-npp-nsub-x-nsub-e-for-openmp/436 "2023-02-24T16:59:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonaljit](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sonaljit](https://forum.croco-ocean.org/u/sonaljit)\
**Post date:** [February 24, 2023, 4:59pm UTC](https://forum.croco-ocean.org/t/setting-npp-nsub-x-nsub-e-for-openmp/436/1 "2023-02-24T16:59:38Z")

</div>

Hello,  
I am running CROCO with gfortran OPENMP. I am face a problem with setting the tile parameters NSUB\_X and NSUB\_E. My system has 28 CPUs.

In param.h, I am setting the OPENMP parameters in this way:

```
#elif defined OPENMP
  parameter (NPP=28)
  parameter (NSUB_X=7)
  parameter (NSUB_E=4)

```

While compiling, this is the error I get:

`cpp -traditional -DLinux -P -I/usr/include -ICROCOFILES/AGRIF_INC par_pisces.F90 > par_pisces_.f90 gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 -mcmodel=medium -fopenmp par_pisces_.f90 -o par_pisces.o cpp -traditional -DLinux -P -I/usr/include -ICROCOFILES/AGRIF_INC param.F | ./mpc > param_.f gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 -mcmodel=medium -fopenmp param_.f -o param.o param_.f:12:25:`

`parameter (NSUB_X=1, NSUB_E=NPP) 1`

`Error: PARAMETER attribute of ‘nsub_x’ conflicts with PARAMETER attribute at (1)`

`Makedefs:13: recipe for target 'param.o' failed`  
`make: *** [param.o] Error 1`

I think the code is taking a default value of NSUB\_X = 1, and therefore setting NSUB\_E as 28. But I am providing 7 and 4, which is conflicting with the default values. I tried turning off the AUTOTILING flag, but its still showing the same error.

Where should I make the appropriate change so that it can set the tiling for OPENMP to 7 and 4?

Thanks.

---

<div class="post-metadata">

**Author:** ![Rachid](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/rachid/32/296_2.png) [@Rachid](https://forum.croco-ocean.org/u/Rachid)\
**Post date:** [February 24, 2023, 5:55pm UTC](https://forum.croco-ocean.org/t/setting-npp-nsub-x-nsub-e-for-openmp/436/2 "2023-02-24T17:55:59Z")

</div>

Hi

What is weird is that the compiler is going through this line

> parameter (NSUB\_X=1, NSUB\_E=NPP)

You can attach your param.h, but for me, for what you want to do it should look like

```
#ifdef MPI
   integer NP_XI, NP_ETA, NNODES
   parameter (NP_XI=1, NP_ETA=4, NNODES=NP_XI*NP_ETA)
   parameter (NPP=1)
   parameter (NSUB_X=1, NSUB_E=1)
#elif defined OPENMP
   parameter (NPP=28)
   # ifdef AUTOTILING
   common/distrib/NSUB_X, NSUB_E
   # else
   parameter (NSUB_X=7, NSUB_E=4)
  # endif
#else
   parameter (NPP=1)
   # ifdef AUTOTILING
   common/distrib/NSUB_X, NSUB_E
   # else
   parameter (NSUB_X=1, NSUB_E=NPP)
 # endif
#endif

```

Rachid
