1 #ifndef lint 2 static char vcid[] = "$Id: gcreate.c,v 1.12 1995/04/15 17:23:18 curfman Exp curfman $"; 3 #endif 4 5 #include "sys.h" 6 #include "options.h" 7 #include "sysio.h" 8 #include "mat.h" 9 10 /*@C 11 MatCreateInitialMatrix - Reads from command line to determine 12 what type of matrix to create. Also uses MPI matrices if 13 number processors in MPI_COMM_WORLD is greater then one. 14 15 Input Parameters: 16 . m,n - global matrix dimensions 17 . comm - MPI communicator 18 19 Output Parameter: 20 . V - location to stash resulting matrix 21 @*/ 22 int MatCreateInitialMatrix(MPI_Comm comm,int m,int n,Mat *V) 23 { 24 int numtid; 25 MPI_Comm_size(comm,&numtid); 26 if (OptionsHasName(0,0,"-dense_mat")) { 27 return MatCreateSequentialDense(comm,m,n,V); 28 } 29 if (numtid > 1 || OptionsHasName(0,0,"-mpi_objects")) { 30 if (OptionsHasName(0,0,"-row_mat")) { 31 return MatCreateMPIRow(comm,PETSC_DECIDE,PETSC_DECIDE, m,n,5,0,0,0,V); 32 } 33 #if defined(HAVE_BLOCKSOLVE) && !defined(PETSC_COMPLEX) 34 if (OptionsHasName(0,0,"-rowbs_mat")) { 35 return MatCreateMPIRowbs(comm,PETSC_DECIDE,m,5,0,0,V); 36 } 37 #endif 38 return MatCreateMPIAIJ(comm,PETSC_DECIDE,PETSC_DECIDE, m,n,5,0,0,0,V); 39 } 40 if (OptionsHasName(0,0,"-row_mat")) { 41 return MatCreateSequentialRow(comm,m,n,10,0,V); 42 } 43 return MatCreateSequentialAIJ(comm,m,n,10,0,V); 44 } 45 46