Giter Club home page Giter Club logo

fortrilinos's Introduction

Trilinos

Trilinos Logo

Website | Documentation | Mailing List | Packages

OpenSSF Scorecard

The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems. A unique design feature of Trilinos is its focus on packages.

Documentation

License

Trilinos is licensed on a per-package basis. Most packages are now under a BSD license, some are published under the (L)GPL. Details can be taken from the documentation of each package. See COPYRIGHT, LICENSE, https://trilinos.github.io/license.html and individual package, directory and/or file headers for additional information.

Contributing

We appreciate your willingness to contribute to the Trilinos project. Please familiarize yourself with our contributing guidelines.

fortrilinos's People

Contributors

alanw0 avatar aprokop avatar bartlettroscoe avatar bradking avatar jhux2 avatar jwillenbring avatar kevans32 avatar kmorris3 avatar kruger avatar mark-e-hamilton avatar micheldemessieres avatar nschloe avatar sethrj avatar sfilippone avatar tjfulle avatar xlxif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fortrilinos's Issues

Framework: enable CI testing

This issues is to track status of Jenkins CI testing.

  • Create a Docker container with Trilinos TPL similar to how DTK does it
  • Make sure tests pass in the container
  • Hook up Jenkins CI with Github
  • Configure Jenkins to launch CI on PR

What default header for ForTrilinos should we use?

Should it be this the standard header for Trilinos

!*********************************************************************
! ForTrilinos: Object-Oriented Fortran 2003 interface to Trilinos
!                Copyright 2010 Sandia Corporation
!
! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
! the U.S. Government retains certain rights in this software.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
!
! 1. Redistributions of source code must retain the above copyright
!    notice, this list of conditions and the following disclaimer.
!
! 2. Redistributions in binary form must reproduce the above copyright
!    notice, this list of conditions and the following disclaimer in the
!    documentation and/or other materials provided with the distribution.
!
! 3. Neither the name of the Corporation nor the names of the
!    contributors may be used to endorse or promote products derived from
!    this software without specific prior written permission.
!
! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!
! Questions? Contact 
!                    Andrey Prokopenko <email>
!                    Seth Johnson <email>
!                    Mitch Young <email>
!*********************************************************************

(and similar for C++ proxy?)

Wrap Tpetra

A meta-issue to collect all Tpetra wrapper issues.

Add simple interface for Eigen solvers

This will be a little more difficult than the linear solvers that are currently in the TrilinosHandle class, since there is no abstraction layer like Stratimikos sitting on top of Anasazi. For a user to be able to select the type of SolverManager to use, we will need some scaffolding to handle that.

I guess another question would be how this will interact with the existing TrilinosHandle code. Should we modify TrilinosHandle to have Eigen solver capability, or should we make a separate class to handle Eigensolvers?

Status of CTrilinos/ForTrilinos?

I tried to symlink these two repos into my trilinos/packages directory and added the -D Trilinos_ENABLE_CTrilinos=ON and -D Trilinos_ENABLE_ForTrilinos=ON to my configure script but the variables were not used by cmake.
Where can I find instructions on how to build these two packages?

FY18Q4 milestone: Complete initial development of Phase 2 features

Description
implement and test the new features planned for inclusion within Phase 2 ForTrilinos

Plan

  • Implement test of IOC features
  • Implement test of memory transfer

Criteria
Code that successfully demonstrates all the mechanisms required for full Phase 2 implementation

Mikado

Nico Schlomer has a Mikado repo that provides a simple interface to Trilinos. I wonder if we can leverage some of that for simple drivers in ForTrilinos.

FY18Q2 milestone: Complete and prototype mechanism for C++ calling Fortran inversion of control

Description
Design the plan to allow the codes to have custom routines within Fortran to be called by the Trilinos C++ code

Plan

  • Display and document what the Fortran codes have done in the past to perform custom callbacks from C++ interfaces to the Fortran
  • Outline range of options to enable an automated IOC via ForTrilinos
  • Decide and document the plan

Criteria
Code that successfully demonstrates the use of IOC on the target code within the ForTrilinos repository

FY19Q2 milestone: Complete performance assessment of key solver kernels on heterogeneous platforms

Description
Assess performance of key kernels such as sparse matrix multiplication, multigrid smoothers on pre-Exascale test platforms.

Plan

  • Assess the performance of the interface between Fortran and Trilinos
  • Investigate bottlenecks associated with data transfers
  • Run studies on Summit/Sierra platforms

Criteria
Informal report characterizing the performance, developing a strategy for improving the performance

FY19Q1 milestone: Complete Phase 2 ForTrilinos release

