-
Notifications
You must be signed in to change notification settings - Fork 28
Creating mega rdas.x to replace individual executables #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ff64aac
Initial commit to work on mega exe following GDASApp
SamuelDegelia-NOAA c16b0af
First working version - now building through bundle/CMakeLists.txt
SamuelDegelia-NOAA 88b0bf8
Remove old comments
SamuelDegelia-NOAA d09a759
Added bump option to rdas.x
SamuelDegelia-NOAA f86a6ef
Added mpas-jedi and split into rdas_fv3jedi and rdas_mpasjedi exes
SamuelDegelia-NOAA 562a0fc
Got rid of redundant trait argument now that we split into dyncore exes
SamuelDegelia-NOAA 82c71e1
rdas_mpasjedi.cc now more consistent with rdas_fv3jedi.cc
SamuelDegelia-NOAA 35b9b8b
Update ctests for new executable and argument structure
SamuelDegelia-NOAA 003fba8
Updated template scripts for running experiments
SamuelDegelia-NOAA f038dad
Now using 2 nodes for mpas-jedi ctests
SamuelDegelia-NOAA ee89395
No longer using mega exe for ctests or experiment scripts
SamuelDegelia-NOAA 5ce4b3d
Merge branch 'develop' into feature/mega_exe
CoryMartin-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Build the big rdas executable used for all generic JEDI applications | ||
| # -------------------------------------------------------------------- | ||
|
|
||
| #--------------------------------- | ||
|
|
||
| # Standard compiler flags | ||
| set(CMAKE_CXX_STANDARD 17) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CMAKE_CXX_EXTENSIONS OFF) | ||
| set(CMAKE_C_STANDARD 11) | ||
| set(CMAKE_C_STANDARD_REQUIRED ON) | ||
| set(CMAKE_C_EXTENSIONS OFF) | ||
| set(CMAKE_FORTRAN_STANDARD 08) | ||
| set(CMAKE_FORTRAN_STANDARD_REQUIRED ON) | ||
| set(CMAKE_FORTRAN_EXTENSIONS OFF) | ||
|
|
||
| if ( FV3_DYCORE ) | ||
|
|
||
| find_package( fv3jedi REQUIRED ) | ||
| ecbuild_add_executable( TARGET rdas_fv3jedi.x | ||
| SOURCES rdas_fv3jedi.cc | ||
| LIBS fv3jedi | ||
| ) | ||
|
|
||
| endif() | ||
|
|
||
| if ( MPAS_DYCORE ) | ||
|
|
||
| find_package( mpasjedi REQUIRED ) | ||
| ecbuild_add_executable( TARGET rdas_mpasjedi.x | ||
| SOURCES rdas_mpasjedi.cc | ||
| LIBS mpasjedi | ||
| ) | ||
|
|
||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| #include <functional> | ||
| #include <map> | ||
|
|
||
| #include "fv3jedi/ObsLocalization/instantiateObsLocFactory.h" | ||
| #include "fv3jedi/Utilities/Traits.h" | ||
|
|
||
| #include "oops/generic/instantiateModelFactory.h" | ||
| #include "saber/oops/instantiateCovarFactory.h" | ||
| #include "saber/oops/ErrorCovarianceToolbox.h" | ||
| #include "ufo/instantiateObsErrorFactory.h" | ||
| #include "ufo/instantiateObsFilterFactory.h" | ||
| #include "ufo/ObsTraits.h" | ||
|
|
||
| #include "oops/runs/ConvertState.h" | ||
| #include "oops/runs/HofX4D.h" | ||
| #include "oops/runs/LocalEnsembleDA.h" | ||
| #include "oops/runs/Run.h" | ||
| #include "oops/runs/Variational.h" | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| template<typename Traits> | ||
| int runApp(int argc, char** argv, const std::string appName) { | ||
|
|
||
| // Create the Run object | ||
| oops::Run run(argc, argv); | ||
|
|
||
| // Instantiate oops factories | ||
| oops::instantiateModelFactory<Traits>(); | ||
|
|
||
| // Instantiate saber factories | ||
| saber::instantiateCovarFactory<Traits>(); | ||
|
|
||
| // Intantiate ufo factories | ||
| ufo::instantiateObsErrorFactory(); | ||
| ufo::instantiateObsFilterFactory(); | ||
|
|
||
| // Localization for ensemble DA | ||
| if (appName == "localensembleda") { | ||
| fv3jedi::instantiateObsLocFactory(); | ||
| } | ||
|
|
||
| // Application pointer | ||
| std::unique_ptr<oops::Application> app; | ||
|
|
||
| // Define a map from app names to lambda functions that create unique_ptr to Applications | ||
| std::map<std::string, std::function<std::unique_ptr<oops::Application>()>> apps; | ||
|
|
||
| apps["convertstate"] = []() { | ||
| return std::make_unique<oops::ConvertState<Traits>>(); | ||
| }; | ||
| apps["bump"] = []() { | ||
| return std::make_unique<saber::ErrorCovarianceToolbox<Traits>>(); | ||
| }; | ||
| apps["hofx4d"] = []() { | ||
| return std::make_unique<oops::HofX4D<Traits, ufo::ObsTraits>>(); | ||
| }; | ||
| apps["localensembleda"] = []() { | ||
| return std::make_unique<oops::LocalEnsembleDA<fv3jedi::Traits, ufo::ObsTraits>>(); | ||
| }; | ||
| apps["variational"] = []() { | ||
| return std::make_unique<oops::Variational<Traits, ufo::ObsTraits>>(); | ||
| }; | ||
|
|
||
| // Create application object and point to it | ||
| auto it = apps.find(appName); | ||
|
|
||
| // Run the application | ||
| return run.execute(*(it->second())); | ||
| } | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| int main(int argc, char ** argv) { | ||
| // Check that the number of arguments is correct | ||
| // ---------------------------------------------- | ||
| ASSERT_MSG(argc >= 2, "Usage: " + std::string(argv[0]) + " <application> <options>"); | ||
|
|
||
| // Get the application to be run | ||
| std::string app = argv[1]; | ||
| for (char &c : app) {c = std::tolower(c);} | ||
|
|
||
| // Check that the application is recognized | ||
| // ---------------------------------------- | ||
| const std::set<std::string> validApps = { | ||
| "convertstate", | ||
| "bump", | ||
| "hofx4d", | ||
| "localensembleda", | ||
| "variational" | ||
| }; | ||
| ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); | ||
|
|
||
| // Remove program from argc and argv | ||
| // -------------------------------------------- | ||
| argv[1] = argv[0]; // Move executable name to second position | ||
| argv += 1; // Move pointer up two | ||
| argc -= 1; // Remove 1 from count | ||
|
|
||
| // Call application specific main functions | ||
| // ---------------------------------------- | ||
| fv3jedi::instantiateObsLocFactory(); | ||
| return runApp<fv3jedi::Traits>(argc, argv, app); | ||
| } | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| #include <functional> | ||
| #include <map> | ||
|
|
||
| #include "oops/generic/instantiateModelFactory.h" | ||
| #include "saber/oops/instantiateCovarFactory.h" | ||
| #include "saber/oops/ErrorCovarianceToolbox.h" | ||
| #include "saber/oops/instantiateLocalizationFactory.h" | ||
| #include "ufo/instantiateObsErrorFactory.h" | ||
| #include "ufo/instantiateObsFilterFactory.h" | ||
| #include "ufo/instantiateObsLocFactory.h" | ||
| #include "ufo/ObsTraits.h" | ||
|
|
||
| #include "oops/runs/ConvertState.h" | ||
| #include "oops/runs/HofX4D.h" | ||
| #include "oops/runs/LocalEnsembleDA.h" | ||
| #include "oops/runs/Run.h" | ||
| #include "oops/runs/Variational.h" | ||
| #include "mpasjedi/Traits.h" | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| template<typename Traits> | ||
| int runApp(int argc, char** argv, const std::string appName) { | ||
|
|
||
| // Create the Run object | ||
| oops::Run run(argc, argv); | ||
|
|
||
| // Instantiate oops factories | ||
| oops::instantiateModelFactory<Traits>(); | ||
|
|
||
| // Instantiate saber factories | ||
| saber::instantiateCovarFactory<Traits>(); | ||
|
|
||
| // Intantiate ufo factories | ||
| ufo::instantiateObsErrorFactory(); | ||
| ufo::instantiateObsFilterFactory(); | ||
|
|
||
| // Localization for ensemble DA | ||
| if (appName == "localensembleda") { | ||
| ufo::instantiateObsLocFactory<Traits>(); | ||
| } | ||
|
|
||
| // Localization for variational DA | ||
| if (appName == "variational") { | ||
| saber::instantiateLocalizationFactory<Traits>(); | ||
| } | ||
|
|
||
| // Intantiate ufo factories | ||
| ufo::instantiateObsErrorFactory(); | ||
| ufo::instantiateObsFilterFactory(); | ||
|
|
||
| // Application pointer | ||
| std::unique_ptr<oops::Application> app; | ||
|
|
||
| // Define a map from app names to lambda functions that create unique_ptr to Applications | ||
| std::map<std::string, std::function<std::unique_ptr<oops::Application>()>> apps; | ||
|
|
||
| apps["convertstate"] = []() { | ||
| return std::make_unique<oops::ConvertState<Traits>>(); | ||
| }; | ||
| apps["bump"] = []() { | ||
| return std::make_unique<saber::ErrorCovarianceToolbox<Traits>>(); | ||
| }; | ||
| apps["hofx4d"] = []() { | ||
| return std::make_unique<oops::HofX4D<Traits, ufo::ObsTraits>>(); | ||
| }; | ||
| apps["localensembleda"] = []() { | ||
| return std::make_unique<oops::LocalEnsembleDA<mpas::Traits, ufo::ObsTraits>>(); | ||
| }; | ||
| apps["variational"] = []() { | ||
| return std::make_unique<oops::Variational<Traits, ufo::ObsTraits>>(); | ||
| }; | ||
|
|
||
| // Create application object and point to it | ||
| auto it = apps.find(appName); | ||
|
|
||
| // Run the application | ||
| return run.execute(*(it->second())); | ||
| } | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- | ||
|
|
||
| int main(int argc, char ** argv) { | ||
| // Check that the number of arguments is correct | ||
| // ---------------------------------------------- | ||
| ASSERT_MSG(argc >= 2, "Usage: " + std::string(argv[0]) + " <application> <options>"); | ||
|
|
||
| // Get the application to be run | ||
| std::string app = argv[1]; | ||
| for (char &c : app) {c = std::tolower(c);} | ||
|
|
||
| // Check that the application is recognized | ||
| // ---------------------------------------- | ||
| const std::set<std::string> validApps = { | ||
| "convertstate", | ||
| "bump", | ||
| "hofx4d", | ||
| "localensembleda", | ||
| "variational" | ||
| }; | ||
| ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); | ||
|
|
||
| // Remove program from argc and argv | ||
| // -------------------------------------------- | ||
| argv[1] = argv[0]; // Move executable name to second position | ||
| argv += 1; // Move pointer up two | ||
| argc -= 1; // Remove 1 from count | ||
|
|
||
| // Call application specific main functions | ||
| // ---------------------------------------- | ||
| return runApp<mpas::Traits>(argc, argv, app); | ||
| } | ||
|
|
||
| // ------------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.