19 int main(
int argCount,
char **argValue)
22 MPI_Init(&argCount,&argValue);
24 const int rank = Comm.MyPID();
27 int nGlobalElements = 10000;
44 const int numEntries = 1;
46 for (
int globalRowIdx=0; globalRowIdx<nGlobalElements; ++globalRowIdx) {
47 indices[0] = globalRowIdx;
48 values[0] = 3.2 + globalRowIdx*0.01;
50 if (globalRowIdx % 5000 == 0) {
51 cerr <<
"About to insert row " << globalRowIdx <<
"\n";
54 ierr =
A.InsertGlobalValues( globalRowIdx, numEntries,
55 (
const double *)&values[0],
56 (
const int *)&indices[0] );
62 double insertionTime = 0;
64 time_t endTime = time(0);
65 insertionTime = difftime(endTime, startTime);
69 ierr =
A.GlobalAssemble();
73 cerr <<
"insertion time = " << insertionTime <<
" (seconds)\n";
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_MpiComm: The Epetra MPI Communication Class.
Epetra Finite-Element CrsMatrix.
int main(int argc, char *argv[])