Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Addition of a shared filter infrastructure #522

Conversation

douglasjacobsen
Copy link
Member

This merge introduces an optional filter infrastructure which can be used to share kernels of code that can be used for a variety of purposes. It adds a new module mpas_filter_list which houses function pointers for each filter, and a new tool that can be used to extract filter information from a core's registry file.

Usage of filters within a core is optional, and a core can skip building the filters.

This merge comes with an example filter to test the compute interval functionality. Additionally, a driver is added to help cores that want to use filters share code to have some shared functionality of filters, such as compute intervals.

This commit adds derived types, function pointers, and a filter list
within a core type. These are added to enable support for a filter list
within a core.
@douglasjacobsen douglasjacobsen force-pushed the framework/filter_infrastructure branch 2 times, most recently from bbd2273 to 1df7626 Compare August 18, 2015 16:19
@douglasjacobsen
Copy link
Member Author

@mgduda, @akturner, @matthewhoffman: This PR adds the filter infrastructure.

I only added support for the test core in this PR, but I have a branch that also adds it to the SW core.
https://github.com/douglasjacobsen/MPAS/tree/sw/filter_test

The reason I point you to the branch that uses it within the SW core, is you can actually see what it does with time stepping.

@mgduda: Let me know if the build system stuff is sufficient based on our discussion yesterday. To describe it, I allow a core to specify USE_FILTERS as 'true' or 'false'. If it's 'true' then filters are build and linked, if they are not being used by the core. This allows a core to easily skip over building of filters, though it complicates the build system a bit.

Additionally, I've pulled out the parsing tool to extract filter information into it's own separate tool.

@matthewhoffman
Copy link
Member

@douglasjacobsen , is this the appropriate link for the design doc?
https://docs.google.com/document/d/1lsFepShiSO2slyFSCicx-SAQOIr8IPcARWdEvk1Sul0/edit

@douglasjacobsen
Copy link
Member Author

@matthewhoffman Yes, thanks for linking it.

This commit adds the mpas_filter_list module, which defines functions
for creating, manipulating, using, and destroying a
mpas_filter_list_type list.
This commit adds a new tool within the context of registry parsing to
extract filter information from an existing registry file. It can be
used to generate filter_function.inc, which can be used to define the
filter's for a core.

It parses filter and filter_list blocks from a registry file, with an
example as follows:

    <filters>
        <filter name="test1" module_name="mpas_test_filter1"/>
        <filter name="test2" module_name="mpas_test_filter2"/>
        <filter name="test3" module_name="mpas_test_filter1"/>
    </filters>
    <filters>
        <filter name="test4" module_name="mpas_test_filter2"/>
        <filter name="test5" module_name="mpas_test_filter1"/>
        <filter name="test6" module_name="mpas_test_filter2"/>
    </filters>

    <filter_list name="group1">
        <filter name="test4"/>
        <filter name="test3"/>
        <filter name="test1"/>
    </filter_list>

    <filter_list name="group2">
        <filter name="test5"/>
        <filter name="test2"/>
        <filter name="test6"/>
    </filter_list>
This commit adds filters to the build system in a shared src/filters
directory. Additionally, this commit adds a driver which may be used to
act on lists of filters. It is provided to allow cores to utilize shared
functionality of a driver, without writing their own custom driver, but
is not required to use filters.

This commit also adds an example filter as
mpas_filter_test_compute_interval. This filter can be used to test that
the compute interval portion of the driver works correctly.
This commit adds filter setup / creation to the MPAS driver, to allow
cores that include filters to have them setup automatically.
This commit adds support to the test core for filters. Additionally, it
adds two filters to the test core that test the compute interval of
filters.
@douglasjacobsen
Copy link
Member Author

@mgduda and @matthewhoffman I've pushed updates that make the build system easier to use (and hopefully more extensible).

Let me know if you have any comments / concerns.

@mgduda
Copy link
Contributor

mgduda commented Oct 10, 2015

With ifort 15.0.1, I'm getting the following build error for the test core:

mpif90 -D_MPI -DUNDERSCORE -DCORE_TEST -DMPAS_NAMELIST_SUFFIX=test -DMPAS_EXE_NAME=test_model -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=v4.0-76-g46eb809 -real-size 64 -O3 -convert big_endian -FR -c mpas_filter_driver.F -I/glade/p/work/duda/pio1_9_19/pio -I/glade/apps/opt/pnetcdf/1.6.0/intel/default/include -I/glade/apps/opt/netcdf-mpi/4.3.2/intel/default/include -I/glade/p/work/duda/pio1_9_19/pio -I/glade/apps/opt/pnetcdf/1.6.0/intel/default/include -I/glade/apps/opt/netcdf-mpi/4.3.2/intel/default/include -I/glade/scratch/duda/pull/MPAS/src/filters -I../framework -I../operators
mpas_filter_driver.F(23): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [ESMF]
   use mpas_derived_types
-------^
mpas_filter_driver.F(62): error #6457: This derived type name has not been declared.   [MPAS_FILTER_LIST_TYPE]
      type (mpas_filter_list_type), pointer :: inList
------------^
mpas_filter_driver.F(63): error #6457: This derived type name has not been declared.   [MPAS_POOL_TYPE]
      type (mpas_pool_type), intent(inout) :: packagePool
------------^
...

It seems that adding -I../external/esmf_time_f90 to the list of compilation options avoids the issue.

@matthewhoffman
Copy link
Member

PR closed for now, but an issue has been opened to continue tracking this until active development resumes: #1476

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants