Changeset 20010


Ignore:
Timestamp:
01/27/16 22:18:21 (9 years ago)
Author:
Eric.Larour
Message:

CHG: call assemble routine for each step, because otherwise Petsc starts buffering huge amounts
of data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r20007 r20010  
    22162216        IssmDouble  eartharea=0;
    22172217        IssmDouble  eartharea_cpu=0;
    2218         int         ns;
     2218        int         ns,nsmax;
    22192219       
    22202220        /*Go through elements, and add contribution from each element to the deflection vector wg:*/
     
    22332233        ISSM_MPI_Bcast(&eartharea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
    22342234
     2235        /*Figure out max of ns: */
     2236        ISSM_MPI_Reduce(&ns,&nsmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm());
     2237        ISSM_MPI_Bcast(&nsmax,1,ISSM_MPI_INT,0,IssmComm::GetComm());
     2238
    22352239        /*Call the sea level rise core: */
    2236         for(int i=0;i<ns;i++){
     2240        for(int i=0;i<nsmax;i++){
     2241                if(i<ns){
    22372242               
    2238                 if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << "      convolution progress: " << (float)i/(float)ns*100 << "\%");
    2239        
    2240                 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
    2241                 element->SealevelriseEustatic(pSgi,&eustatic_cpu_e,latitude,longitude,radius,oceanarea,eartharea);
    2242                 eustatic_cpu+=eustatic_cpu_e;
     2243                        if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << "      convolution progress: " << (float)i/(float)ns*100 << "\%");
     2244               
     2245                        Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     2246                        element->SealevelriseEustatic(pSgi,&eustatic_cpu_e,latitude,longitude,radius,oceanarea,eartharea);
     2247                        eustatic_cpu+=eustatic_cpu_e;
     2248                }
     2249                pSgi->Assemble();
    22432250        }
    22442251        if(IssmComm::GetRank()==0)if(VerboseConvergence())_printf_("\n");
     
    22632270        IssmDouble  eartharea_cpu=0;
    22642271
    2265         int         ns;
     2272        int         ns,nsmax;
    22662273       
    22672274        /*Serialize vectors from previous iteration:*/
     
    22702277        /*Go through elements, and add contribution from each element to the deflection vector wg:*/
    22712278        ns = elements->Size();
    2272 
     2279       
    22732280        /*First, figure out the area of the ocean, which is needed to compute the eustatic component: */
    22742281        for(int i=0;i<ns;i++){
     
    22832290        ISSM_MPI_Bcast(&eartharea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
    22842291
     2292        /*Figure out max of ns: */
     2293        ISSM_MPI_Reduce(&ns,&nsmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm());
     2294        ISSM_MPI_Bcast(&nsmax,1,ISSM_MPI_INT,0,IssmComm::GetComm());
     2295
    22852296        /*Call the sea level rise core: */
    2286         for(int i=0;i<ns;i++){
    2287 
    2288                 if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << "      convolution progress: " << (float)i/(float)ns*100 << "\%");
    2289                
    2290                 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
    2291                 element->SealevelriseNonEustatic(pSgo, Sg_old,latitude,longitude,radius,oceanarea,eartharea);
     2297        for(int i=0;i<nsmax;i++){
     2298                if(i<ns){
     2299
     2300                        if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << "      convolution progress: " << (float)i/(float)ns*100 << "\%");
     2301
     2302                        Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     2303                        element->SealevelriseNonEustatic(pSgo, Sg_old,latitude,longitude,radius,oceanarea,eartharea);
     2304                }
     2305                pSgo->Assemble();
    22922306        }
    22932307        if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())_printf_("\n");
    2294 
    22952308
    22962309        /*Free ressources:*/
Note: See TracChangeset for help on using the changeset viewer.