# Exec error : exec assert

**URL:** <https://community.freefem.org/t/exec-error-exec-assert/1293>\
**Category:** General Discussion\
**Created:** [October 31, 2021, 11:16pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293 "2021-10-31T23:16:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [October 31, 2021, 11:16pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/1 "2021-10-31T23:16:17Z")

</div>

I run a piece of parallel code using 12 processors. This “Exec error” occurs **randomly** … what does this mean?  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/6c2a701965ad7283ca3d3569c113ce016efc8b15.png)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 7:23am UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/2 "2021-11-01T07:23:40Z")

</div>

You need to tell us what is line 1484 otherwise we can’t help you.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 8:10am UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/3 "2021-11-01T08:10:50Z")

</div>

Line 1484 is not in my code as attached: [fsi\_3d\_1.edp](https://community.freefem.org/uploads/short-url/lvUyGWeg0Mt8bLvFr5My6avuXXw.edp) (7.0 KB)  
By the way, this error occurs when using **P1b/P1** elements, there is no such error for **P2/P1** elements.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 8:15am UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/4 "2021-11-01T08:15:17Z")

</div>

Run _without_ `-v 0` or `-ns` so that the FreeFEM script will be parsed and printed to screen.  
That line (1484) probably comes from a `.idp` you are including, so you’ll be able to see it then.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 4:31pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/5 "2021-11-01T16:31:40Z")

</div>

Thank you @prj . I removed -v 0, and the it printed the following messages:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/ba149ecfee7d1dab128d79f0f850786ce8a894d9.png)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 4:42pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/6 "2021-11-01T16:42:11Z")

</div>

You are still not telling me what is line 1484 of the script executed by FreeFEM.  
Here is an example of what I want you to do.

```auto
$ cat test.edp
include "test.idp"
$ cat test.idp

assert(0);
$ FreeFem++ test.edp -v 0
  current line = 10
Exec error : exec assert
   -- number :1
Exec error : exec assert
   -- number :1
 err code 8 , mpirank 0
-- weird, there is no line 10 in test.edp!
$ FreeFem++ test.edp -v 1 | grep 10
   10 : assert(0);
    2 : sizestack + 1024 =1072 ( 48 )
  current line = 10
-- oh no, there is one indeed!

```

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 7:38pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/7 "2021-11-01T19:38:57Z")

</div>

The following are three screenshots which all include line 1484, which one is relevant to the issue?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/64914a4cd72dbbf12dfd38ba028db39b8e8ecef0.png)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/f15ece35ae150429d56240b23a7e6ba3243a2c8a.png)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/e6eec1f6af6c3a45ce53407151cf922128acf972.png)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 7:44pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/8 "2021-11-01T19:44:16Z")

</div>

The last one since it’s the only one with an assert. There seems to be something wrong within the `transfer` macro. If you can provide a minimal working example that reproduces this, I can have a look.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 8:49pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/9 "2021-11-01T20:49:59Z")

</div>

Please try this working example [test.edp](https://community.freefem.org/uploads/short-url/vloeXosYRCzO6elCMZjD1hMFxRJ.edp) (988 Bytes) together with these two meshes: [aorta.mesh](https://community.freefem.org/uploads/short-url/3m7yLH9zxTCP4TsKPsfO3nyRBPU.mesh) (3.5 MB)  
[leaflets.mesh](https://community.freefem.org/uploads/short-url/n5obJmV8dSa7iGScYkjbRUWtn0U.mesh) (1.5 MB).

Very interesting: I tried to run it using different processors, the assert error only occurs when using **8** processors:  
on Windows:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/fd07c878c96c8ddeedaf1fd2cda21a86d24f58ba.png)  
on ARC:  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/66d80f5264b369583681d77aab46b7273d8700a1.png)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 8:56pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/10 "2021-11-01T20:56:07Z")

</div>

Thanks! This probably comes from an ill-shaped decomposition. I’ll try to fix this, but this may not be trivial. In the meantime, you can launch your script with the additional parameter `-Dpartitioner=scotch`. I’ve tried with 8 processes, and this finishes successfully.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 9:02pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/11 "2021-11-01T21:02:10Z")

</div>

Great, thank you very much.  
BTW, for this test script the error occurs only for 8 processors. However, for my real long script, the error happens randomly: OK for a few time steps, then this error comes out…

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 1, 2021, 9:04pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/12 "2021-11-01T21:04:52Z")

</div>

Even with `-Dpartitioner=scotch`?

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 1, 2021, 9:06pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/13 "2021-11-01T21:06:34Z")

</div>

> [@prj](#):
>
> -Dpartitioner=scotch

I works fine with -Dpartitioner=scotch for this test example. I will try my real script…

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 2, 2021, 8:42am UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/14 "2021-11-02T08:42:21Z")

</div>

