fds icon indicating copy to clipboard operation
fds copied to clipboard

FDS 6.10.X crashes on hosts with low memory although T_END=0

Open rweisse opened this issue 1 year ago • 18 comments

Describe the bug FDS (version 6.10.0 / 6.10.1) crashes before the creation of the smv file is completed. Although the parameter T_END=0 was set, FDS seems to initialise arrays of meshes first. After that the smv file appears to be generated. This is a problem on all hosts that have insufficient memory.

To Reproduce The following input file will work for FDS 6.10.X on every host :

&HEAD CHID='test_working', TITLE='Test working' /
&TIME T_END=0 /
&REAC FUEL='ETHANE', HEAT_OF_COMBUSTION=40000 /
&SURF ID='A', COLOR='RED', HRRPUA=500.0 /
&MESH XB =  0.0, 10.0, 0.0, 10.0, 0.0, 10.0, IJK = 10, 10, 10 /                                  
&VENT XB =  0.0,  0.0, 0.0, 10.0, 0.0,  1.0, SURF_ID = 'OPEN' /
&VENT XB = 10.0, 10.0, 0.0, 10.0, 0.0,  1.0, SURF_ID = 'OPEN' /
&OBST XB =  4.0,  6.0,  4.0,  6.0, 0.0, 0.0, SURF_ID='A' /
&TAIL /

And the following input file will crash for FDS 6.10.X on most hosts (but it will work with minor versions of FDS on every host):

&HEAD CHID='test_crashing', TITLE='Test crashing' /
&TIME T_END=0 /
&REAC FUEL='ETHANE', HEAT_OF_COMBUSTION=40000 /
&SURF ID='A', COLOR='RED', HRRPUA=500.0 /
&MESH XB =  0.0, 10.0, 0.0, 10.0, 0.0, 10.0, IJK = 1000, 1000, 1000 /                                  
&VENT XB =  0.0,  0.0, 0.0, 10.0, 0.0,  1.0, SURF_ID = 'OPEN' /
&VENT XB = 10.0, 10.0, 0.0, 10.0, 0.0,  1.0, SURF_ID = 'OPEN' /
&OBST XB =  4.0,  6.0,  4.0,  6.0, 0.0, 0.0, SURF_ID='A' /
&TAIL /

Both input files differ in their mesh only by the IJK parameter.

Expected behavior Previous versions of FDS generated the smv file when using T_END=0 (or T_BEGIN == T_END) and finished the calculation immediately.

This feature is essential because we modelling our simulations on notebooks and calculate them on workstations.

Additional information It seems that FDS 6.10.0 and 6.10.1 are initiating their meshes first. If you monitor your memory usage you will see that it increases. Minor versions won't use any memory at this stage.

rweisse avatar Apr 10 '25 13:04 rweisse

Thanks for the report. We will take a look.

rmcdermo avatar Apr 10 '25 13:04 rmcdermo

Reproduced this issue on my mac. FDS-6.9.1 works as expected, FDS-6.10.1 latest dies. Bisect gives,

8bb0765e3a4afb5a0b59055fac2b680a339eb6f9 is the first bad commit
commit 8bb0765e3a4afb5a0b59055fac2b680a339eb6f9
Author: mcgratta
Date:   Wed Oct 30 14:50:49 2024 -0400

    FDS Source: firemodels/smv#2085. Add flags to indicate OBST face hidden

rmcdermo avatar Apr 10 '25 14:04 rmcdermo

Glenn, I added six integers at the end of the OBST coordinate line in Smokeview

WRITE(MYSTR,'(8I5,A,L1,1X,6I2)') OB%I1,OB%I2,OB%J1,OB%J2,OB%K1,OB%K2,OB%COLOR_INDICATOR,OB%TYPE_INDICATOR, &
                                          ' ! ',OB%REMOVABLE,OB%EXPOSED_FACE_INDEX(1:6)

Does Smokeview use OB%EXPOSED_FACE_INDEX(1:6)? I ask because we go through the big initialization routine to get these values.

mcgratta avatar Apr 10 '25 19:04 mcgratta

yes. this was added when we had trouble with cases with disappearing blockages for blockages that crossed a mesh boundary. think we could get away with not outputting it when T_END=0.0

