# Failed to run example cases using openmp as backend

**URL:** <https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649>\
**Category:** Errors\
**Created:** [17 July 2022 13:54 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649 "2022-07-17T13:54:24Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [25 July 2022 07:44 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/21 "2022-07-25T07:44:58Z")

</div>

Did you try following Freddie’s advice about manually compiling libxsmm with the flags he specified?

---

<div class="post-metadata">

**Author:** ![hwtang](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hwtang](https://pyfr.discourse.group/u/hwtang)\
**Post date:** [25 July 2022 09:11 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/22 "2022-07-25T09:11:38Z")

</div>

Yes. Following the install guide, I have tried to build PyFR 1.14.0 from the source code and compile every dependent package from the source code. Every package was compiled successfully. But some errors happened when I ran the cases.

However, I am sorry that I did not save the error output. It should be something like “undefined symbol”. I am using a lower version of PyFR (1.12.3). When the simulation is over, I could try to reproduce the error output.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [25 July 2022 12:48 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/23 "2022-07-25T12:48:01Z")

</div>

This error is usually a consequence of libxsmm not being compiled with the BLAS=0 flag.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![hwtang](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hwtang](https://pyfr.discourse.group/u/hwtang)\
**Post date:** [26 July 2022 02:11 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/24 "2022-07-26T02:11:07Z")

</div>

I am sure that I have added that flag. I did it in this way:

```auto
git checkout 14b6cea61376653b2712e3eefa72b13c5e76e421
make STATIC=0 BLAS=0 CODE_BUF_MAXSIZE=262144
make install

```

I may try again this weekend.

---

<div class="post-metadata">

**Author:** ![EitanA](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@EitanA](https://pyfr.discourse.group/u/EitanA)\
**Post date:** [28 July 2022 06:09 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/25 "2022-07-28T06:09:07Z")

</div>

I too am getting the same error when trying to run pyfr using openmp even though to the best of my understanding libxsmm has been compiled as instructed. I would be happy to understand if and what I am doing wrong.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [28 July 2022 11:42 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/26 "2022-07-28T11:42:11Z")

</div>

On my system:

```auto
$ cd ~/Programming/libxsmm
$ make -j4 SHARED=1 NOBLAS=1
$ export PYFR_XSMM_LIBRARY_PATH=$HOME/Programming/libxsmm/lib/libxsmm.so
$ cd ../PyFR/examples/euler_vortex_2d
$ pyfr run -bopenmp -p euler_vortex_2d.pyfrm euler_vortex_2d.ini
100.0% [====================================================================================>] 100.00/100.00 ela: 00:00:07 rem: 00:00:00

```

with PyFR being a straight check out of v1.14 and libxsmm being the current master revision. Also verified on an Apple M1 system.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![EitanA](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@EitanA](https://pyfr.discourse.group/u/EitanA)\
**Post date:** [28 July 2022 12:25 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/27 "2022-07-28T12:25:41Z")

</div>

Thank you.  
now it works.

---

<div class="post-metadata">

**Author:** ![hwtang](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hwtang](https://pyfr.discourse.group/u/hwtang)\
**Post date:** [30 July 2022 08:28 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/28 "2022-07-30T08:28:31Z")

</div>

This way works for me, too. Thank you.

However, I found a strange problem. When using openmp, the cpu usage is always nearly full, even if I only use one core

```auto
pyfr run -b openmp -p inc_cylinder_2d.pyfrm inc_cylinder_2d.ini

```

(There are 24 cores on my PC, but the CPU usage was more than 90% when I used the above command.)

@fdw @EitanA Did you see such a problem?

---

<div class="post-metadata">

**Author:** ![hwtang](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hwtang](https://pyfr.discourse.group/u/hwtang)\
**Post date:** [30 July 2022 09:31 UTC](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649/29 "2022-07-30T09:31:39Z")

</div>

Find an answer [here](https://pyfr.discourse.group/t/running-on-a-single-cpu-core/113/2).

```auto
export OMP_NUM_THREADS=1

```

Thank you all for your help.

[Previous page](https://pyfr.discourse.group/t/failed-to-run-example-cases-using-openmp-as-backend/649.md?page=1)
