permon / permon Goto Github PK
View Code? Open in Web Editor NEWPERMON main package for quadratic programming (PermonQP)
Home Page: http://permon.vsb.cz
License: BSD 2-Clause "Simplified" License
PERMON main package for quadratic programming (PermonQP)
Home Page: http://permon.vsb.cz
License: BSD 2-Clause "Simplified" License
Hi guys,
here is a list of unused variables (I obtained it during compilation):
src/mat/impls/inv/matinv.c:393:3: warning: label ‘chosen’ defined but not used
src/mat/impls/inv/matinv.c:305:35: warning: unused variable ‘flg’
Regards, LP
Line 36 in 97658d0
-tao_gttol 1e-6 -qps_view_convergence -qps_type mpgp
Compare functionality and speed of MatRemoveGluingOfDirichletDofs
and MatRemoveGluingOfDirichletDofs_old
.
Merge the functions or completely remove _old
function.
All these
#undef __FUNCT__
#define __FUNCT__ "main"
are legacy of > 2 years old PETSc and should be removed.
Following up #12 (review)
Follow up #35 (comment).
QPSGetResidualNorm()
and QPSGetIterationNumber()
|f(x)|
akin to TAO's grtol
- options are
r(x)/|f(x)| < rtol
additionally to r(x)/||b|| < rtol
in QPSConvergedDefault()
rtol
as grtol
, i.e. check for r(x)/|f(x)| < rtol
instead of r(x)/||b|| < rtol
rtol
independently in QPSConvergedDefault()
e.g.
permon/src/qp/impls/feti/qpfeti.c
Line 219 in 2f32058
and replace with PetscCheck/PetscAssert
Follow up #36 (comment)
==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)
https://gitlab.com/petsc/petsc/-/commit/f07d178c4121a870076ccb0b7ed834dcdbc01e49
Originally posted by @haplav in #51 (comment)
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)
FLLOP_ASSERT
PERMON_ASSERT
#if defined(PETSC_USE_DEBUG)
no-opFllopDebug
PetscInfo
which now offers finer control (after https://gitlab.com/petsc/petsc/-/merge_requests/2216)FLLOP_SETERRQ*
can now be abandoned in favor of SETERRQ*
FLLOP_EXTERN
and FLLOP_INTERN
FLLTIC
and FLLTOC
can be removedFllopTrace
-> PermonTrace
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
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)
Maybe we could consider using some system directly connected to git. Some suggestions:
Follow up #10 (comment)
Related to #13 .
These functions should be contributed to PETSc or removed if already fixed
I hate MatInvType. Can we get rid of it somehow?
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
not ok tutorials-jbearing2_3 # Exceeded timeout limit of 60 s
timeoutfactor: 2
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:
-qps_view_convergence
as the results are compared anywayboth are deprecated
Follow up #20 (comment).
We should abandon our own implementation in favor of PETSc one, which seems to be under intensive development now (https://gitlab.com/petsc/petsc/-/merge_requests/2800).
If there is anything useful on our side, it should be contributed to PETSc.
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?
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||
Follow up #12 (comment)
Maybe it should be mentioned as just a part of PermonQP.
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.