On Thu, Apr 10, 2025 at 4:00 PM Kevin McGrattan @.***> wrote:

Glenn, I added six integers at the end of the OBST coordinate line in Smokeview

WRITE(MYSTR,'(8I5,A,L1,1X,6I2)') OB%I1,OB%I2,OB%J1,OB%J2,OB%K1,OB%K2,OB%COLOR_INDICATOR,OB%TYPE_INDICATOR, & ' ! ',OB%REMOVABLE,OB%EXPOSED_FACE_INDEX(1:6)

Does Smokeview use OB%EXPOSED_FACE_INDEX(1:6)? I ask because we go through the big initialization routine to get these values.

— Reply to this email directly, view it on GitHub https://github.com/firemodels/fds/issues/14489#issuecomment-2795029499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UCRWB45IDQBQC3TOH6I32Y3EUJAVCNFSM6AAAAAB23T6XYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGAZDSNBZHE . You are receiving this because you are subscribed to this thread.Message ID: @.***> mcgratta left a comment (firemodels/fds#14489) https://github.com/firemodels/fds/issues/14489#issuecomment-2795029499

Glenn, I added six integers at the end of the OBST coordinate line in Smokeview

WRITE(MYSTR,'(8I5,A,L1,1X,6I2)') OB%I1,OB%I2,OB%J1,OB%J2,OB%K1,OB%K2,OB%COLOR_INDICATOR,OB%TYPE_INDICATOR, & ' ! ',OB%REMOVABLE,OB%EXPOSED_FACE_INDEX(1:6)

Does Smokeview use OB%EXPOSED_FACE_INDEX(1:6)? I ask because we go through the big initialization routine to get these values.

— Reply to this email directly, view it on GitHub https://github.com/firemodels/fds/issues/14489#issuecomment-2795029499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UCRWB45IDQBQC3TOH6I32Y3EUJAVCNFSM6AAAAAB23T6XYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGAZDSNBZHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Glenn Forney

gforney avatar Apr 10 '25 21:04 gforney

I was thinking this too. But I'd rather not have a new set of output lines for T_END=0. Is there a default value that would ensure that Smokeview draws the scene appropriately?

mcgratta avatar Apr 10 '25 21:04 mcgratta

smokeview assumes values are -1 if they are not there . so you could output those - or output nothing. If smokeview doesn't see these parameters it assumes they are 0 . I'll look at the test cases for this situation (dissapearing blockage crossing mesh boundary) and see if there is a problem . I'll report later what and where this test case is so you can test yourself

On Thu, Apr 10, 2025 at 5:16 PM Kevin McGrattan @.***> wrote:

I was thinking this too. But I'd rather not have a new set of output lines for T_END=0. Is there a default value that would ensure that Smokeview draws the scene appropriately?

— Reply to this email directly, view it on GitHub https://github.com/firemodels/fds/issues/14489#issuecomment-2795185898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UCRW2VNMFBXOHEF7XJCT2Y3NUDAVCNFSM6AAAAAB23T6XYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGE4DKOBZHA . You are receiving this because you commented.Message ID: @.***> mcgratta left a comment (firemodels/fds#14489) https://github.com/firemodels/fds/issues/14489#issuecomment-2795185898

I was thinking this too. But I'd rather not have a new set of output lines for T_END=0. Is there a default value that would ensure that Smokeview draws the scene appropriately?

— Reply to this email directly, view it on GitHub https://github.com/firemodels/fds/issues/14489#issuecomment-2795185898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UCRW2VNMFBXOHEF7XJCT2Y3NUDAVCNFSM6AAAAAB23T6XYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGE4DKOBZHA . You are receiving this because you commented.Message ID: @.***>

-- Glenn Forney

gforney avatar Apr 10 '25 21:04 gforney

A verification case involving removaable blockages crossing a mesh boundary: smv/Verification/Visualization/obst_remove.fds

gforney avatar Apr 11 '25 07:04 gforney

made a type i my first post. should have written: If smokeview doesn't see these parameters it assumes they are -1 .

I would expect these values are only used when an obstacle disappears which would be for . a time > 0.0 . So should not be needed for the T_END=0.0 case. So writing out -1 should be OK

