Changeset 13784
- Timestamp:
- 10/22/12 10:35:47 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r13781 r13784 333 333 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops, 1, 0)); 334 334 } 335 336 335 } 337 336 /*}}}*/ … … 857 856 858 857 859 int i,j ,k;858 int i,j; 860 859 int my_rank; 861 860 bool process_units = true; -
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
r13622 r13784 133 133 PetscMat* PetscMat::Duplicate(void){ 134 134 135 PetscMat* output=NULL; 136 137 output=new PetscMat(); 135 PetscMat* output=new PetscMat(); 138 136 _assert_(this->matrix); 139 137 MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix); -
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
r13622 r13784 129 129 PetscVec* PetscVec::Duplicate(void){ 130 130 131 PetscVec* output=NULL;132 131 _assert_(this->vector); 133 132 Vec vec_output=NULL; 134 133 VecDuplicate(this->vector,&vec_output); 135 output=new PetscVec(vec_output);134 PetscVec* output=new PetscVec(vec_output); 136 135 VecFree(&vec_output); 137 136 -
issm/trunk-jpl/src/c/toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp
r13622 r13784 26 26 int lower_row,upper_row; 27 27 28 /*intermediary :*/29 int i;30 int* allranges=NULL;31 32 28 /*Gather all range values into allranges, for all nodes*/ 33 allranges=xNew<int>(num_procs);29 int* allranges=xNew<int>(num_procs); 34 30 MPI_Allgather(&range,1,MPI_INT,allranges,1,MPI_INT,comm); 35 31 … … 37 33 lower_row=0; 38 34 upper_row=lower_row+allranges[0]; 39 for (i=1;i<=my_rank;i++){35 for(int i=1;i<=my_rank;i++){ 40 36 lower_row=lower_row+allranges[i-1]; 41 37 upper_row=upper_row+allranges[i]; -
issm/trunk-jpl/src/c/toolkits/petsc/patches/KSPFree.cpp
r13622 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 void KSPFree(KSP* pksp){ -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatFree.cpp
r13622 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscmat.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscmat.h> 14 #include <petscksp.h> 15 15 16 16 void MatFree(Mat* pmat){ -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatMultPatch.cpp
r13760 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 #include "../../../shared/shared.h" -
issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
r13760 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 #include "./petscpatches.h" -
issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp
r13760 r13784 12 12 13 13 /*Petsc includes: */ 14 #include "petscmat.h"15 #include "petscvec.h"16 #include "petscksp.h"14 #include <petscmat.h> 15 #include <petscvec.h> 16 #include <petscksp.h> 17 17 18 18 /*Petsc includes: */ … … 22 22 23 23 /*output: */ 24 int i; 24 25 double* matrix=NULL; 25 26 int rows,cols; 26 27 /*intermediary: */28 int i;29 int* idxm=NULL;30 int* idxn=NULL;31 27 32 28 /*Some needed information: */ 33 29 MatGetSize(petsc_matrix,&rows,&cols); 34 30 35 i dxm=xNew<int>(rows);36 i dxn=xNew<int>(cols);31 int* idxm=xNew<int>(rows); 32 int* idxn=xNew<int>(cols); 37 33 38 34 for(i=0;i<rows;i++)idxm[i]=i; -
issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
r13760 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 #include "./petscpatches.h" … … 29 29 char* first=NULL; 30 30 char* second=NULL; 31 char* final=NULL;32 31 size_t len; 33 32 int first_token=1; -
issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscVectorToDoubleVector.cpp
r12431 r13784 11 11 12 12 /*Petsc includes: */ 13 #include "petscmat.h"14 #include "petscvec.h"15 #include "petscksp.h"13 #include <petscmat.h> 14 #include <petscvec.h> 15 #include <petscksp.h> 16 16 17 17 #include "../../../shared/shared.h" … … 19 19 void PetscVectorToDoubleVector(double** pvector, int* prows, Vec petsc_vector){ 20 20 21 int i;22 21 int rows; 23 int *idxm = NULL;24 22 double *vector = NULL; 25 23 … … 28 26 VecGetSize(petsc_vector,&rows); 29 27 if(rows){ 30 i dxm=xNew<int>(rows);28 int* idxm=xNew<int>(rows); 31 29 vector=xNew<double>(rows); 32 for(i =0;i<rows;i++)idxm[i]=i;30 for(int i=0;i<rows;i++)idxm[i]=i; 33 31 VecGetValues(petsc_vector,rows,idxm,vector); 34 32 xDelete<int>(idxm); -
issm/trunk-jpl/src/c/toolkits/petsc/patches/VecDuplicatePatch.cpp
r13622 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 void VecDuplicatePatch(Vec* output, Vec input){ -
issm/trunk-jpl/src/c/toolkits/petsc/patches/VecFree.cpp
r13622 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 void VecFree(Vec* pvec){ -
issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp
r13760 r13784 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h"13 #include "petscvec.h"14 #include "petscksp.h"12 #include <petscmat.h> 13 #include <petscvec.h> 14 #include <petscksp.h> 15 15 16 16 #include "./petscpatches.h" … … 20 20 21 21 void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size){ 22 23 int i;24 22 25 23 /*Petsc matrix*/ … … 34 32 35 33 /*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */ 36 if ( 34 if ((row_partition_size !=MB) ){ 37 35 _error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n"); 38 36 } … … 47 45 idxm=xNew<int>(range); 48 46 values=xNew<double>(range); 49 for (i=0;i<range;i++){50 *(idxm+i)=lower_row+i;47 for(int i=0;i<range;i++){ 48 idxm[i]=lower_row+i; 51 49 } 52 50 VecGetValues(B,range,idxm,values); 53 51 /*Now, modify idxm using the partition vector, and plug values into A*/ 54 for (i=0;i<range;i++){55 *(idxm+i)=(int)*(row_partition_vector+lower_row+i)-1; //-1 because partition vector comes from Matlab, where indices start at 1.52 for(int i=0;i<range;i++){ 53 idxm[i]=int(row_partition_vector[lower_row+i])-1; //-1 because partition vector comes from Matlab, where indices start at 1. 56 54 } 57 55 VecSetValues(A,range,idxm,values,INSERT_VALUES); -
issm/trunk-jpl/src/c/toolkits/plapack/patches/CyclicalFactorization.cpp
r13622 r13784 39 39 int PrimeDecomp(int** pdecomp,int* pdecomp_size,int input){ 40 40 41 int* decomp=NULL;42 41 int prime_factor; 43 42 int i; 44 43 45 decomp=xNew<int>(input);44 int* decomp=xNew<int>(input); 46 45 *decomp=input; 47 46 for (i=0;i<input;i++){ -
issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
r13760 r13784 24 24 int mA,nA; 25 25 int local_mA,local_nA; 26 int lower_row,upper_row ,range;26 int lower_row,upper_row; 27 27 MatType type; 28 28 … … 36 36 int nb,nb_alg; 37 37 int nprows,npcols; 38 int initialized=0;39 38 40 39 /*Petsc to Plapack: */ … … 96 95 MatGetOwnershipRange(*A,&lower_row,&upper_row); 97 96 upper_row--; 98 range=upper_row-lower_row+1;99 97 arrayA = xNew<double>(nA); 100 98 idxnA = xNew<int>(nA); -
issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackToPetsc.cpp
r13622 r13784 10 10 int i; 11 11 12 int lower_row,upper_row ,range;12 int lower_row,upper_row; 13 13 int* row_nodes=NULL; 14 14 int* col_nodes=NULL; … … 34 34 MatGetOwnershipRange(*A,&lower_row,&upper_row); 35 35 upper_row--; 36 range=upper_row-lower_row+1;37 36 38 37 /*Build the Plapack row and column indices corresponding to the local_buffer stored in a. -
issm/trunk-jpl/src/c/toolkits/plapack/plapackincludes.h
r13623 r13784 12 12 #endif 13 13 14 #include "PLA.h"14 #include <PLA.h> 15 15 16 16 /* missing Plapack prototypes: */ … … 19 19 /*our own patches: */ 20 20 #ifdef _HAVE_PETSC_ 21 #include " patches/petscpatches.h"21 #include "./patches/petscpatches.h" 22 22 #endif 23 23
Note:
See TracChangeset
for help on using the changeset viewer.