Good morning @prj ,  
The same error still happens for my long script[fsi\_3d\_2.edp](https://community.freefem.org/uploads/short-url/vR3zPiw27VgsFaAsc0pocicgPOQ.edp) (7.0 KB), and this is the command I used to run on a ARC system:

#$ -cwd -V  
#$ -l np=12  
#$ -l h\_rt=48:00:00  
#$ -m be  
#$ -M [scsywan@leeds.ac.uk](mailto:scsywan@leeds.ac.uk)  
module load singularity/3.6.4  
singularity run -e --env OMP\_NUM\_THREADS=1 --bind /nobackup:/nobackup …/ff-latest.sif ff-mpirun -n $NSLOTS $PWD/fsi\_3d\_2.edp -v 0 -Dpartitioner=scotch

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/f20027cffed2cb9dcc606b3052deaf7337ee212a.png)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 2, 2021, 12:15pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/15 "2021-11-02T12:15:50Z")

</div>

I see… Then, I really need to try to fix that 😃

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 2, 2021, 3:44pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/16 "2021-11-02T15:44:01Z")

</div>

Do you think this is only a problem for **P1b/P1** elements, or this problem does not depend on elements, and other types of elements, such as **P2/P1** , may have the same problem (although I have not seen)?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 2, 2021, 3:49pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/17 "2021-11-02T15:49:03Z")

</div>

I have a fix, but it ain’t pretty (so I won’t commit it yet and will try to figure out something better — not guaranteed). Please apply the following patch and let me know how things work out.

```auto
diff --git a/idp/macro_ddm.idp b/idp/macro_ddm.idp
index ea8c0861..3649bb3e 100644
--- a/idp/macro_ddm.idp
+++ b/idp/macro_ddm.idp
@@ -1603,19 +1603,19 @@ ENDIFMACRO
         bb(0:2 * dimension - 1) = tmp;
         boundingbox(ThNew, tmp);
         bb(2 * dimension:4 * dimension - 1) = tmp;
- bb(0) -= max(ThName.hmax, ThNew.hmax);
- bb(1) += max(ThName.hmax, ThNew.hmax);
- bb(2) -= max(ThName.hmax, ThNew.hmax);
- bb(3) += max(ThName.hmax, ThNew.hmax);
- bb(4) -= max(ThName.hmax, ThNew.hmax);
- bb(5) += max(ThName.hmax, ThNew.hmax);
- bb(6) -= max(ThName.hmax, ThNew.hmax);
- bb(7) += max(ThName.hmax, ThNew.hmax);
+ bb(0) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(1) += 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(2) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(3) += 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(4) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(5) += 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(6) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(7) += 2.0 * max(ThName.hmax, ThNew.hmax);
 IFMACRO(dimension,3)
- bb(8) -= max(ThName.hmax, ThNew.hmax);
- bb(9) += max(ThName.hmax, ThNew.hmax);
- bb(10) -= max(ThName.hmax, ThNew.hmax);
- bb(11) += max(ThName.hmax, ThNew.hmax);
+ bb(8) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(9) += 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(10) -= 2.0 * max(ThName.hmax, ThNew.hmax);
+ bb(11) += 2.0 * max(ThName.hmax, ThNew.hmax);
 ENDIFMACRO
     }
     int size = mpiSize(ThName#Comm);

```

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 2, 2021, 4:01pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/18 "2021-11-02T16:01:25Z")

</div>

Thank you @prj .

I will try this later…

If I switch to other types of elements, such as **P2/P1** , do you think the problem is still there? I am just curious whether this problem depends on elements type…

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 2, 2021, 4:09pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/19 "2021-11-02T16:09:11Z")

</div>

I think with my patch it will work in all cases. But you can try to not use the patch and see if the problem persists by simply changing the polynomial order.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [November 2, 2021, 9:46pm UTC](https://community.freefem.org/t/exec-error-exec-assert/1293/20 "2021-11-02T21:46:44Z")

</div>

Hi @prj ,  
Because I use the docker image of FreeFem from [https://github.com/FreeFem/FreeFem-docker/releases/download/v4.9/freefem.tar.gz](https://github.com/FreeFem/FreeFem-docker/releases/download/v4.9/freefem.tar.gz)  
and then use this to create a singularity container on the university’s ARC system.

Do you have idea how to find the file “macro\_ddm.idp” and modify it?

I did  
`tar xfv freefem.tar.gz`  
find the file in the directory of  
`/27aabd1d68152facdb0235a55aa76b176bc683f1653411d55d1dd0f9bd1ab657/layer/usr/freefem/lib/ff++/4.9/idp`  
However, when I  
`tar czf freefem.tar.gz ...`

There are error to build singularity container from this new freefem.tar.gz.

[Next page](https://community.freefem.org/t/exec-error-exec-assert/1293.md?page=2)
