Giter VIP home page Giter VIP logo

permon's Introduction

PERMON toolbox

PERMON (Parallel Efficient Robust Modular Object Numerical) is a software toolbox for the scalable (parallel) solution of quadratic programming (QP) problems based on PETSc. It also includes domain decomposition methods (FETI and Total FETI) and Support Vector Machines (SVM) machine learning methods.

Project homepage: http://permon.vsb.cz

PERMON contains following modules:

  • PermonQP - this repository
    • solvers and routines for solution of QP problems
    • constrained (Total) FETI domain decomposition methods able to solve contact problems
  • PermonSVM - SVM machine learning implementation based on PermonQP - separate repository

Please use GitHub for issues and pull requests.

Quick guide to PERMON installation

  1. set environment variables PETSC_DIR and PETSC_ARCH pointing to a PETSc instance

    • PETSC_ARCH is empty in case of "prefix" PETSc installation
    • for more details about PETSc installation and the two environment variables, see PETSc documentation
  2. set PERMON_DIR variable pointing to the PERMON directory (probably this file's parent directory)

  3. build PERMON simply using makefile (makes use of PETSc buildsystem):

    make

  4. if the build is successful, there is a new subdirectory named $PETSC_ARCH, the program library is $PETSC_ARCH/lib/libpermon.{so,a}

    • shared library (.so) is built only if PETSc has been configured with option --with-shared-libraries
    • all compiler settings are inherited from PETSc

Documentation and examples

The documentation of the routines is available at http://permon.vsb.cz/documentation.htm. There are several examples in the tutorials directory illustrating the basic usage of both modules.

Supported PETSc versions

PERMON tries to support newest versions of PETSc as soon as possible. The releases are tagged with major.minor.sub-minor numbers. The major.minor numbers correspond to the major.minor release numbers of the supported PETSc version.

permon's People

Contributors

davidhrbac avatar haplav avatar jkruzik avatar mpecha avatar sojkar avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

permon's Issues

tutorials-jbearing2_3 test issue

  1. I get
    not ok tutorials-jbearing2_3 # Exceeded timeout limit of 60 s
    
    so I added
      timeoutfactor: 2
    
  2. But then I get
not ok diff-tutorials-jbearing2_3 # Error code: 1
#	8,9c8,9
#	<   last QPSSolve CONVERGED due to CONVERGED_ATOL, KSPReason=3, required 2361 iterations
#	<   all 1 QPSSolves from last QPSReset/QPSResetStatistics have required 2361 iterations
#	---
#	>   last QPSSolve CONVERGED due to CONVERGED_ATOL, KSPReason=3, required 2637 iterations
#	>   all 1 QPSSolves from last QPSReset/QPSResetStatistics have required 2637 iterations
#	18c18
#	<         Gradient steps: 678
#	---
#	>         Gradient steps: 780
#	28,30c28,30
#	<             Number of updates: 2352
#	<             Number of rejects: 8
#	<             Number of resets: 688
#	---
#	>             Number of updates: 2635
#	>             Number of rejects: 1
#	>             Number of resets: 785
#	39c39
#	<                 Number of updates: 2352
#	---
#	>                 Number of updates: 2635
#	41c41
#	<                 Number of resets: 696
#	---
#	>                 Number of resets: 786
#	53c53
#	<         Residual in Function/Gradient:=9.99023e-09
#	---
#	>         Residual in Function/Gradient:=9.92755e-09
#	55,56c55,56
#	<         total number of iterations=2361,                                (max: 2000)
#	<         total number of function/gradient evaluations=5109,            (max: 4000)
#	---
#	>         total number of iterations=2637,                                (max: 2000)
#	>         total number of function/gradient evaluations=5159,            (max: 4000)
#	58c58
#	< norm of difference of results from TAO and QP = 7.624551e-07  
#	---
#	> norm of difference of results from TAO and QP = 3.516641e-07  

# -------------
#   Summary    
# -------------
# FAILED diff-tutorials-jbearing2_3

I assume this TAO iteration is not stable enough to yield always the same numbers. But what to do with that? A few possibilities here:

  1. limit number of iterations
  2. remove -qps_view_convergence as the results are compared anyway
  3. use some filtering
  4. use alt files

Compilation - warnings

Hi guys,

new warnings during compilation:

permon/src/mat/impls/inv/matinv.c: In function ‘MatInvExplicitly_Inv’:

permon/src/qps/impls/mpgp/mpgp.c:557:14: warning: ‘alpha’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         TRY( QPGetScaledProjectedGradient(qp,alpha,galpha) );
permon/src/qps/impls/mpgp/mpgp.c: In function ‘QPSSolve_MPGP’:

permon/src/qps/impls/mpgp/mpgp.c:557:14: warning: ‘alpha’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         TRY( QPGetScaledProjectedGradient(qp,alpha,galpha) );
permon/src/qps/impls/smalxe/smalxe.c: In function ‘QPSSMALXEUpdate_SMALXE’:

petsc-3.7.0/include/petsclog.h:40:46: warning: ‘rho_update’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define PetscInfo2(A,S,a1,a2)                PetscInfo_Private(PETSC_FUNCTION_NAME,A,S,a1,a2)

permon/src/qps/impls/smalxe/smalxe.c:387:17: note: ‘rho_update’ was declared here
   PetscReal     rho_update;

Regards, LP

QPSMPGP has too verbose output

It monitors convergence although it's not asked to do so - prints lines like

180 MPGP [c] ||gp||=9.9891341100e-09,	||phi||=9.9891341100e-09,	||beta||=0.0000000000e+00,	alpha=1.2017124429e-01

leftovers from MR 35

Follow up #35 (comment).

  1. add an example showing the use of QPSGetResidualNorm() and QPSGetIterationNumber()
  2. allow QPSTAO to use TAO-native convergence test via a special QPS convergence test
  3. add a testing criterion relative to |f(x)| akin to TAO's grtol - options are
    1. optionally check for r(x)/|f(x)| < rtol additionally to r(x)/||b|| < rtol in QPSConvergedDefault()
    2. add separate stopping criterion which would interpret rtol as grtol, i.e. check for r(x)/|f(x)| < rtol instead of r(x)/||b|| < rtol
    3. add a new tolerance for this and check this and rtol independently in QPSConvergedDefault()

solver divergence with -fno-honor-nans

tested with Clang 15 and Cray Compiling Environment 11 (clang) passing -O3 -fno-honor-nans to PETSc CC/CXX flags on

https://gitlab.com/jkruzik/htfeti

mpirun -n 8 ./ddHTFETI -mh 10 -mhc 1 -qps_view_convergence -qpt_dualize_B_nest_extension -linear -qps_ksp_monitor_true_residual -qps_rtol 1e-6

last QPSSolve DIVERGED due to DIVERGED_INDEFINITE_MAT, KSPReason=-10, required 26 iterations

Note: -fno-honor-nans is turned on by -ffinite-math-only, which is enabled by -ffast-math
Note 2: I did not observe any benefit in using -ffast-math flags and omitting -fno-honor-nans for the above program compiled with -O3 on Archer2 (but no extensive testing was done)

MPGP: reduced gradient set but not used

src/qps/impls/mpgp/mpgp.c:452:21: warning: variable 'gr' set but not used [-Wunused-but-set-variable]

This relates to the proportionality measure. We currently have:
||g_chopped|| <= gamma*||g_free||
Original algorithm has:
||g_chopped|| <= gamma*sqrt(g_reduced^T * g_free),
which can force proportioning more often as sqrt(g_reduced^T * g_free) <= ||g_free||

QPGetInitialVector is missing

QPSetInitialVector is great, but sometimes user wants to also get this vector (for example to test if the value was stored inside QP or to test if the vector was even provided - is the default value zero or ...?).
Please, provide also QPGetInitialVector(QP, Vec *). Or maybe - the provided x0 is automatically stored in SolutionVector, therefore it could be obtained using QPGetSolutionVector?

MatCreateTimer causes Valgrind warnings

==20228== Conditional jump or move depends on uninitialised value(s)
==20228==    at 0x4EBD511: MatCreateTimer (mattimer.c:84)
==20228==    by 0x4F4A69A: QPTDualize (qptransform.c:1081)
==20228==    by 0x4F5F3A6: QPTAllInOne (qptransform.c:2113)
==20228==    by 0x4F608F2: QPTFromOptions (qptransform.c:2171)
==20228==    by 0x4032DC: main (ex4.c:111)

ex71 nullspace detection

using -dim 3 -cells 7,8,9 with anything between 2 and 7 ranks, the detected nullspace has 0 columns
with 8 ranks the detect nullspace is not empty

Setting of max_it using "QPSSetTolerances" does not work

Hi guys,

I am trying to set max_it of QPS in my code (not from console neither using flloprc), but it seems that it does not work. Here is part of my C++ code:

coutMaster << "TEST1: " << this->maxit << std::endl;
TRYCXX( QPSCreate(PETSC_COMM_WORLD, &qps) );
TRYCXX( QPSSetQP(qps, qp) );
TRYCXX( QPSSetTolerances(qps, this->eps, this->eps, 1e12, this->maxit) );
TRYCXX( QPSMonitorSet(qps,QPSMonitorDefault,NULL,0) );
TRYCXX( QPSetRhs(qp, b) );
TRYCXX( QPTFromOptions(qp) ); 
TRYCXX( QPSSetFromOptions(qps) );
TRYCXX( QPSSetUp(qps) ); 

int maxit2;
TRYCXX( QPSGetTolerances(qps,PETSC_NULL,PETSC_NULL,PETSC_NULL, &maxit2) );
coutMaster << "TEST2: " << maxit2 << std::endl;

and it produces

TEST1: 1000
TEST2: 100

Is there any difference between setting the max_it of inner/outer solver? How can I set the number of iterations of outer solver from the code?

Thanks a lot, LP

inconsistent documentation

the documentation of function "QPSetOperator" in file qp.c includes input parameter flg, which is depreciated (i.e. QP_SYM_* is not used and it is undefined)

suggestions for permonsys.h

  • FLLOP_ASSERT
    • rename toPERMON_ASSERT
    • #if defined(PETSC_USE_DEBUG) no-op
  • FllopDebug
  • FLLOP_SETERRQ* can now be abandoned in favor of SETERRQ*
  • similar for FLLOP_EXTERN and FLLOP_INTERN
  • FLLTIC and FLLTOC can be removed
  • FllopTrace -> PermonTrace
    • or get rid of it

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.