Description

Plan

  • Write necessary code to expand initial results from previous tests
  • Apply tests to target code and verify they work

Criteria
Code committed to ForTrilinos master repository, write up phase 1 results for proceedings/journal

Using long macros seem to exceed 132 character line length

@sethrj @youngmit @bscollin

I did a quick attempt at using flang with ForTrilinos. It compiles the source just fine, but is getting stuck in tests with the following errors all over the place:

F90-S-0285-Source line too long

It seems that Fortran 2003 standard limits the number of characters in a line to 132 in the free form (and to 72 in fixed). It would be fine with continuation lines, but I think the macros in the test (like EXPECT_EQ) are assembled in a single line that exceeds the length.

My question is: is using long macros standard-compliant? Or is it just a feature that ifort/gfortran support?

Remove old stale branches

@bmpersc @jwillenbring @trilinos/framework

In the ForTrilinos repo we have old branches that may have been migrated during the move to github but have nothing to do with the ForTrilinos repo:

  • tribits_github_snapshot
  • panzer_stk_conversion

Can we remove those?

Decide on a set of mini-apps to test ForTrilinos functionality

It is a good idea to have a set of different mini-codes (whatever we call them, proxy apps/mini-apps/micro-apps/examples) to test the functionality without requiring a full-blown codebase (like CAM/VERA/etc).

We can probably take some of the already written C++ mini-apps and convert them to Fortran. Some ideas:

  • Tpetra tutorial examples
  • Other examples in Trilinos (maybe Ifpack2? Belos?)
  • Mini-app based on VERA
    Take output matrices from VERA to create a mini app of the eigenvalue solver. They have this already in C to test the trilinos solver before putting into VERA. The dumped matrix is available.
  • Shallow water matrix from CAM to use for linear and nonlinear solver, IOC or use C++ examples from Albany CISM and CAM to compare kernels
  • HPCG

Goal: unit testing and to look at performance of mini-app with Trilinos versus Fortrilinos example.

F17Q4 milestone: Complete tools and processes assessment to leverage Trilinos from Fortran

Description
Based on the needs of the target Fortran codes, determine the tools and processes necessary to create the capabilities within Phase 1 ForTrilinos

Plan

  • Decide on C++ intrinsics that are needed to support the Fortran interface (e.g. functions, classes, inheritance, templates)
  • Determine which Trilinos packages and classes are needed for initial ForTrilinos to support MPACT and CAM
  • Assess feasibility of using PyTrilinos SWIG wrappers for construction of ForTrilinos SWIG interface files

Completion
Prioritized list of functionalities to provide as part of Phase 1 and 2

License

  1. What is ForTrilinos license?
  2. Are all files licensed the same?
  3. Should ForTrilinos version 2 have the same license?

Branch out older version prior to development of a new one

  • Create v1 version branch
  • Make clear in documentation and on front page README that the old v1 version is unstable and the master branch is for development
  • Document the current testing status
  • Make sure the test pass so that we are able to enable CI

FY19Q4 milestone: Develop and release phase 3 of ForTrilinos

Description
Develop, test, and release phase 3 of ForTrilinos, with the capability to maintain data structures across the application and Trilinos

Plan

  • Develop initial features to be included in phase 3
  • apply tests to target code
  • finalize and release phase 3 of For Trilinos

Criteria
Release of ForTrilinos tag with phase 3 features to master

Tpetra's plan to get rid of dynamic graphs

During CSE17 I was told that Tpetra is going away from the dynamic graph allocations. I think that for ForTrilinos this means that we should not port any functionality that does that. This would definitely include Tpetra::CrsGraph and Tpetra::CrsMatrix. Possibly something else. This would make the Tpetra's implementation quite lean. However, it is unclear to me at this point how we are going to provide access to Kokkos::CrsMatrix and such.

Restrict SWIG directives to files

Right now, forteuchos.i looks something like this:

%module forteuchos
%include "file1.i"
%include "file2.i"

The problem with this is directives in file1.i are also applied to files2.i. For example, a general %ignore remove; in file1.i would also ignore all remove in file2.i.

This behaviour is unexpected, and wrong. We need to figure out the right way to approach things.

MAKE_SWIG should rebuild when any of included .i files is updated

Currently, in developer mode, make will call swig to regenerate the wrapper files only if the file it has as SOURCE is updated. Otherwise, it does not.

To give a specific example, lets say we have forteuchos.i with the following content:

%module forteuchos
%include Teuchos_RCP.i

