# Possible solutions? to save memory in Variational applications with JEDI-FV3 v1.1.2

**URL:** <https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334>\
**Category:** JEDI\
**Created:** [May 27, 2022, 6:43pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334 "2022-05-27T18:43:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![junpark217](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@junpark217](https://forums.jcsda.org/u/junpark217)\
**Post date:** [May 27, 2022, 6:43pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/1 "2022-05-27T18:43:25Z")

</div>

Hi all,

I am trying to test a pure 3D EnVAR application using JEDI-FV3 v1.1.2 on CONUS configuration with FV3-LAM.  
When I compare EnVAR applications between two JEDI-FV3 releases v1.0.0 and v1.1.2,  
I have noticed that memory usages are somewhat increased in JEDI-FV3 1.1.2.

I remembered I can run the application of JEDI-FV3 v1.0.0 successfully in a single computation node which has 192GB memory. However, this is not viable in JEDI-FV3 v.1.1.2 even for the same configuration (BUMP ensemble COV, 3 Outer loops with maximum 30 inner loops, same observation data, 40 ensemble members). As you can see the below, it takes about ~1TB of memory. Thus, this application requires at least 6 computational nodes with JEDI-FV3 v1.1.2. I want to emphasize that this applications are done for a very small-size domain (300x300).

 ![Screenshot 2022-05-27 1.30.57 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/2f88c43745bf5ede6075f7d83cb883186b40a78a.png)

As you can see in the below screenshot, the memory usage keeps increasing significantly during the inner loop step.

 ![Screenshot 2022-05-27 1.33.17 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/caa4794bdf3f3e6693e81e461ba56cc3f8e6fe59.jpeg)

Is there any possible solution in JEDI-FV3 v1.1.2 not to use memory too much during the inner loop step? I don’t think the application on CONUS is viable due to memory for my current configuration.  
Or are there any other updates in ‘develop’ branch to deal with such things? I guess I have seen that JEDI team tried to refactoring H(x) code at AMS.

Thanks,

Jun

---

<div class="post-metadata">

**Author:** ![shlyaeva](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/shlyaeva/32/103_2.png) [@shlyaeva](https://forums.jcsda.org/u/shlyaeva)\
**Post date:** [May 29, 2022, 2:11am UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/2 "2022-05-29T02:11:01Z")

</div>

Jun, thank you for reporting this, and providing the useful information on the memory usage at each iteration.

I have not heard of the specific efforts aimed to address this issue, but it is possible that develop version would have different memory usage (there has been many different changes that came in since the last release). Do you mind trying fv3-bundle develop version with your application and seeing if you see similar statistics in develop?

---

<div class="post-metadata">

**Author:** ![junpark217](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@junpark217](https://forums.jcsda.org/u/junpark217)\
**Post date:** [June 1, 2022, 5:24pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/3 "2022-06-01T17:24:03Z")

</div>

Hi, Shlyaeva,

Thanks for reply,  
Sure! I’d like to try on ‘develop’ branch of the JEDI-FV3 with variational configurations.

FYI, I am also sharing the results testing ‘CONUS’ domain.  
(1820\*1092) with two variational DA applications by employing JEDI-FV3 v1.1.2.

This shows memory usages of 3DVAR (~0.6 TB) with ‘FV3JEDI-ID BEC’ using JEDI-FV3 v1.1.2 assimilating observations (about 3.3 millions)

 ![Screenshot 2022-05-28 9.35.44 AM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/4d9a5e88c9e2c0de24c8add887bfdb9cd4045ff3.png)

This shows memory usages of P3DEnVAR (~3.4TB) with ‘BUMP ensemble BEC’ using JEDI-FV3 v1.1.2 with 5 members

 ![Screenshot 2022-05-28 9.34.52 AM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/850700af215eba574e1806704d9fa472ffe363d1.png)

I will see if the memory usage keeps increasing in the ‘develop’ branch.  
It will take some time since I need to update base libraries for ‘develop’ branch.  
I will update you later.

Thanks,

Jun

---

<div class="post-metadata">

**Author:** ![shlyaeva](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/shlyaeva/32/103_2.png) [@shlyaeva](https://forums.jcsda.org/u/shlyaeva)\
**Post date:** [June 1, 2022, 6:42pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/4 "2022-06-01T18:42:24Z")

</div>

Thank you Jun! Could you please also share here the yaml configuration file that you are using for your experiments?

Anna

---

<div class="post-metadata">

**Author:** ![junpark217](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@junpark217](https://forums.jcsda.org/u/junpark217)\
**Post date:** [June 1, 2022, 7:31pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/5 "2022-06-01T19:31:55Z")

</div>

Hi Anna,

I captured the main components of my yaml configuration of P3DEnVAR on CONUS.

Cost Function - Geometry, Background, Background Error Cov.

 ![Screenshot 2022-06-01 2.15.50 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/2e16c67b310dd9e1d6de90b99c8aad4f1e8d57d2.png)  
 ![Screenshot 2022-06-01 2.16.01 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/509985ed182bb2b1b2e4eb740bb071f2d9dd7181.png)

Observations, Variational

 ![Screenshot 2022-06-01 2.16.29 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/a2a01db82491cef31591e3186b995dde2ed20083.png)  
…  
 ![Screenshot 2022-06-01 2.17.18 PM](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/ce5c402e7437e109fbcd204d15f062f4958e5c1b.png)

Although you may see additional variables (e.g., use\_cvpq, …), they don’t seem to affect memory usages much I guess (I do not see such things in EnKF applications after the JEDI-FV3 v1.1.2 supports ‘halo’ distribution).

Thank,

Jun

---

<div class="post-metadata">

**Author:** ![junpark217](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@junpark217](https://forums.jcsda.org/u/junpark217)\
**Post date:** [June 9, 2022, 10:52pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/6 "2022-06-09T22:52:55Z")

</div>

Hi Anna,

It seems to me that the ‘develop’ branch (Cloned May 26 2022) also has similar increasing behaviors in memory usages at the inner loop step.

Here I attached memory usages information. I tried 3DVAR using ‘FV3-JEDI ID’ BEC with 15 inner loops.

Develop’ Branch (Cloned May 26 2022) ~ 573 Gb

 ![develop](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/4a218ef60c0f70b072621dbf1407f97b533f43ce.png)

JEDI-FV3 v1.1.2 ~ 549 Gb

 ![v1.1.2](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/e5471716dd51d58ad0aa986dbadd39717a593dc0.png)

Thanks,

Jun

---

<div class="post-metadata">

**Author:** ![junpark217](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@junpark217](https://forums.jcsda.org/u/junpark217)\
**Post date:** [July 21, 2022, 1:41pm UTC](https://forums.jcsda.org/t/possible-solutions-to-save-memory-in-variational-applications-with-jedi-fv3-v1-1-2/334/7 "2022-07-21T13:41:39Z")

</div>

FYI, I cloned the ‘develop’ branch around June 2022 and found that EnVAR application using ‘develop’ branch took much more memory (Total; 3.1TB) for the same application with JEDI-FV3 v1.1.2 (1TB).  
(don’t know if there are some updates after Jun or additional yaml variables to control memory usages)

 ![Slide12](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/9b91537f7240f0d6f081c9fbe152bae1cea29d71.jpeg)

Thanks,

Jun
