# The phenomenon of taking a long time to create a matrix

**URL:** <https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502>\
**Category:** General Discussion\
**Created:** [September 20, 2024, 1:47pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502 "2024-09-20T13:47:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongheng](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yongheng](https://community.freefem.org/u/yongheng)\
**Post date:** [September 20, 2024, 1:47pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502/1 "2024-09-20T13:47:17Z")

</div>

“When I use the PETSc database in FreeFem++ and encounter a long duration with the function call ‘MatCreate(Vh,A,P1)’, which shows ‘partition of unity build (in 3.259087e+03)’, is this a normal phenomenon?”

---

<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:** [September 20, 2024, 1:47pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502/2 "2024-09-20T13:47:34Z")

</div>

What is the size of your problem? How many processes are you using?

---

<div class="post-metadata">

**Author:** ![yongheng](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yongheng](https://community.freefem.org/u/yongheng)\
**Post date:** [September 20, 2024, 2:04pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502/3 "2024-09-20T14:04:13Z")

</div>

I used a more complex mesh.

---

<div class="post-metadata">

**Author:** ![yongheng](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yongheng](https://community.freefem.org/u/yongheng)\
**Post date:** [September 20, 2024, 2:06pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502/4 "2024-09-20T14:06:57Z")

</div>

But I don’t have this problem when using the `buildmat` function. I wonder what the differences are between the `matcreate` and `buildmat` functions.

---

<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:** [September 23, 2024, 8:01pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502/5 "2024-09-23T20:01:12Z")

</div>

Could you send a reproducer?
