-
|
We @pedro-jm @mkavulich are working on integrating the OpenMP-parallelized fire model (https://github.com/NCAR/fire_behavior/tree/develop) into the UFS Weather Model using the UFS SRW App (https://github.com/mkavulich/ufs-srweather-app/tree/feature/ufs_fire_updates), and we are running into issues with how OpenMP threading is handled on the FIRE cap within the ESMF coupling framework. The fire model itself is already parallelized with OpenMP. In the SRW App, OpenMP is enabled using ufs.configure file where the number of OpenMP threads can be set for the ATM and FIRE: Here is the ufs.configure for a 2-thread example: If we put 2 threads in the ATM and 1 in the FIRE the UFS-Fire sim works fine. The problem is when FIRE_omp_num_threads > 1 in the fire because the fire cap runs as a parallel region and thus calling initialization and other subs multiple times. Also each thread has is portion of the fire grid (ESMF is doing the domain decomposition for OpenMP). This behavior conflicts with how the fire model is designed to run. We would like:
Is it expected that setting *_omp_num_threads > 1 causes the component cap itself to execute as a parallel OpenMP region? Is there a supported way to force the FIRE cap to run serially, while still allowing OpenMP parallelism inside the fire model? Any guidance, documentation pointers, or example configurations would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 6 replies
-
|
Hello @masih-e, We have received your question, and I will be forwarding it to our internal SME's to gather a response. Thank you, Josh Kublnick |
Beta Was this translation helpful? Give feedback.
-
|
@danrosen25 could you provide any guidance on this? |
Beta Was this translation helpful? Give feedback.
-
|
@theurich I don't see the issue with the configuration. Do you have any ideas on what might be going on inside the fire_behavior model? |
Beta Was this translation helpful? Give feedback.
-
|
@theurich @danrosen25 Thanks, I added VM logging at the start of Advertise as suggested.
I believe here is the output from the PET60 and 61: 20260210 155307.813 INFO PET60 --- VMK::log() start ------------------------------------- 20260210 155307.813 INFO PET61 --- VMK::log() start ------------------------------------- I also added prints at the beginning/end of each subroutine (Advertise/Realize/SetClock/Advance/...) and all prints appear twice in the log. The code crashes in advance and does not leave the subroutine. I think it's crashing in this line grid%fz0(1:grid%nx,1:grid%ny) = ptr_z0(clb(1):cub(1),clb(2):cub(2)) * 0.01 I added the following prints in the advance ` print *, 'grid%nx, grid%ny', grid%nx, grid%ny print *, 'clb(1):cub(1),clb(2):cub(2)', clb(1),cub(1),clb(2),cub(2) Output: Note the size mismatch (200×200 vs 100×200) where we expected to be the same. |
Beta Was this translation helpful? Give feedback.
-
|
@masih-e Thank you for the output. Seeing it I wonder if the However, next I wonder if the component is integrated into UFS correctly calling the |
Beta Was this translation helpful? Give feedback.
-
|
Okay I think I see it here: https://github.com/ufs-community/ufs-weather-model/blob/a796a4f616286f1f6a765b53d3c0302986f9a971/driver/UFSDriver.F90#L89C1-L91C7 So that's the problem: there needs to be also ufs-weather-model/driver/UFSDriver.F90 Line 491 in a796a4f E.g. look at how this is done for WW3 with |
Beta Was this translation helpful? Give feedback.
-
|
Thanks again for your help. @theurich Following up, I wired SetVM into the UFS driver as you suggested in driver/UFSDriver.F90 My question now is what the expected SetVM logic should be inside the fire_behavior NUOPC cap. I looked at WW3 for the pattern; I see it has |
Beta Was this translation helpful? Give feedback.
-
|
@masih-e nothing further to do, the What is happening is that NUOPC (though So now that you wired this correctly into |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, I should have noticed this earlier when you quoted the code that you added. You also need to pass the |
Beta Was this translation helpful? Give feedback.
Sorry, I should have noticed this earlier when you quoted the code that you added. You also need to pass the
infoobject. This is where the OpenMP relevant information is passed intoNUOPC_DriverAddComp(). So the full calling block looks like this: