-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a standalone
This short tutorial describes the main steps required to create (or update) a standalone from ICON using the scripts provided in eniac-scripts/standalones.
For this tutorial, a standalone for the nsurf_diag routine in atm_phy_echam/mo_surface_diag.f90 will be created.
- Clone the
icon-eniac.gitrepository
#$> git clone --recursive [email protected]:C2SM-RCM/icon-eniac.git
- Clone the
eniac-scripts.gitrepository inside icon-eniac
#$> cd icon-eniac/
#$> git clone [email protected]:C2SM-RCM/eniac-scripts.git
- Change into
eniac-scripts/standalones
#$> cd eniac-scripts/standalones/
- Create a new directory under
standalonesand initialize it with the scripts from the template. The name of the subroutine used to create the standalone has to be used. A simple script is provided to generate the main scripts based on a template.
#$> ./common/init_new_standalone.sh nsurf_diag mo_surface_diag atm_phy_echam nsurf_diag
- If the standalone does not require the dynamical code, disable existing OpenACC statements.
#$> ln -rs common/noacc_list.txt nsurf_diag/
- Create a list of external dependencies, one path per line, in a file named
external_dependencies.txt
#$> echo "externals/mtime" >> nsurf_diag/external_dependencies.txt
- Move back into the root of
icon-eniac.git
#$> cd ../..
- If you're creating a new standalone or you need to update intermediate patches, use the interactive mode. The following steps assume this is the case.
#$> export ENIAC_INTERACTIVE=1
- Start the extraction script providing the machine you're running on (Kesch or Daint).
#$> ./eniac-scripts/standalones/nsurf_diag/extract_standalone.sh kesch
-
Step 1: clones the FTG tools and configures them to use a modified
icon_standalonetemplate. -
Step 2: applies all the patches found in
nsurf_diag/patches/extract/init -
Step 3: configure and build icon and generate the capture code with FTG.
-
If Step 2 or 3 was successful continue with next step. Otherwise, fix the compilation errors, generate the new patches and update the
eniac-scripts.gitrepository.
#$> (fix errors)
#$> ./eniac-scripts/standalones/nsurf_diag/generate_patches.sh kesch extract init
#$> (replace patches in eniac-scripts/standalones/nsurf_diag/patches/extract/init with new version from eniac_patches/extract/init)
#$> /eniac-scripts/standalones/nsurf_diag/extract_standalone.sh kesch # skip steps until Step 3
-
Step 4: applies all the patches found in
nsurf_diag/patches/extract/intermezzo -
Step 5: configure and build ICON and generate the replay code with FTG.
-
If Step 4 or 5 was successful continue with next step. Otherwise, fix the compilation errors, generate the new patches and update the
eniac-scripts.gitrepository.
#$> (fix errors)
#$> ./eniac-scripts/standalones/nsurf_diag/generate_patches.sh kesch extract intermezzo
#$> (replace patches in eniac-scripts/standalones/nsurf_diag/patches/extract/intermezzo with new version from eniac_patches/extract/intermezzo)
#$> /eniac-scripts/standalones/nsurf_diag/extract_standalone.sh kesch # skip steps until Step 5
-
Step 6: applies all the patches found in
nsurf_diag/patches/extract/finish -
If Step 6 was successful continue with next step. Otherwise, fix the compilation errors, generate the new patches and update the
eniac-scripts.gitrepository.
#$> (fix errors)
#$> ./eniac-scripts/standalones/nsurf_diag/generate_patches.sh kesch extract intermezzo
#$> (replace patches in eniac-scripts/standalones/nsurf_diag/patches/extract/intermezzo with new version from eniac_patches/extract/intermezzo)
#$> /eniac-scripts/standalones/nsurf_diag/extract_standalone.sh kesch # skip steps until Step 5
-
Step 7: extracts a minimal standalone and copies required files into
standalone/nsurf_diag. -
Step 8: reset
icon-eniac.gitrepository to starting state. Newly createdstandalone/nsurf_diagand if producedeniac_patchesdirectories are left in repository. -
Step 9: generate patches required to create reference data and run the standalone validation. The patches are stored in
standalone/nsurf_diag/eniac_patches. -
Replace the patches in
eniac-scripts/standalones/nsurf_diag/patches/run/with the new versions instandalone/nsurf_diag/eniac_patches -
Copy the FTG standalone executable in
standalone/nsurf_diag/src/tests/ftg_nsurf_diag_test.f90toeniac-scripts/standalones/nsurf_diag/src/tests. -
Generally the patches required for running the validation test and generating the serialization data are the same. All the patches in
eniac-scripts/standalones/nsurf_diag/patches/referencewill be applied.
#$> cd eniac-scripts/standalones/nsurf_diag
#$> ln -sr patches/run patches/reference
#$> cd ../../../
- Commit the changes to the
eniac-scripts.gitrepository and push to GitHub.
- SLURM submission credentials and partition can be overwritten by exporting
SBATCH_ACCOUNT andSBATCH_PARTITION`
#$> export SBATCH_ACCOUNT=g110
#$> export SBATCH_PARTITION=debug
- Run the
create_reference.shscript to generate reference data for different values of nproma. The values used to generate the data is read from thenproma_list.txtfile (default setup runsnproma = 16, 2729, 20480). The following command used GCC as a compiler and runs the CPU version on Kesch.
#$> ./eniac-scripts/standalones/nsurf_diag/create_reference.sh kesch gcc cpu
-
The new serialization data is stored in
experiments/atm_amip_test/ftg. Current version of the serialization data is stored under/project/c14/data-eniac/standalones/nsurf_diag. -
The directory
/project/c14/data-eniac/standalones/nsurf_diag/experiments/atm_amip_testcontains other files required to run the standalone (generally an empty directory).
- SLURM submission credentials and partition can be overwritten by exporting
SBATCH_ACCOUNT andSBATCH_PARTITION`
#$> export SBATCH_ACCOUNT=g110
#$> export SBATCH_PARTITION=debug
- Run the
run_standalone_test.shscript in order to perform a validation run of the standalone against known reference data.
#$> ./eniac-scripts/standalones/nsurf_diag/run_standalone_test.sh kesch gcc cpu /project/c14/data-eniac/standalones/nsurf_diag
- The results from Serialbox2's
compare.pyare summarized on standard output. The full validation output is stored in theexperiments/atm_amip_test/validation_nproma_###.resultfiles. The output data from the standalone is stored inexperiments/atm_amip_test/ftgand the input data and output reference data are copied (rsync'd) to${SCRATCH}/data/icon-eniac/sa_nsurf_diag/ftg/gcc/kesch/nproma_###.