Changeset 14864
- Timestamp:
- 05/02/13 18:39:09 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r14792 r14864 768 768 769 769 #}}} 770 #Mumps sources {{{ 771 mumps_sources= ./toolkits/mumps\ 772 ./toolkits/mumps/mumpsincludes.h\ 773 ./toolkits/mumps/MpiDenseMumpsSolve.cpp 774 #}}} 770 775 #Mpi sources {{{ 771 776 mpi_sources= ./toolkits/mpi/mpiincludes.h\ … … 866 871 endif 867 872 873 if MUMPS 874 issm_sources += $(mumps_sources) 875 endif 876 868 877 if TRANSIENT 869 878 issm_sources += $(transient_sources) -
issm/trunk-jpl/src/c/toolkits/issm/IssmMat.h
r14834 r14864 208 208 outvector->vector=this->matrix->Solve(pf->vector,parameters); 209 209 210 return outvector; 211 210 212 }/*}}}*/ 211 213 -
issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
r14858 r14864 25 25 #include "../../classes/IssmComm.h" 26 26 #include "../../classes/objects/Bucket.h" 27 #include "../../toolkits/toolkits.h" 27 #include "../mumps/mumpsincludes.h" 28 #include "./IssmMpiVec.h" 28 29 #include <math.h> 29 30 … … 69 70 /*}}}*/ 70 71 /*FUNCTION IssmMpiDenseMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/ 71 IssmMpiDenseMat(int m ,int n,int pM,int pN,int* d_nnz,int* o_nnz){72 IssmMpiDenseMat(int min,int nin,int Min,int Nin,int* d_nnz,int* o_nnz){ 72 73 /*not needed, we are fully dense!: */ 73 this->Init(pM,pN); 74 75 this->buckets=new DataSet(); 76 77 this->M=Min; 78 this->N=Nin; 79 this->m=min; 80 81 /*Initialize pointer: */ 82 this->matrix=NULL; 83 84 /*Allocate: */ 85 if (m*N)this->matrix=xNewZeroInit<doubletype>(this->m*N); 74 86 } 75 87 /*}}}*/ … … 604 616 IssmAbsVec<IssmDouble>* Solve(IssmAbsVec<IssmDouble>* pfin, Parameters* parameters){ 605 617 618 int i; 619 620 /*output: */ 621 IssmMpiVec<IssmDouble>* uf=NULL; 622 IssmMpiVec<IssmDouble>* pf=NULL; 623 606 624 /*Assume we are getting an IssmMpiVec in input, downcast: */ 607 IssmMpiVec<IssmDouble>* pf=(IssmMpiVec<IssmDouble>*)pfin; 625 pf=(IssmMpiVec<IssmDouble>*)pfin; 626 627 /*Initialize output: */ 628 uf=pf->Duplicate(); 608 629 609 630 /*Let's try and use the MUMPS solver here: */ 610 631 #ifdef _HAVE_MUMPS_ 611 632 MpiDenseMumpsSolve(/*output*/ uf->vector,uf->M,uf->m, /*stiffness matrix:*/ this->matrix,this->M,this->N,this->m, /*right hand side load vector: */ pf->vector,pf->M,pf->m); 612 633 #else 613 634 _error_("IssmMpiDenseMat solver requires MUMPS solver"); 614 635 #endif 636 return (IssmAbsVec<IssmDouble>*)uf; 615 637 616 638 }/*}}}*/ -
issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
r14834 r14864 60 60 } 61 61 /*}}}*/ 62 /*FUNCTION IssmMpiVec(int m,int M){{{*/ 63 IssmMpiVec(int min, int Min){ 64 this->Init(min,true); 65 } 66 /*}}}*/ 62 67 /*FUNCTION IssmMpiVec(int M,bool fromlocalsize){{{*/ 63 68 IssmMpiVec(int Min, bool fromlocalsize){ … … 71 76 72 77 if(this->M){ 78 this->vector=xNew<doubletype>(this->m); 79 xMemCpy<doubletype>(this->vector,buffer,this->m); 80 } 81 } 82 /*}}}*/ 83 /*FUNCTION IssmMpiVec(doubletype* serial_vec,int M,int m){{{*/ 84 IssmMpiVec(doubletype* buffer,int Min,int min){ 85 86 this->vector=NULL; 87 this->buckets=new DataSet(); 88 this->M=Min; 89 this->m=min; 90 91 if(this->m){ 73 92 this->vector=xNew<doubletype>(this->m); 74 93 xMemCpy<doubletype>(this->vector,buffer,this->m); … … 119 138 printf("row %i %g",j,this->vector[j]); 120 139 } 140 printf("\n"); 121 141 } 122 142 MPI_Barrier(IssmComm::GetComm()); … … 437 457 IssmMpiVec<doubletype>* Duplicate(void){ 438 458 439 return new IssmMpiVec<doubletype>(this->vector,this->M );459 return new IssmMpiVec<doubletype>(this->vector,this->M,this->m); 440 460 441 461 } -
issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h
r14822 r14864 42 42 /*IssmVec constructors, destructors*/ 43 43 IssmVec(){ /*{{{*/ 44 45 switch(IssmVecTypeFromToolkitOptions()){ 46 47 case SeqEnum: 48 this->vector=new IssmSeqVec<doubletype>(); 49 break; 50 case MpiEnum: 51 #ifdef _HAVE_MPI_ 52 this->vector=new IssmMpiVec<doubletype>(); 53 #else 54 _error_("Mpi vector requires compilation of MPI!"); 55 #endif 56 break; 57 default: 58 _error_("vector type not supported yet!"); 59 } 44 this->vector=NULL; 60 45 } 61 46 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.