Changeset 18365


Ignore:
Timestamp:
08/12/14 11:39:10 (11 years ago)
Author:
srebuffi
Message:

BUG: fixed parallelization issue with dmax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp

    r18363 r18365  
    9494        }
    9595
     96        /*Broadcast max(dmax)*/
     97        IssmDouble dmax_all;
     98        ISSM_MPI_Reduce(&dmax,&dmax_all,1,ISSM_MPI_DOUBLE,ISSM_MPI_MAX,0,IssmComm::GetComm() );
     99        ISSM_MPI_Bcast(&dmax_all,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
     100        dmax = dmax_all;
     101
    96102        /*Penalize Dirichlet boundary*/
    97103        dmax = dmax * 1.e+3;
     
    209215        VecDuplicate(uvec,&Ri_plus);
    210216        VecDuplicate(uvec,&Ri_minus);
     217
     218        /*Get global extremas*/
     219        IssmDouble uLmin_global =  ulmin[0];
     220        IssmDouble uLmax_global =  ulmax[0];
     221        VecGetSize(uvec,&ncols);
     222        for(int i=1;i<ncols;i++) if(ulmin[i]<uLmin_global) uLmin_global = ulmin[i];
     223        for(int i=1;i<ncols;i++) if(ulmax[i]>uLmax_global) uLmax_global = ulmax[i];
     224        //printf("%g %g\n",uLmin_global,uLmax_global);
    211225
    212226        /*Go through D and calculate Ris*/
     
    234248                //double Qi_plus  = ml_serial[row]/deltat*(3. - u[row]);
    235249                //double Qi_minus = ml_serial[row]/deltat*(2. - u[row]);
    236                 double Qi_plus  = ml_serial[row]/deltat*(ulmax[row] - u[row]);
    237                 double Qi_minus = ml_serial[row]/deltat*(ulmin[row] - u[row]);
     250                //double Qi_plus  = ml_serial[row]/deltat*(ulmax[row] - u[row]);
     251                //double Qi_minus = ml_serial[row]/deltat*(ulmin[row] - u[row]);
     252                double Qi_plus  = ml_serial[row]/deltat*(uLmax_global - u[row]);
     253                double Qi_minus = ml_serial[row]/deltat*(uLmin_global - u[row]);
    238254                _assert_(Qi_plus  >= 0.);
    239255                _assert_(Qi_minus <= 0.);
     
    372388        CreateRHS(&RHS,K_petsc,D_petsc,Ml_petsc,uf->pvector->vector,theta,deltat,dmax,femmodel,configuration_type);
    373389        delete uf;
    374 
     390       
    375391        /*Go solve lower order solution*/
    376392        SolverxPetsc(&u,LHS,RHS,NULL,NULL, femmodel->parameters);
Note: See TracChangeset for help on using the changeset viewer.