Commit 24f3aaa1 by Kirill Terekhov

Fixes

Replaced russian comments in doxygen.
Examples with OpenGL would not lead to error in cmake if no library is
found.
parent 2624e8d8
......@@ -64,9 +64,9 @@ option(USE_PARTITIONER_PARMETIS "Use ParMetis partitioner" OFF)
option(USE_PARTITIONER_ZOLTAN "Use Zoltan partitioner" OFF)
option(USE_SOLVER_PETSC "Use PETSc solvers" OFF)
option(USE_SOLVER_TRILINOS "Use Trilinos solvers" OFF)
option(USE_AUTODIFF_OPENCL "Use OpenCL for automatic differentiation (under work)" OFF)
option(USE_AUTODIFF_ASMJIT "Use AsmJit for automatic differentiation" OFF)
option(USE_AUTODIFF_EXPRESSION_TEMPLATES "Use c++ expression templates for automatic differentiation" OFF)
#option(USE_AUTODIFF_OPENCL "Use OpenCL for automatic differentiation (under work)" OFF)
#option(USE_AUTODIFF_ASMJIT "Use AsmJit for automatic differentiation" OFF)
#option(USE_AUTODIFF_EXPRESSION_TEMPLATES "Use c++ expression templates for automatic differentiation" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_find/")
......
Copyright (c) 2014, INM-RAS
Copyright (c) 2014-2015, INMOST-DEV
All rights reserved.
Redistribution and use in source and binary forms, with or without
......@@ -24,4 +24,4 @@ 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.
\ No newline at end of file
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
......@@ -13,11 +13,12 @@ if(OPENGL_FOUND)
add_executable(DrawGrid ${SOURCE})
target_link_libraries(DrawGrid inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
if(USE_MPI)
target_link_libraries(DrawGrid ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(DrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
target_link_libraries(DrawGrid ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(DrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND)
message("GLUT not found")
endif(GLUT_FOUND)
......@@ -25,4 +26,3 @@ else(OPENGL_FOUND)
message("OpenGL not found")
endif(OPENGL_FOUND)
install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
\ No newline at end of file
......@@ -31,12 +31,10 @@ if(OPENGL_FOUND)
target_link_libraries(DrawMatrix ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
endif()
install(TARGETS DrawMatrix EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND)
message("GLUT not found, not building DrawMatrix")
endif(GLUT_FOUND)
else(OPENGL_FOUND)
message("OpenGL not found, not building DrawMatrix")
endif(OPENGL_FOUND)
install(TARGETS DrawMatrix EXPORT inmost-targets RUNTIME DESTINATION bin)
\ No newline at end of file
......@@ -23,12 +23,12 @@ int main(int argc, char ** argv)
{
case 0: type = Solver::INNER_ILU2; break;
case 1: type = Solver::INNER_MLILUC; break;
case 2: type = Solver::ANI; break;
case 3: type = Solver::PETSc; break;
case 4: type = Solver::Trilinos_Aztec; break;
case 5: type = Solver::Trilinos_Belos; break;
case 6: type = Solver::Trilinos_Ifpack; break;
case 7: type = Solver::Trilinos_ML; break;
case 2: type = Solver::PETSc; break;
case 3: type = Solver::Trilinos_Aztec; break;
case 4: type = Solver::Trilinos_Belos; break;
case 5: type = Solver::Trilinos_Ifpack; break;
case 6: type = Solver::Trilinos_ML; break;
case 7: type = Solver::ANI; break;
}
Solver::Initialize(&argc,&argv,argc > 4 ? argv[4] : NULL); // Initialize the linear solver in accordance with args
{
......@@ -67,9 +67,21 @@ int main(int argc, char ** argv)
bool success = false;
int iters;
double resid, realresid = 0;
std::string reason;
{
Solver s(type); // Declare the linear solver by specified type
s.SetParameterEnum("gmres_substeps",3);
s.SetParameterEnum("reorder_nonzeros",0);
s.SetParameterEnum("rescale_iterations",8);
s.SetParameterEnum("adapt_ddpq_tolerance",0);
s.SetParameterReal("drop_tolerance",0.001);
s.SetParameterReal("reuse_tolerance",0.00001);
s.SetParameterReal("ddpq_tolerance",0.7);
t = Timer();
s.SetMatrix(mat); // Compute the preconditioner for the original matrix
BARRIER
......@@ -80,6 +92,7 @@ int main(int argc, char ** argv)
if( !rank ) std::cout << "solver: " << Timer() - t << std::endl;
iters = s.Iterations(); // Get the number of iterations performed
resid = s.Residual(); // Get the final residual achieved
reason = s.GetReason();
//x.Save("output.rhs");
}
tt = Timer() - tt;
......@@ -130,6 +143,7 @@ int main(int argc, char ** argv)
if( argc > 3 ) std::cout << " vector \"" << argv[3] << "\"";
std::cout << " true residual ||Ax-b||/||b|| " << realresid;
std::cout << std::endl;
std::cout << "reason: " << reason << std::endl;
}
}
}
......@@ -137,3 +151,4 @@ int main(int argc, char ** argv)
Solver::Finalize(); // Finalize solver and close MPI activity
return 0;
}
......@@ -19,12 +19,10 @@ if(OPENGL_FOUND)
set_target_properties(OldDrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS OldDrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND)
message("GLUT not found, not building OldDrawGrid")
endif(GLUT_FOUND)
else(OPENGL_FOUND)
message("OpenGL not found, not building OldDrawGrid")
endif(OPENGL_FOUND)
install(TARGETS OldDrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
\ No newline at end of file
......@@ -605,7 +605,7 @@ namespace INMOST
__INLINE expr ad_sqrt(const expr & v) {return expr(AD_SQRT, v);}
__INLINE expr ad_val(const expr & v, const expr & multiplyer = expr(0.0)) {return expr(v, multiplyer);}
__INLINE expr measure() { return expr(AD_MES,ENUMUNDEF); }
__INLINE expr condition(const expr & cond, const expr & if_gt, const expr & if_le) { return expr(cond, if_gt, if_le); }
__INLINE expr condition(const expr & cond, const expr & if_gt_zero, const expr & if_le_zero) { return expr(cond, if_gt_zero, if_le_zero); }
__INLINE expr condition_etype(ElementType etypes, const expr & if_true, const expr & if_false) { return expr(expr(AD_COND_TYPE, etypes), if_true, if_false); }
__INLINE expr condition_marker(MarkerType marker, const expr & if_true, const expr & if_false) { return expr(expr(AD_COND_MARK, marker), if_true, if_false); }
__INLINE expr stencil(INMOST_DATA_ENUM_TYPE stncl, const expr & v) { assert(stncl >= AD_STNCL && stncl < AD_TABLE); return expr(stncl, &v); }
......@@ -694,7 +694,7 @@ namespace INMOST
__INLINE expr measure() { return expr(AD_MES, NULL, NULL); }
__INLINE expr condition_etype(ElementType etype, const expr & if_true, const expr & if_false) { return expr(AD_COND, new expr(AD_COND_TYPE,etype), new expr(AD_ALTR, new expr(if_true), new expr(if_false))); }
__INLINE expr condition_marker(MarkerType marker, const expr & if_true, const expr & if_false) { return expr(AD_COND, new expr(AD_COND_MARK,marker), new expr(AD_ALTR, new expr(if_true), new expr(if_false))); }
__INLINE expr condition(const expr & cond, const expr & if_true, const expr & if_false) { return expr(AD_COND, new expr(cond), new expr(AD_ALTR, new expr(if_true), new expr(if_false))); }
__INLINE expr condition(const expr & cond, const expr & if_gt_zero, const expr & if_le_zero) { return expr(AD_COND, new expr(cond), new expr(AD_ALTR, new expr(if_gt_zero), new expr(if_le_zero))); }
__INLINE expr stencil(INMOST_DATA_ENUM_TYPE stncl, const expr & v) { assert(stncl >= AD_STNCL && stncl < AD_TABLE); return expr(stncl, new expr(v), NULL); }
__INLINE expr tabval(INMOST_DATA_ENUM_TYPE tabl, const expr & v) { assert(tabl >= AD_TABLE && tabl < AD_FUNC); return expr(tabl, new expr(v), NULL); }
__INLINE expr tagval(INMOST_DATA_ENUM_TYPE reg_tag, INMOST_DATA_ENUM_TYPE comp = 0) { assert(reg_tag >= AD_TAG && reg_tag < AD_STNCL); return expr(reg_tag, comp); }
......
......@@ -167,7 +167,7 @@ namespace INMOST
info->GetVectorRegion(vbeg,vend);
//rhs_norm = info->ScalarProd(RHS,RHS,vlocbeg,vlocend);
rhs_norm = 1;
rhs_norm = 1;
//r[0] = b
std::copy(RHS.Begin(),RHS.End(),r[0].Begin());
{
......@@ -202,7 +202,7 @@ namespace INMOST
goto exit;
}
long double tt, ts, tp, ttt;
long double tt, ts, tp;
while( true )
{
ts = tp = 0;
......
......@@ -309,7 +309,7 @@ public:
INMOST_DATA_ENUM_TYPE k, i, j, Li, Ui, curr, next, mi, mj;
INMOST_DATA_REAL_TYPE l,u,udiag, max_diag, min_diag, mean_diag, tol_schur;
INMOST_DATA_ENUM_TYPE nzA, nzLU = 0, nzEF = 0, nzL, nzS;
INMOST_DATA_ENUM_TYPE nzA, nzLU = 0, nzEF = 0, nzS;
Solver::Vector DL, DR;
info->GetOverlapRegion(info->GetRank(), mobeg, moend);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment