Changeset 14864


Ignore:
Timestamp:
05/02/13 18:39:09 (12 years ago)
Author:
Eric.Larour
Message:

NEW: implemented a new hook up for the ISSM toolkit to the MUMPS solver, witout recourse to the Petsc
library. Needs V&V still, but I can get test101 to run. No success yet.

Location:
issm/trunk-jpl/src/c
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Makefile.am

    r14792 r14864  
    768768
    769769#}}}
     770#Mumps sources  {{{
     771mumps_sources=      ./toolkits/mumps\
     772                                        ./toolkits/mumps/mumpsincludes.h\
     773                                        ./toolkits/mumps/MpiDenseMumpsSolve.cpp
     774#}}}
    770775#Mpi sources  {{{
    771776mpi_sources= ./toolkits/mpi/mpiincludes.h\
     
    866871endif
    867872
     873if MUMPS
     874issm_sources  +=  $(mumps_sources)
     875endif
     876
    868877if TRANSIENT
    869878issm_sources  +=  $(transient_sources)
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMat.h

    r14834 r14864  
    208208                        outvector->vector=this->matrix->Solve(pf->vector,parameters);
    209209
     210                        return outvector;
     211
    210212                }/*}}}*/
    211213
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h

    r14858 r14864  
    2525#include "../../classes/IssmComm.h"
    2626#include "../../classes/objects/Bucket.h"
    27 #include "../../toolkits/toolkits.h"
     27#include "../mumps/mumpsincludes.h"
     28#include "./IssmMpiVec.h"
    2829#include <math.h>
    2930
     
    6970                /*}}}*/
    7071                /*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){
    7273                        /*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);
    7486                }
    7587                /*}}}*/
     
    604616                IssmAbsVec<IssmDouble>* Solve(IssmAbsVec<IssmDouble>* pfin, Parameters* parameters){
    605617
     618                        int i;
     619                       
     620                        /*output: */
     621                        IssmMpiVec<IssmDouble>* uf=NULL;
     622                        IssmMpiVec<IssmDouble>* pf=NULL;
     623
    606624                        /*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();
    608629
    609630                        /*Let's try and use the MUMPS solver here: */
    610631                        #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);
    612633                        #else
    613634                        _error_("IssmMpiDenseMat solver requires MUMPS solver");
    614635                        #endif
     636                        return (IssmAbsVec<IssmDouble>*)uf;
    615637
    616638                }/*}}}*/
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h

    r14834 r14864  
    6060                }
    6161                /*}}}*/
     62                /*FUNCTION IssmMpiVec(int m,int M){{{*/
     63                IssmMpiVec(int min, int Min){
     64                        this->Init(min,true);
     65                }
     66                /*}}}*/
    6267                /*FUNCTION IssmMpiVec(int M,bool fromlocalsize){{{*/
    6368                IssmMpiVec(int Min, bool fromlocalsize){
     
    7176
    7277                        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){
    7392                                this->vector=xNew<doubletype>(this->m);
    7493                                xMemCpy<doubletype>(this->vector,buffer,this->m);
     
    119138                                                printf("row %i %g",j,this->vector[j]);
    120139                                        }
     140                                        printf("\n");
    121141                                }
    122142                                MPI_Barrier(IssmComm::GetComm());
     
    437457                IssmMpiVec<doubletype>* Duplicate(void){
    438458
    439                         return new IssmMpiVec<doubletype>(this->vector,this->M);
     459                        return new IssmMpiVec<doubletype>(this->vector,this->M,this->m);
    440460
    441461                }
  • issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h

    r14822 r14864  
    4242                /*IssmVec constructors, destructors*/
    4343                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;
    6045                }
    6146                /*}}}*/
Note: See TracChangeset for help on using the changeset viewer.