Differences in results between single-core and parallel computations

29 views
Skip to first unread message

Yufan Zhai

unread,
Jun 2, 2025, 10:18:34 AMJun 2
to IBAMR Users

I would like to ask about an issue where the pressure and velocity values at specific probe points differ significantly between single-core and parallel computations.
In my example.cpp, I specified several probe coordinates, expecting to output their corresponding pressure and velocity values. However, when I run the simulation with different numbers of CPU cores, the results vary greatly.

I would like to know:

  1. Why this discrepancy occurs between single-core and parallel runs, and

  2. How to ensure consistency of probe results between single-core and parallel computations

Results: p   vx
                vy  vz
single-core(orange)  parallel(5 cores, blue)
Screenshot from 2025-06-02 16-14-35.png

Boyce Griffith

unread,
Jun 2, 2025, 10:24:09 AMJun 2
to IBAMR Users
We are going to need some more information about what is being computed to be able to tell you anything concrete.

One thing that I will mention is that the code does not guarantee that AMR grid generation is independent of processor count, and changing the grid layout will change the computed solution.

— Boyce

single-core(orange)  parallel(5 cores, blue)
<Screenshot from 2025-06-02 16-14-35.png>

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ibamr-users/aeb27bd1-a810-4b78-95b7-1641a5ad68d8n%40googlegroups.com.
<Screenshot from 2025-06-02 16-14-35.png>

Yufan Zhai

unread,
Jun 4, 2025, 4:37:22 AMJun 4
to ibamr...@googlegroups.com
Thank you very much, Boyce.

In my current simulation, two fish models are swimming in an oncoming flow with constant velocity. I have attached the relevant code for your reference. Could you provide some advice on parallel calculations?

I’ve encountered another issue while running on one core: at the beginning of the simulation, each frame takes approximately 4 seconds to compute. However, as the simulation progresses (5000 frames), the computation time per frame gradually increases to around 40 seconds. Do you have any suggestions on how to resolve this issue, such as releasing the memory of the previous frames?

Thank you in advance for your time and support.

Best regards,
Yufan



You received this message because you are subscribed to a topic in the Google Groups "IBAMR Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ibamr-users/uwPXV5dMpZs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ibamr-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ibamr-users/4D331FD0-877B-4CC6-8B67-3600C4775DBB%40gmail.com.
example.cpp

Boyce Griffith

unread,
Jun 4, 2025, 1:07:19 PMJun 4
to IBAMR Users

On Jun 4, 2025, at 4:37 AM, Yufan Zhai <yufan...@gmail.com> wrote:

Thank you very much, Boyce.

In my current simulation, two fish models are swimming in an oncoming flow with constant velocity.

One question is whether you are sampling at or near locations that are refined in one case and unrefined in another.

I have attached the relevant code for your reference. Could you provide some advice on parallel calculations?

I’ve encountered another issue while running on one core: at the beginning of the simulation, each frame takes approximately 4 seconds to compute. However, as the simulation progresses (5000 frames), the computation time per frame gradually increases to around 40 seconds. Do you have any suggestions on how to resolve this issue, such as releasing the memory of the previous frames?

I would guess that there is more local refinement later in the computation, as a wake develops behind the swimmers. You could try adjusting the tagging criteria to tag less of the wake region, which should make the time steps faster.

However, 40 seconds per time step sounds pretty slow for a 2D computation. Are you running with optimizations enabled or using extremely high resolution?
Reply all
Reply to author
Forward
0 new messages