1 #ifndef lint 2 static char vcid[] = "$Id: gcreate.c,v 1.10 1995/04/09 20:30:03 curfman Exp bsmith $"; 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 (OptionsHasName(0,0,"-row_mat")) { 30 return MatCreateSequentialRow(comm,m,n,10,0,V); 31 } 32 if (numtid > 1 || OptionsHasName(0,0,"-mpi_objects")) { 33 if (OptionsHasName(0,0,"-row_mat")) { 34 return MatCreateMPIRow(comm,PETSC_DECIDE,PETSC_DECIDE, m,n,5,0,0,0,V); 35 } 36 if (OptionsHasName(0,0,"-rowbs_mat")) { 37 return MatCreateMPIRowbs(comm,PETSC_DECIDE,m,5,0,0,V); 38 } 39 return MatCreateMPIAIJ(comm,PETSC_DECIDE,PETSC_DECIDE, m,n,5,0,0,0,V); 40 } 41 return MatCreateSequentialAIJ(comm,m,n,10,0,V); 42 } 43 44