source:
issm/oecreview/Archive/24684-25833/ISSM-25709-25710.diff
Last change on this file was 25834, checked in by , 4 years ago | |
---|---|
File size: 22.8 KB |
-
../trunk-jpl/m4/issm_options.m4
209 209 AC_MSG_CHECKING([if system copy of libc has fmemopen]) 210 210 SYSTEM_FMEMOPEN=1 211 211 if test "${IS_MAC}" == "yes"; then 212 if [[ $(system_profiler SPSoftwareDataType | $(which grep)"System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then212 if [[ $(system_profiler SPSoftwareDataType | /usr/bin/grep "System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then 213 213 SYSTEM_FMEMOPEN=0 214 214 fi 215 215 fi … … 377 377 ;; 378 378 *) 379 379 MATLABINCL="-I${MATLAB_ROOT}/extern/include" 380 MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/ LDFLAGS = //g")381 MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/ CXXLIBS = //g")382 MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/ LDEXTENSION = //g")380 MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDFLAGS | sed -e "s/ LDFLAGS = //g") 381 MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep CXXLIBS | sed -e "s/ CXXLIBS = //g") 382 MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDEXTENSION | sed -e "s/ LDEXTENSION = //g") 383 383 dnl version 2014 and up 384 384 if test -z "${MEXEXT}"; then 385 385 echo "#include <mex.h>" > conftest.cpp … … 386 386 echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp 387 387 ${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1 388 388 rm -f conftest.cpp 389 MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")390 MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")391 MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')389 MEXLINK=$(cat conftest.tmp | /usr/bin/grep LDFLAGS | sed -e "s/LDFLAGS ://g") 390 MEXLIB=$(cat conftest.tmp | /usr/bin/grep LINKLIBS | sed -e "s/LINKLIBS ://g") 391 MEXEXT=$(cat conftest.tmp | /usr/bin/grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}') 392 392 if test -z "${MEXEXT}"; then 393 393 cat conftest.tmp 394 394 fi … … 507 507 BOOSTINCL="-I${BOOST_ROOT}/include" 508 508 #BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python" 509 509 AC_MSG_CHECKING(for Boost version) 510 BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'`510 BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | /usr/bin/grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'` 511 511 BOOST_VERSION_MAJOR=`expr ${BOOST_VERSION} / 100000` 512 512 BOOST_VERSION_MINOR=`expr ${BOOST_VERSION} / 100 % 1000` 513 513 AC_MSG_RESULT([${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}]) … … 547 547 dnl 548 548 DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v` 549 549 if test -n "${DAKOTA_VERSION_OUTPUT}"; then 550 DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`550 DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} /usr/bin/grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'` 551 551 elif test -f "${DAKOTA_ROOT}/VERSION"; then 552 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`552 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | /usr/bin/grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'` 553 553 elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then 554 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' |grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `554 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' ` 555 555 elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then 556 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' |grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `556 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' ` 557 557 else 558 558 AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]); 559 559 fi … … 1207 1207 1208 1208 dnl PETSc libraries and header files 1209 1209 if test "x${HAVE_PETSC}" == "xyes"; then 1210 AC_MSG_CHECKING(for PETSc version)1211 1210 if ! test -f "${PETSC_ROOT}/include/petscversion.h"; then 1212 1211 AC_MSG_ERROR([PETSc not instaled correctly: file (${PETSC_ROOT}/include/petscversion.h) does not exist!]); 1213 1212 fi 1214 PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'` 1215 PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'` 1216 AC_DEFINE_UNQUOTED(_PETSC_MAJOR_, $PETSC_MAJOR, [PETSc version major]) 1217 AC_DEFINE_UNQUOTED(_PETSC_MINOR_, $PETSC_MINOR, [PETSc version minor]) 1213 1214 AC_MSG_CHECKING(for PETSc version) 1215 PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'` 1216 PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'` 1217 AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major]) 1218 AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor]) 1218 1219 AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}]) 1219 1220 1220 dnl PETSC_VERSION_DATE_HG=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_DATE_HG" | sed 's/#define PETSC_VERSION_DATE_HG//' | sed 's/ //g' | sed -e 's/\"//g' `1221 PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'`1222 1223 1221 AC_MSG_CHECKING(whether PETSc is the development version) 1224 dnl if test "x${PETSC_VERSION_DATE_HG}" == "xunknown"; then1222 PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'` 1225 1223 if test "${PETSC_RELEASE}" == "0"; then 1226 1224 AC_DEFINE([_HAVE_PETSCDEV_], [1], [with PETSc-dev]) 1227 1225 AC_MSG_RESULT([yes]) … … 2211 2209 AC_SUBST([GRAPHICSLIB]) 2212 2210 else 2213 2211 if test -f "${PETSC_ROOT}/conf/petscvariables"; then 2214 PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | grep X_LIB)2212 PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | /usr/bin/grep X_LIB) 2215 2213 AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist! PETSc suggests the following library: ${PETSC_REC_GRAPHICS_LIB}]); 2216 2214 fi 2217 2215 AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist!]); … … 2350 2348 AC_DEFINE([_HAVE_GMSH_], [1], [with Gmsh in ISSM src]) 2351 2349 2352 2350 AC_MSG_CHECKING(for Gmsh version) 2353 GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`2351 GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | /usr/bin/grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1` 2354 2352 AC_MSG_RESULT([${GMSH_VERSION_MAJOR}]) 2355 2353 AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version]) 2356 2354 fi -
../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
12 12 #include <fstream> 13 13 14 14 #ifdef _HAVE_PETSC_ 15 #include <petscversion.h> 15 16 16 17 17 void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff, Vec pf, Vec uf0,IS isv,IS isp,Parameters* parameters){/*{{{*/ 18 18 19 19 Mat A, B, BT; /* Saddle point block matrices */ … … 43 43 44 44 int precond = 0; 45 45 46 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)46 #if PETSC_VERSION_LT(3,2,0) 47 47 PetscTruth flag,flg; 48 48 #else 49 49 PetscBool flag,flg; … … 54 54 char pc_type[50]; 55 55 int maxiter; 56 56 57 #if _PETSC_MINOR_<757 #if PETSC_VERSION_LT(3,7,0) 58 58 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 59 59 PetscOptionsGetString(PETSC_NULL,"-pc_type",pc_type,49,&flg); 60 60 PetscOptionsGetReal(PETSC_NULL,"-tol",&TOL,NULL); … … 87 87 * where A is the elliptic submatrix, B^T represents the incompressibility, 88 88 * and I the Schur preconditioner (stored here, because the space was allocated either way) 89 89 * */ 90 #if _PETSC_MINOR_>890 #if PETSC_VERSION_GT(3,8,0) 91 91 MatCreateSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A); 92 92 MatCreateSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B); 93 93 MatCreateSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT); … … 98 98 #endif 99 99 100 100 /* Extract preconditioner matrix on the pressure space*/ 101 #if _PETSC_MINOR_>8101 #if PETSC_VERSION_GT(3,8,0) 102 102 MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP); 103 103 #else 104 104 MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP); … … 145 145 146 146 /* Create KSP context */ 147 147 KSPCreate(IssmComm::GetComm(),&kspu); 148 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)148 #if PETSC_VERSION_GE(3,5,0) 149 149 KSPSetOperators(kspu,A,A); 150 150 #else 151 151 KSPSetOperators(kspu,A,A,DIFFERENT_NONZERO_PATTERN); … … 263 263 264 264 /* Create KSP context */ 265 265 KSPCreate(IssmComm::GetComm(),&kspip); 266 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)266 #if PETSC_VERSION_GE(3,5,0) 267 267 KSPSetOperators(kspip,IP,IP); 268 268 #else 269 269 KSPSetOperators(kspip,IP,IP,DIFFERENT_NONZERO_PATTERN); … … 538 538 * To calculate the residual, only the necessary blocks need to be extracted */ 539 539 540 540 /*Extract A, B, B^T */ 541 #if _PETSC_MINOR_>8541 #if PETSC_VERSION_GT(3,8,0) 542 542 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A); 543 543 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B); 544 544 MatCreateSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT); … … 741 741 Reduceloadx(pf, Kfs, ys); delete Kfs; 742 742 743 743 /*Create pressure matrix of choice*/ 744 #if _PETSC_MINOR_<7744 #if PETSC_VERSION_LT(3,7,0) 745 745 PetscOptionsGetInt(PETSC_NULL,"-schur_pc",&precond,NULL); 746 746 #else 747 747 PetscOptionsGetInt(NULL,PETSC_NULL,"-schur_pc",&precond,NULL); … … 774 774 /*Obtain index sets for velocity and pressure components */ 775 775 IS isv = NULL; 776 776 IS isp = NULL; 777 #if _PETSC_MAJOR_==3777 #if PETSC_VERSION_MAJOR==3 778 778 779 779 /*Make indices out of doftypes: */ 780 780 if(!(df->pvector->vector))_error_("need doftypes for FS solver!\n"); -
../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
8 8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 9 9 #endif 10 10 11 #include <petscversion.h> 12 11 13 #include "./PetscSolver.h" 12 14 #include "../../../shared/Numerics/Verbosity.h" 13 15 #include "../../../shared/MemOps/MemOps.h" … … 46 48 int iteration_number; 47 49 int solver_type; 48 50 bool fromlocalsize = true; 49 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)51 #if PETSC_VERSION_LT(3,2,0) 50 52 PetscTruth flag,flg; 51 53 #else 52 54 PetscBool flag,flg; … … 58 60 char ksp_type[50]; 59 61 60 62 /*Display message*/ 61 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)63 #if PETSC_VERSION_LT(3,2,0) 62 64 if(VerboseSolver())PetscOptionsPrint(stdout); 63 65 #else 64 #if _PETSC_MINOR_<766 #if PETSC_VERSION_LT(3,7,0) 65 67 if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD); 66 68 #else 67 69 if(VerboseSolver())PetscOptionsView(NULL,PETSC_VIEWER_STDOUT_WORLD); … … 77 79 78 80 /*Initial guess */ 79 81 /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */ 80 #if _PETSC_MINOR_<782 #if PETSC_VERSION_LT(3,7,0) 81 83 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 82 84 #else 83 85 PetscOptionsGetString(NULL,PETSC_NULL,"-ksp_type",ksp_type,49,&flg); … … 106 108 107 109 /*Prepare solver*/ 108 110 KSPCreate(IssmComm::GetComm(),&ksp); 109 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)111 #if PETSC_VERSION_GE(3,5,0) 110 112 KSPSetOperators(ksp,Kff,Kff); 111 113 #else 112 114 KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN); … … 116 118 /*Specific solver?: */ 117 119 KSPGetPC(ksp,&pc); 118 120 if (solver_type==MUMPSPACKAGE_LU){ 119 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=9)121 #if PETSC_VERSION_GE(3,9,0) 120 122 PCFactorSetMatSolverType(pc,MATSOLVERMUMPS); 121 123 #else 122 124 PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS); … … 131 133 132 134 /*Set field splits: */ 133 135 KSPGetPC(ksp,&pc); 134 #if _PETSC_MINOR_==1136 #if (PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR == 1) 135 137 PCFieldSplitSetIS(pc,isv); 136 138 PCFieldSplitSetIS(pc,isp); 137 139 #else … … 216 218 VecRestoreArray(df,&df_local); 217 219 218 220 /*Create indices sets: */ 219 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)221 #if PETSC_VERSION_LT(3,2,0) 220 222 ISCreateGeneral(IssmComm::GetComm(),pressure_num,pressure_indices,&isp); 221 223 ISCreateGeneral(IssmComm::GetComm(),velocity_num,velocity_indices,&isv); 222 224 #else -
../trunk-jpl/src/c/toolkits/petsc/patches/KSPFree.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> 14 15 #include <petscksp.h> … … 15 16 16 17 void KSPFree(KSP* pksp){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pksp)KSPDestroy(*pksp); 20 21 *pksp=NULL; 21 22 #else -
../trunk-jpl/src/c/toolkits/petsc/patches/VecFree.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> 14 15 #include <petscksp.h> … … 15 16 16 17 void VecFree(Vec* pvec){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pvec)VecDestroy(*pvec); 20 21 #else 21 22 if(*pvec)VecDestroy(pvec); -
../trunk-jpl/src/c/toolkits/petsc/patches/MatFree.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 #include <petsc mat.h>14 #include <petscvec.h> 14 15 #include <petscksp.h> 15 16 16 17 void MatFree(Mat* pmat){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pmat)MatDestroy(*pmat); 20 21 *pmat=NULL; 21 22 #else -
../trunk-jpl/src/c/toolkits/petsc/patches/MatMultPatch.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> 14 15 #include <petscksp.h> … … 34 35 MatGetLocalSize(A,&m,&n);; 35 36 VecRelocalize(&X_rel,X,n,comm); 36 37 MatMult(A,X_rel,AX); ; 37 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)38 #if PETSC_VERSION_LT(3,2,0) 38 39 VecDestroy(X_rel); 39 40 #else 40 41 VecDestroy(&X_rel); -
../trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h" 13 #include "petscvec.h" 14 #include "petscksp.h" 12 #include <petscversion.h> 13 #include <petscmat.h> 14 #include <petscvec.h> 15 #include <petscksp.h> 15 16 16 17 #include "./petscpatches.h" 17 18 … … 20 21 void PetscOptionsDetermineSolverType(int* psolver_type){ 21 22 22 23 char option[100]; 23 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)24 #if PETSC_VERSION_LT(3,2,0) 24 25 PetscTruth flag; 25 26 #else 26 27 PetscBool flag; … … 30 31 int solver_type=PETSCPACKAGE; 31 32 32 33 /*retrieve mat_type option: */ 33 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)34 #if PETSC_VERSION_GE(3,7,0) 34 35 PetscOptionsGetString(NULL,PETSC_NULL,"-mat_type",&option[0],100,&flag); 35 36 #else 36 37 PetscOptionsGetString(PETSC_NULL,"-mat_type",&option[0],100,&flag); … … 55 56 solver_type=SUPERLUDISTPACKAGE; 56 57 } 57 58 58 #if _PETSC_MAJOR_ >= 359 #if (_PETSC_MINOR_>=7)59 #if PETSC_VERSION_MAJOR >= 3 60 #if PETSC_VERSION_MINOR >= 7 60 61 PetscOptionsGetString(NULL,PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag); 61 62 #else 62 63 PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag); … … 66 67 } 67 68 #endif 68 69 69 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)70 #if PETSC_VERSION_GE(3,7,0) 70 71 PetscOptionsGetString(NULL,PETSC_NULL,"-issm_option_solver",&option[0],100,&flag); 71 72 #else 72 73 PetscOptionsGetString(PETSC_NULL,"-issm_option_solver",&option[0],100,&flag); -
../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
9 9 #endif 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> 14 15 #include <petscksp.h> … … 36 37 d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 37 38 o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 38 39 39 #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 240 #if PETSC_VERSION_GT(3,2,0) 40 41 MatCreateAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 41 42 #else 42 43 MatCreateMPIAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); … … 64 65 d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 65 66 o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 66 67 67 #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 268 #if PETSC_VERSION_GT(3,2,0) 68 69 if(sparsity==1){ 69 70 MatCreateDense(comm,m,n,M,N,NULL,&outmatrix); 70 71 } … … 88 89 int m,n; 89 90 int d_nz,o_nz; 90 91 91 #if _PETSC_MAJOR_>= 392 #if defined(_HAVE_PETSCDEV_) || _PETSC_MINOR_>=492 #if PETSC_VERSION_MAJOR >= 3 93 #if defined(_HAVE_PETSCDEV_) || PETSC_VERSION_MINOR >=4 93 94 MatType type; 94 95 #else 95 96 const MatType type; -
../trunk-jpl/src/c/cores/controltao_core.cpp
10 10 #include "../solutionsequences/solutionsequences.h" 11 11 12 12 #if defined (_HAVE_TAO_) 13 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5) 13 #if defined _HAVE_PETSC_ 14 #include <petscversion.h> 15 #if PETSC_VERSION_LT(3,5,0) 14 16 #include <tao.h> 15 17 #else 16 18 #include <petsctao.h> 17 19 #endif 20 #endif 18 21 19 22 /*Local prototype*/ 20 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)23 #if PETSC_VERSION_LT(3,5,0) 21 24 int FormFunctionGradient(TaoSolver,Vec,IssmDouble*,Vec,void*); 22 25 int IssmMonitor(TaoSolver,void*); 23 26 #else … … 37 40 int maxsteps,maxiter; 38 41 IssmDouble gatol,grtol,gttol; 39 42 AppCtx user; 40 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)43 #if PETSC_VERSION_LT(3,5,0) 41 44 TaoSolver tao = 0; 42 45 #else 43 46 Tao tao = 0; … … 50 53 Vector<IssmDouble> *XU = NULL; 51 54 52 55 /*Initialize TAO*/ 53 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)56 #if PETSC_VERSION_LT(3,5,0) 54 57 int argc; char **args=NULL; 55 58 PetscGetArgs(&argc,&args); 56 59 ierr = TaoInitialize(&argc,&args,(char*)0,""); … … 82 85 TaoSetMonitor(tao,IssmMonitor,&user,NULL); 83 86 TaoSetMaximumFunctionEvaluations(tao,maxiter); 84 87 TaoSetMaximumIterations(tao,maxsteps); 85 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_<7)88 #if PETSC_VERSION_LT(3,7,0) 86 89 TaoSetTolerances(tao,0,0,gatol,grtol,gttol); 87 90 #else 88 91 TaoSetTolerances(tao,gatol,grtol,gttol); … … 127 130 xDelete<double>(user.J); 128 131 delete X; 129 132 TaoDestroy(&tao); 130 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)133 #if PETSC_VERSION_LT(3,5,0) 131 134 TaoFinalize(); 132 135 #endif 133 136 G->pvector->vector = NULL; … … 134 137 delete G; 135 138 } 136 139 137 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)140 #if PETSC_VERSION_LT(3,5,0) 138 141 int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){ 139 142 #else 140 143 int FormFunctionGradient(Tao tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){ … … 177 180 /*Clean-up and return*/ 178 181 return 0; 179 182 } 180 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)183 #if PETSC_VERSION_LT(3,5,0) 181 184 int IssmMonitor(TaoSolver tao, void *userCtx){ 182 185 #else 183 186 int IssmMonitor(Tao tao, void *userCtx){ -
../trunk-jpl/src/wrappers/IssmConfig/IssmConfig.h
47 47 /* serial output macros: */ 48 48 #define VALUE pvalue 49 49 #define SVALUE psvalue 50 #define WRAPPER(modulename) extern "C" { int 50 #define WRAPPER(modulename) extern "C" { int IssmConfigModule(double* pvalue, char** psvalue, char* string) 51 51 #endif 52 52 53 53 /* serial arg counts: */ -
../trunk-jpl/externalpackages/petsc/install-3.14-mac.sh
38 38 --download-zlib=1 \ 39 39 --download-hdf5=1 40 40 41 42 41 # Compile and install 43 make 44 make install 42 if [ $# -eq 0 ]; then 43 make 44 make install 45 else 46 make -j $1 47 make -j $1 install 48 fi
Note:
See TracBrowser
for help on using the repository browser.