11 int main(
int argCount,
char **argValue)
14 MPI_Init(&argCount,&argValue);
16 const int rank = Comm.MyPID();
19 int nGlobalElements = 1000000;
35 for (
int globalRowIdx=0; globalRowIdx<nGlobalElements; ++globalRowIdx) {
36 indices[0] = globalRowIdx;
37 values[0] = 3.2 + globalRowIdx*0.01;
39 if (globalRowIdx % 10000 == 0) {
40 std::cerr <<
"About to insert row " << globalRowIdx <<
"\n";
43 ierr = b.ReplaceGlobalValues(1, (
const int *)&indices[0],
44 (
const double *)&values[0]);
49 double insertionTime = 0;
51 time_t endTime = time(0);
52 insertionTime = difftime(endTime, startTime);
56 ierr = b.GlobalAssemble();
60 std::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 Vector.
int main(int argc, char *argv[])