Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These instructions assume you have already ported E3SM to your machine (you have it defined in config_machines.xml and can build and run cases.)

There are several Almost all dependencies that are in general optional for MOAB but are required for MOAB-in-E3SM. Features and tools needed within MOAB will get automatically built and enabled based on the dependencies when configuring the MOAB library.

  • MPI: MOAB supports both MPICH- and OpenMPI-based libraries configured externally to enable scalable mesh manipulation algorithms. Needed Required dependency for the MOAB-coupler. ( If you were to build without Without MPI, only a serial version of MOAB would resultwill be built.) Use the same library you use for MPI library/wrappers as E3SM.

  • Parallel-NetCDF: MOAB library uses parallel-NetCDF (pnetcdf) library directly for parallel read of reading NetCDF (v3) meshes in parallel and linear map weight files (for instance the r2o map. The rest are calculated online)). All other component maps are generally calculated online by the MOAB coupler. Use the same one you built for PNetCDF library as E3SM.

  • Zoltan: Support for online or offline partitioning through Zoltan (and its dependencies on Scotch, ParMetis etcoptionally configured with dependency on ParMetis/Metis) can be utilized through with the MOAB partitioner tool and at runtime (mbpart). The runtime partitioning can be invoked with appropriate file read options (PARTITION_METHOD=RCBZOLTAN;). This dynamic rebalancing is important to achieve good scalability when reading nc files . Currently you have to download and build Zoltan on your own but we are fixing thatin parallel. For MOAB-E3SM workflows, this is a recommended dependency.

  • TempestRemap: Provides support for both offline and online remapping of Climate field data on unstructured spherical meshes. MOAB’s build will download and build TempestRemap if you have not done it separately. The offline remapping weights can be generated using the mbtempest tool. Refer to Offline remapping workflow with mbtempest for more details. For MOAB-E3SM workflows, this is a required dependency.

  • Eigen3: A substitute for BLAS/LAPACK interfaces . Required (if not available locally). This is a required dependency for MOAB when calculating weights with TempestRemap as we store the SparseMatrix linear map internally on every task and perform SpMV using the Eigen3 data-structures and apply the map with those structures. MOAB’s build will download and build Eigne3 if you have not done it separatelyinterfaces. For MOAB-E3SM workflows, this is a required dependency.

Optional dependencies (not needed to run the default moab MOAB coupler)

  • Metis/ParMetis: MOAB can optionally use the Metis or ParMetis library for partitioning mesh files in an offline form through MOAB’s mbpart tool. This may be useful to pre-partition the mesh apriori in offline remapping workflows, especially when using Metis KWAY graph partitioning algorithm (MPAS).

  • HDF5: MOAB uses a native HDF5-based file format to represent the entire MOAB data model and this is the original input/output recommended interface and format for scalable I/O of MOAB meshes and associated data. If MPI is enabled, HDF5 should be built with parallel support. HDF HDF5 support allows you to output any E3SM state maintained by MOAB in MOAB h5m files, which are tremendously useful in debugging as they can be directly visualized with Visit VisIt using the MOAB plugin (on a sphere and with the exact mesh). If you built HDF5 for E3SM (with parallel support), use that one to enable HDF5 support in the MOAB configureconfiguration.

  • NetCDF: MOAB library optionally depends on the NetCDF libraries (-C) libraries to compile the ExodusII reader/writer. If MPI is enabled, then the underlying HDF5 dependency for NetCDF should have parallel support i.e., serial HDF5 dependency will not pass internal configuration checks. If you built it the NetCDF library for E3SM, consistently use that one installation to enable NetCDF support in the MOAB configure.

Configuring and building MOAB from source

...

Currently, both CMake and Autotools are maintained simultaneously to support all platforms (including Windows). In this section, we will focus only on the autotools configuration system as this remains the most tested configuration approach for nowat the moment. In the future (FY24Q3/4), we will deprecate the autotools configuration system and use the CMake-based approach instead as the default. When this happens, the instructions will be updated accordingly.

...

