Changeset 9826
- Timestamp:
- 09/16/11 16:35:08 (14 years ago)
- Location:
- issm/trunk
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/configs/astrid/configure.sh
r8252 r9826 12 12 --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \ 13 13 --with-petsc-version=3 \ 14 --with-tao-dir=$ISSM_TIER/externalpackages/tao/install \ 14 15 --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include \ 15 16 --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich " \ -
issm/trunk/m4/issm_options.m4
r9812 r9826 342 342 AC_ARG_WITH([petsc-version], 343 343 AS_HELP_STRING([--with-petsc-version = VERSION], 344 [petsc version -- 2 or 3]),344 [petsc version -- 3.1 or 3.2]), 345 345 [PETSC_VERSION=$withval],[PETSC_VERSION=""]) 346 347 dnl [morlighe@astrid m4]$ echo 3.2 | sed -e 's/3\..*//' 348 dnl [morlighe@astrid m4]$ echo 3.2 | sed -e 's/3\.//' 346 349 347 350 if test "$PARALLEL_VALUE" = "yes" ; then … … 349 352 AC_MSG_ERROR([missing --with-petsc-version argument for parallel compilation!]) 350 353 fi 351 if test "$PETSC_VERSION" = "2 " ; then352 AC_DEFINE([_PETSC_VERSION_],[2],[ Petsc version number])353 fi354 354 if test "$PETSC_VERSION" = "2.3" ; then 355 AC_DEFINE([_PETSC_MAJOR_],[2],[ Petsc version major]) 356 AC_DEFINE([_PETSC_MINOR_],[3],[ Petsc version minor]) 357 fi 355 358 if test "$PETSC_VERSION" = "3" ; then 356 AC_DEFINE([_PETSC_VERSION_],[3],[ Petsc version number]) 359 AC_DEFINE([_PETSC_MAJOR_],[3],[ Petsc version major]) 360 AC_DEFINE([_PETSC_MINOR_],[1],[ Petsc version minor]) 361 fi 362 if test "$PETSC_VERSION" = "3.1" ; then 363 AC_DEFINE([_PETSC_MAJOR_],[3],[ Petsc version major]) 364 AC_DEFINE([_PETSC_MINOR_],[1],[ Petsc version minor]) 365 fi 366 if test "$PETSC_VERSION" = "3.2" ; then 367 AC_DEFINE([_PETSC_MAJOR_],[3],[ Petsc version major]) 368 AC_DEFINE([_PETSC_MINOR_],[2],[ Petsc version minor]) 357 369 fi 358 370 fi -
issm/trunk/src/c/modules/Solverx/DofTypesToIndexSet.cpp
r9320 r9826 64 64 65 65 /*Create indices sets: */ 66 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 66 67 ISCreateGeneral(PETSC_COMM_WORLD,pressure_num,pressure_indices,&isp); 67 68 ISCreateGeneral(PETSC_COMM_WORLD,velocity_num,velocity_indices,&isv); 69 #else 70 ISCreateGeneral(PETSC_COMM_WORLD,pressure_num,pressure_indices,PETSC_COPY_VALUES,&isp); 71 ISCreateGeneral(PETSC_COMM_WORLD,velocity_num,velocity_indices,PETSC_COPY_VALUES,&isv); 72 #endif 73 } 68 74 69 }70 75 /*Free ressources:*/ 71 76 xfree((void**)&pressure_indices); 72 77 xfree((void**)&velocity_indices); 73 74 78 75 79 /*Assign output pointers:*/ -
issm/trunk/src/c/modules/Solverx/Solverx.cpp
r9761 r9826 27 27 PC pc = NULL; 28 28 int iteration_number; 29 PetscTruth flag;30 29 int solver_type; 31 30 bool fromlocalsize = true; 31 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 32 PetscTruth flag,flg; 33 #else 34 PetscBool flag,flg; 35 #endif 36 32 37 /*stokes: */ 33 38 IS isv=NULL; 34 39 IS isp=NULL; 35 40 36 #if _PETSC_ VERSION_ == 341 #if _PETSC_MAJOR_ >= 3 37 42 char ksp_type[50]; 38 PetscTruth flg;39 43 #endif 40 44 … … 42 46 /*Display message*/ 43 47 _printf_(VerboseModule()," Solving\n"); 48 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 44 49 if(VerboseSolver())PetscOptionsPrint(stdout); 50 #else 51 PetscViewer *v=NULL; 52 PetscViewerCreate(PETSC_COMM_SELF,v); 53 if(VerboseSolver())PetscOptionsView(*v); 54 #endif 45 55 46 56 /*First, check that f-set is not NULL, ie model is fully constrained: {{{*/ … … 53 63 /*Initial guess logic here: {{{1*/ 54 64 /*Now, check that we are not getting an initial guess to the solver, if we are running a direct solver: */ 55 #if _PETSC_ VERSION_ == 365 #if _PETSC_MAJOR_ >= 3 56 66 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 57 67 if (strcmp(ksp_type,"preonly")==0)uf0=NULL; … … 73 83 We need to convert them if we are going to run the solvers successfully: */ 74 84 #ifdef _SERIAL_ 75 #if _PETSC_ VERSION_ == 285 #if _PETSC_MAJOR_ == 2 76 86 if (solver_type==MUMPSPACKAGE_LU){ 77 87 /*Convert Kff to MATTAIJMUMPS: */ -
issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r9761 r9826 68 68 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 69 69 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 70 #if _PETSC_ VERSION_ == 270 #if _PETSC_MAJOR_ == 2 71 71 MatCompress(Kff); 72 72 #endif … … 74 74 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY); 75 75 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY); 76 #if _PETSC_ VERSION_ == 276 #if _PETSC_MAJOR_ == 2 77 77 MatCompress(Kfs); 78 78 #endif … … 117 117 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 118 118 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 119 #if _PETSC_ VERSION_ == 2119 #if _PETSC_MAJOR_ == 2 120 120 MatCompress(Kff); 121 121 #endif … … 123 123 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY); 124 124 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY); 125 #if _PETSC_ VERSION_ == 2125 #if _PETSC_MAJOR_ == 2 126 126 MatCompress(Kfs); 127 127 #endif -
issm/trunk/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
r9561 r9826 66 66 *capability is not covered by Petsc!: */ 67 67 68 #if _PETSC_ VERSION_ == 268 #if _PETSC_MAJOR_ == 2 69 69 PetscOptionsDestroy(); 70 70 PetscOptionsCreate(); -
issm/trunk/src/c/toolkits/petsc/patches/ISFree.cpp
r9320 r9826 17 17 void ISFree(IS* pis){ 18 18 19 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 19 20 if(*pis)ISDestroy(*pis); 20 21 *pis=NULL; 22 #else 23 if(*pis)ISDestroy(pis); 24 *pis=NULL; 25 #endif 21 26 22 27 } -
issm/trunk/src/c/toolkits/petsc/patches/KSPFree.cpp
r9320 r9826 17 17 void KSPFree(KSP* pksp){ 18 18 19 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 19 20 if(*pksp)KSPDestroy(*pksp); 20 21 *pksp=NULL; 22 #else 23 if(*pksp)KSPDestroy(pksp); 24 *pksp=NULL; 25 #endif 21 26 22 27 } -
issm/trunk/src/c/toolkits/petsc/patches/MatFree.cpp
r9320 r9826 17 17 void MatFree(Mat* pmat){ 18 18 19 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 19 20 if(*pmat)MatDestroy(*pmat); 20 21 *pmat=NULL; 22 #else 23 if(*pmat)MatDestroy(pmat); 24 *pmat=NULL; 25 #endif 21 26 22 27 } -
issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp
r6412 r9826 65 65 MatFree(&identity); 66 66 VecFree(&diagonal); 67 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 67 68 KSPDestroy(ksp); 69 #else 70 KSPDestroy(&ksp); 71 #endif 68 72 69 73 /*Assign output pointers:*/ -
issm/trunk/src/c/toolkits/petsc/patches/MatMultPatch.cpp
r9320 r9826 34 34 VecRelocalize(&X_rel,X,n); 35 35 MatMult(A,X_rel,AX); ; 36 VecDestroy(X_rel);; 36 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 37 VecDestroy(X_rel); 38 #else 39 VecDestroy(&X_rel); 40 #endif 37 41 } 38 42 } -
issm/trunk/src/c/toolkits/petsc/patches/MatPartition.cpp
r9320 r9826 79 79 80 80 /*Now each node has a node_rows vectors holding which rows they should extract from matrixA. Create an Index Set from node_rows.*/ 81 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 81 82 ISCreateGeneral(MPI_COMM_WORLD,count,node_rows,&row_index); 83 #else 84 ISCreateGeneral(MPI_COMM_WORLD,count,node_rows,PETSC_COPY_VALUES,&row_index); 85 #endif 82 86 83 87 /*Same deal for columns*/ … … 86 90 *(node_cols+i)=(int)*(col_partition_vector+i)-1; 87 91 } 92 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 88 93 ISCreateGeneral(MPI_COMM_WORLD,col_partition_vector_size,node_cols,&col_index); 94 #else 95 ISCreateGeneral(MPI_COMM_WORLD,col_partition_vector_size,node_cols,PETSC_COPY_VALUES,&col_index); 96 #endif 89 97 90 98 /*Call MatGetSubMatrix*/ 91 99 csize=PetscDetermineLocalSize(col_partition_vector_size); 92 100 if(col_partition_vector_size==row_partition_vector_size){ 93 #if _PETSC_ VERSION_ == 3101 #if _PETSC_MAJOR_ >= 3 94 102 MatGetSubMatrix(matrixA,row_index,col_index,MAT_INITIAL_MATRIX,&outmatrix); 95 103 #else … … 98 106 } 99 107 else{ 100 #if _PETSC_ VERSION_ == 3108 #if _PETSC_MAJOR_ >= 3 101 109 MatGetSubMatrix(matrixA,row_index,col_index,MAT_INITIAL_MATRIX,&outmatrix); 102 110 #else -
issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
r9320 r9826 78 78 int nnz; 79 79 80 #if _PETSC_ VERSION_ == 380 #if _PETSC_MAJOR_ >= 3 81 81 const MatType type; 82 82 #else … … 99 99 MatGetType(outmatrix,&type); 100 100 101 #if _PETSC_ VERSION_ == 2101 #if _PETSC_MAJOR_ == 2 102 102 if((strcmp(type,"mpiaij")==0) || (strcmp(type,"aijmumps")==0)){ 103 103 MatMPIAIJSetPreallocation(outmatrix,d_nz,NULL,o_nz,NULL); -
issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
r9320 r9826 22 22 23 23 char option[100]; 24 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 24 25 PetscTruth flag; 26 #else 27 PetscBool flag; 28 #endif 25 29 26 30 /*output: */ -
issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
r9320 r9826 23 23 24 24 /*The list of options is going to be pairs of the type "-option option_value"*/ 25 #if _PETSC_ VERSION_ == 225 #if _PETSC_MAJOR_ == 2 26 26 PetscToken *token=NULL ; 27 27 #else -
issm/trunk/src/c/toolkits/petsc/patches/VecFree.cpp
r9320 r9826 17 17 void VecFree(Vec* pvec){ 18 18 19 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 19 20 if(*pvec)VecDestroy(*pvec); 21 #else 22 if(*pvec)VecDestroy(pvec); 23 #endif 20 24 *pvec=NULL; 21 25 -
issm/trunk/src/mex/Solver/Solver.cpp
r8910 r9826 16 16 int analysis_type; 17 17 char option[100]; 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 18 19 PetscTruth flag; 20 #else 21 PetscBool flag; 22 #endif 19 23 20 24 /*Matlab solver: */
Note:
See TracChangeset
for help on using the changeset viewer.