gforney avatar Apr 11 '25 07:04 gforney

I have had to overhaul some of the initialization routines so that the Smokeview file is created before the large arrays are allocated. I am testing this now.

mcgratta avatar Apr 22 '25 21:04 mcgratta

This change eliminates the crash, but it takes a long time to set up the 1000 cubed case. I'll see if this can be sped up.

mcgratta avatar Apr 23 '25 15:04 mcgratta

This case should not crash and now it loads much faster than before. Reopen the issue if it still does not work.

mcgratta avatar May 05 '25 18:05 mcgratta

Hi @mcgratta , today I had the time to test the current nightly version of fds. The problem seems to persist. Is your change allready included in the current nightly version?

rweisse avatar May 19 '25 08:05 rweisse

Yes, the change was incorporated in the nightly build. I will look at the case again.

mcgratta avatar May 19 '25 13:05 mcgratta

This is what I see when I run the case. The RAM usage rises to approximately 30 GB.

 Starting FDS ...

 MPI Process      0 started on spark-login

 Reading FDS input file ...


 Fire Dynamics Simulator

 Current Date     : May 19, 2025  09:25:48
 Revision         : FDS-6.10.1-201-g0c0a55d-master
 Revision Date    : Mon May 12 16:36:37 2025 -0400
 Compiler         : Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.1.0 Build 20250317
 Compilation Date : May 12, 2025 16:38:02

 Number of MPI Processes:  1

 MPI version: 3.1
 MPI library version: Intel(R) MPI Library 2021.15 for Linux* OS

 Hypre library version: v2.33.0
 Sundials library version: v6.7.0

 Job TITLE        : Test crashing
 Job ID string    : test_crashing

 Checking mesh alignment. This could take a few tens of seconds...

STOP: Set-up only (CHID: test_crashing)

mcgratta avatar May 19 '25 13:05 mcgratta

Thank you for reopening this issue. I just checked this again with FDS nightly 6.10.1-232.

In my point of view there are two main problems:

  1. Usage of memory
    • from FDS 6.9.1: no remarkable RAM usage at all (if T_END=0 I could even do this on a Raspberry Pi)
    • to FDS 6.10.X: RAM usage depending on the model (if I have a big model with a large number of meshes I already need a big workstation just to check my model in Smokeview before the real simulation starts)
  2. Time
    • from FDS 6.9.1: creation time of smv-file is nearly instant (if T_END=0)
    • to FDS 6.10.X: creation time of smv-file is depending on the model (if it is not crashing due to a Out-of-Memory error this takes at least 5 Minutes with our models)

In our daily work, the creation of smv files during the modelling phase got very time-consuming with FDS 6.10.X (expensive working time because employees gets paid just for waiting). Furthermore we cannot provide each engineer with their own workstation just for the creation of smv files. At the moment they have notebooks with 32 GB memory. That should be more than enough.

As a result, we cannot distribute FDS 6.10.X to the employees notebooks. They have to stay with FDS 6.9.1 until the creation time of smv-files is low again and memory is no longer noticeable used for this step.

rweisse avatar May 22 '25 06:05 rweisse

I reduced the RAM and CPU requirements of the SETUP_ONLY. Let me know if it works for you.

mcgratta avatar May 22 '25 19:05 mcgratta

Thank you. Now FDS takes around 8 GB of memory for some seconds. This could be still too much for weak clients - but it works with my simple example described above. I do not know if it works for more complex models, too. But the calculation of the smv-file is done as fast as in the past now. This is a great progress!

rweisse avatar May 23 '25 13:05 rweisse

If I were to simplify the set up procedure any further, then we would defeat the purpose of this option; that is, to detect flaws in the set-up, or to evaluate certain chemical properties, reactions, geometry interactions, etc.

If you really want a lightweight set up option, you could use something like PyroSim or Blender-FDS, which, I think, would just present to you the geometry and the memory cost would be relatively low. When one starts FDS, it begins building large arrays as soon as it reads the parameters from the input file. I have prevented FDS from building all the arrays, limiting the allocation to only those needed to create the Smokeview file.

mcgratta avatar May 23 '25 14:05 mcgratta