(Below use the same compiler, MPI and mpi and I/O libraries you have set up for E3SM. If you have mutiple multiple compiler-mpi MPI options, you would will need to build MOAB for each compiler family with corresponding TPL dependencies.)

  • Override default compilers with environment variables or configure-time options with the compilers you use for E3SM: CC, CXX, FC, F77

  • For the MPI installed for E3SM, use --with-mpi=$MPI_DIR

  • For the PNetCDF installed, use --with-pnetcdf=$PNETCDF_DIR (if you built NetCDF4 and HDF5, add

  • To simplify the process of building MOAB along with its dependencies, we currently offer a workflow to automatically pull the TPL sources and build it on the machine. These packages will be installed in the same location as the specified MOAB prefix (INSTALL_DIR).

Dependency

Pre-built Configuration

Auto-download Configuration

Zoltan

--with-

...

zoltan=

...

$ZOLTAN_DIR

--download-zoltan

Eigen3

--with-

...

eigen3=

...

$EIGEN3_INCLUDE_DIR

...

...

--

...

download-eigen3

TempestRemap

--with-tempestremap=$TEMPESTREMAP_DIR

...

For Eigen3….

--download-tempestremap

  • If you built NetCDF4 and HDF5, add --with-hdf5=$HDF5_DIR --with-netcdf=$NETCDF_DIR

  • Execute the configure script with desired configuration options either in-source or out-of-source (recommended) build directory. A typical MOAB configuration command with all TPLs enabled for E3SM might look like the one shown below, where $PACKAGE_DIR indicates the location of the installation prefix for the particular TPL package.

    Code Block
    $MOAB_SRC/configure CC=$E3SM_MPI_DIR/bin/mpicc \
                        CXX=$E3SM_MPI_DIR/bin/mpicxx \
                        FC=$E3SM_MPI_DIR/bin/mpif90 \
                        F77=$E3SM_MPI_DIR/bin/mpif77 \
                        --prefix=$MOAB_INSTALL_DIR \
                        --enable-debug --enable-optimize \
                        --with-mpi=$MPI$E3SM_MPI_DIR \
                        --with-eigen3hdf5=$EIGEN3$E3SM_INCLUDEHDF5_DIR \
                        --with-hdf5netcdf=$HDF5$E3SM_NETCDF_DIR \
                        --with-netcdfpnetcdf=$NETCDF$E3SM_PNETCDF_DIR \
                        --with-pnetcdfeigen3=$PNETCDF$EIGEN3_INCLUDE_DIR \
                        --with-tempestremap=$TEMPESTREMAP_DIR \
                        --with-zoltan=$ZOLTAN_DIR 

However, if external libraries like Eigen3, TempestRemap, and Zoltan are to be auto-downloaded and configured dynamically, then one can use the following command.

Code Block
$MOAB_SRC/configure CC=$E3SM_MPI_DIR/bin/mpicc \
                    CXX=$E3SM_MPI_DIR/bin/mpicxx \
                    FC=$E3SM_MPI_DIR/bin/mpif90 \
                    F77=$E3SM_MPI_DIR/bin/mpif77 \
                    --prefix=$MOAB_INSTALL_DIR \
                    --enable-debug --enable-optimize \
                    --with-mpi=$E3SM_MPI_DIR \
                    --with-hdf5=$E3SM_HDF5_DIR \
                    --with-netcdf=$E3SM_NETCDF_DIR \
                    --with-pnetcdf=$E3SM_PNETCDF_DIR \
                    --download-eigen3 \
                    --download-tempestremap \
                    --download-zoltan 

Once configuration with the autotools configuration workflow is complete in the build directory, run the following commands to build the library and verify the build.

...

If you experience any issues during the configuration or linking phases of MOAB, please email the mailing list: moab-dev@mcs.anl.gov , or contact Vijay M , Iulian Grindeanu or #coupler on Slack for additional help.

Once you have verified MOAB has been built correctly, you need to tell update the CIME machine config that it is available.Edit configuration to specify the MOAB_ROOT (point to the installation prefix).

Next, edit the entry for your machine in config_machines.xml and and lines like the following (taken make changes like below (example from pm-cpu configuration)

Code Block
<environment_variables compiler="intel">
  <env name="MOAB_ROOT">$SHELL{if [ -z "$MOAB_ROOT" ]; then echo /global/cfs/cdirs/e3sm/software/moab/intel; else echo "$MOAB_ROOT"; fi}</env>
</environment_variables>

Replace the In the above example, replace the MOAB_ROOT path with the path to your MOAB installinstallation prefix directory. In the above case, MOAB was built for multiple compilers so “intel” is in the path and there’s another entry for “gnu” on Perlmutter.

After you’ve built MOAB and modified config_machines.xml, you can try building and running a case.

...

Code Block
./create_newcase --case Wne4mbtest --res ne4pg2_oQU480 --compset WCYCL1850NS --driver moab

You can add --driver moab” moab to any B or F case at this time.

...

MOAB comes pre-built as part of a conda package to use offline tools like mbtempest. DO NOT use the conda installation of MOAB for the MOAB coupler in E3SM as often the preinstalled package will be suboptimal for the cluster or machine in use. However, such installations are useful for offline remapping (mbtempest) and computational analysis workflows (with Python interfaces) using MOAB (and pyMOABPyMOAB).

Once you have a conda environment setup, use the command below to install MOAB with TempestRemap enabled (with or without MPI).

...