and our CMakeLists.txt has

  MAKE_SWIG(MODULE forteuchos
    SOURCE forteuchos.i
    EXTRASRC ${EXTRA_SOURCE}
    )

Any changes in Teuchos_RCP.i in this case will not be automatically rebuilt until forteuchos.i is touched.

Decide on unit test framework

Variants so far:

  1. @sethrj started with DBCF
  2. ForTrilinos v1 has unit test framework that reminds general Trilinos.

I'm leaning towards picking up pieces of v1 framework

Create a shortcut approach to using Trilinos

While the eventual goal is to expose a significant portion of Trilinos functionality to Fortran applications, it is a good idea to expose the potential applications to the benefits of Trilinos as early as possible.

The idea is to provide a minimal interface (not existing in Trilinos proper at this point) which would solve a linear systems given few Fortran arrays with data corresponding to matrix and vector, a communicator, and a parameter list. Something like this (on C++ side):

int solve_linear_system(
  MPI_Comm comm,
  const int * row_ptrs, int num_rows,
  const int * col_inds, int num_values 
  const double * vals, int num_values,
  const double * rhs, int size,
  double * sol, int size,
  const ParameterList* list);

Not all sizes are necessary, but it makes it easier to convert from Fortran.

On the C++ side we wrap the data in the proper Trilinos classes (and constructing missing ones like Map), and pass it to Stratimikos.

Test ForTrilinos installation

So far, we've only been running tests within ForTrilinos build. We need to check that the result for make install and an external driver works. This will also provide a good example of how to link against ForTrilinos.

Framework: Regenerate wrapper files for changed typemaps

At the moment, the wrapper files in ForTrilinos source are regenerated only if .i file have changed. However, this breaks down if we simultaneously develop SWIG which updates the .swg typemaps and such. In my case, my ForTrilinos is configured to depend on swig in ~/local/opt/swig. I install it there manually through running make install in the swig directory. However, newly installed files are not picked up automatically thus wrapper files are not regenerated.

One workaround I can think of is to configure CMake to point to the sources of SWIG somehow.

@sethrj Can you share your workflow? I noticed that you did not run make install yourself.

F18Q1 milestone: complete phase 1 ForTrilinos release

Description

Plan

  • Extend SWIG to create Fortran wrappers for C++ code with production-level reliability
  • Create initial SWIG interface files to Trilinos packages
  • Create basic suite of functions and tools to access Trilinos with Fortran calls
  • Implement and test within MPACT
  • Release as part of github repo of ForTrilinos

Criteria
Phase 1 is successfully implemented within a test case of the MPACT code. New ForTrilinos code shipped with the main Trilinos code. Pull request of SWIG/Fortran submitted to mainline SWIG development.

Investigate IoC

The Inversion of Control in Futility is organized as follows.

User create some subroutine, for example

    SUBROUTINE testcalcResid() BIND(C)
      !Do some matvec
    ENDSUBROUTINE testcalcResid

This function is passed through a proxy by using C_FUNLOC:

call JFNK_Init(C_FUNLOC(testcalcResid), ...)

JFNK_Init has the following prototype:

    subroutine JFNK_Init(fptr,...) bind(C,NAME="JFNK_Init")
      IMPORT :: C_FUNPTR
      TYPE(C_FUNPTR),INTENT(IN),VALUE :: fptr
      ...
    endsubroutine

with a corresponding C interfaces:

extern "C" void JFNK_Init(int &id, void (*funptr)(), const int idx,
                          const int idF) {
    id = jfnk->new_data(funptr, evec->get_vec(idx), evec->get_vec(idF));
}

eventually ending in

class ModelEvaluator_JFNK : public NOX::Epetra::Interface::Required {
public:
ModelEvaluator_JFNK(void (*functionptr)(),Teuchos::RCP<Epetra_Vector> x, Teuchos::RCP<Epetra_Vector> F){
    fptr=functionptr;
    xloc=x;
    Floc=F;
}

...

bool computeF(const Epetra_Vector& x,
              Epetra_Vector& f,
              NOX::Epetra::Interface::Required::FillType)
    {
      // Residual calculation
      *xloc = x;
      fptr();
      f = *Floc;
      return true;
    }
private:
    void (*fptr)() = NULL;
    ...
};

Update ForTrilinos CMake configuration to just store and compile instead of auto-generating

We need to store generated files in the ForTrilinos directory, so that
the users don't need to build them themselves (they may not have
access to SWIG).

  • Should we make it optional? Like a CMake switch between generating
    files, and storing them?
  • MAKE_SWIG is useful for generating, but is not useful for storing
  • How can we make sure that the updated files are being regenerated?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.