Changeset 13598


Ignore:
Timestamp:
10/10/12 22:32:31 (12 years ago)
Author:
Eric.Larour
Message:

CHG: more changes to switch from my_rank and num_procs to IssmComm::GetSize and IssmComm::GetRank

Location:
issm/trunk-jpl/src/c/toolkits
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatMultPatch.cpp

    r13595 r13598  
    1818/*Function prototypes: */
    1919int MatMultCompatible(Mat A,Vec x,COMM comm);
    20 void VecRelocalize(Vec* outvector,Vec vector,int m);
     20void VecRelocalize(Vec* outvector,Vec vector,int m,COMM comm);
    2121
    2222void MatMultPatch(Mat A,Vec X, Vec AX,COMM comm){ //same prototype as MatMult in Petsc
     
    3232        else{
    3333                MatGetLocalSize(A,&m,&n);;
    34                 VecRelocalize(&X_rel,X,n);
     34                VecRelocalize(&X_rel,X,n,comm);
    3535                MatMult(A,X_rel,AX); ;
    3636                #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)
     
    6969}
    7070
    71 void VecRelocalize(Vec* poutvector,Vec vector,int m){
     71void VecRelocalize(Vec* poutvector,Vec vector,int m,COMM comm){
    7272
    7373        /*vector index and vector values*/
     
    8080       
    8181        /*Create outvector with local size m*/
    82         VecCreate(PETSC_COMM_WORLD,&outvector); ;
     82        VecCreate(comm,&outvector); ;
    8383        VecSetSizes(outvector,m,PETSC_DECIDE); ;
    8484        VecSetFromOptions(outvector); ;
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp

    r13056 r13598  
    1515void PlapackInvertMatrixLocalCleanup(PLA_Obj* pa,PLA_Template* ptempl,double** parrayA,int** pidxnA,MPI_Comm* pcomm_2d);
    1616       
    17 int PlapackInvertMatrix(Mat* A,Mat* inv_A,int status,int con){
     17int PlapackInvertMatrix(Mat* A,Mat* inv_A,int status,int con,COMM comm){
    1818        /*inv_A does not yet exist, inv_A was just allocated, that's all*/
    1919
     
    7676        if(PLA_Initialized(NULL)==TRUE)PLA_Finalize();
    7777        /* Create a 2D communicator */
    78         PLA_Comm_1D_to_2D(MPI_COMM_WORLD,nprows,npcols,&comm_2d);
     78        PLA_Comm_1D_to_2D(comm,nprows,npcols,&comm_2d);
    7979
    8080        /*Initlialize plapack: */
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackToPetsc.cpp

    r12431 r13598  
    66#include "../plapackincludes.h"
    77
    8 int PlapackToPetsc(Mat* A,int local_mA,int local_nA,int mA,int nA,MatType type,PLA_Obj a,PLA_Template templ,int nprows,int npcols,int nb){
     8int PlapackToPetsc(Mat* A,int local_mA,int local_nA,int mA,int nA,MatType type,PLA_Obj a,PLA_Template templ,int nprows,int npcols,int nb,COMM comm){
    99
    1010       
     
    2828                d_nz=nA/2;
    2929                o_nz=nA/2;
    30                 MatCreateMPIAIJ(MPI_COMM_WORLD,local_mA,local_nA, mA,nA,d_nz,PETSC_NULL,o_nz,PETSC_NULL,A);
     30                MatCreateMPIAIJ(comm,local_mA,local_nA, mA,nA,d_nz,PETSC_NULL,o_nz,PETSC_NULL,A);
    3131        }
    3232        else if(strcasecmp_eq(type,MATMPIDENSE)){
    33                 MatCreateMPIDense(MPI_COMM_WORLD,local_mA,local_nA, mA,nA,PETSC_NULL,A);
     33                MatCreateMPIDense(comm,local_mA,local_nA, mA,nA,PETSC_NULL,A);
    3434        }
    3535       
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/plapackpatches.h

    r831 r13598  
    66#define _PLAPACK_PATCHES_H_
    77
    8 int PlapackInvertMatrix(Mat* A,Mat* inv_A,int status,int con);
    9 int PlapackToPetsc(Mat* A,int local_mA,int local_nA,int mA,int nA,MatType type,PLA_Obj a,PLA_Template templ,int nprows,int npcols,int nb);
     8int PlapackInvertMatrix(Mat* A,Mat* inv_A,int status,int con,COMM comm);
     9int PlapackToPetsc(Mat* A,int local_mA,int local_nA,int mA,int nA,MatType type,PLA_Obj a,PLA_Template templ,int nprows,int npcols,int nb,COMM comm);
    1010int CyclicalFactorization(int* pnprows,int* pnpcols,int num_procs);
    1111
Note: See TracChangeset for help on using the changeset viewer.