<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div style="margin-bottom: 10pt; ">Hello, PETSc developers,</div>
<div style="margin-bottom: 10pt; ">        I have a question regarding the performance of PETSc TS solver expecially the TSTHETA. I used it to solve my DAE equations. There’re altogether 1152 functions in my IFunction(), and the Jacobian matrix in my IJacobian
is also of dimension 1152*1152.</div>
<div style="margin-bottom: 10pt; ">        The main TS code is set up as following:</div>
<div style="margin-bottom: 10pt; ">  ierr = TSCreate(PETSC_COMM_WORLD, &ts); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetType(ts, TSTHETA); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSThetaSetTheta(ts, 0.5); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetIFunction(ts, NULL, (TSIFunction) IFunction, &user); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  ierr = MatCreate(PETSC_COMM_WORLD, &J); CHKERRQ(ierr); // J: Jacobian matrix</div>
<div style="margin-bottom: 10pt; ">  ierr = MatSetSizes(J, PETSC_DECIDE, PETSC_DECIDE, 4*ngen, 4*ngen); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = MatSetFromOptions(J); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = MatSetUp(J); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetIJacobian(ts, J, J, (TSIJacobian) IJacobian, &user); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetDM(ts, da); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  ierr = formInitialSolution(ts, x, &user, t_step, t_width); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ftime = t_step[0] * t_width[0];</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetDuration(ts, PETSC_DEFAULT, ftime); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetSolution(ts, x); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetInitialTimeStep(ts, 0.0, t_width[0]); CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  ierr = TSSetFromOptions(ts);CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  ierr = TSSolve(ts,x);CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = TSGetTimeStepNumber(ts,&steps);CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; ">  ierr = PetscPrintf(PETSC_COMM_WORLD,"%D steps, ftime %G\n",steps,ftime);CHKERRQ(ierr);</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">  I have recorded the solution times when different numbers of processors are used:</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">2 processors: 1021 seconds,</div>
<div style="margin-bottom: 10pt; ">4 processors: 587.244 seconds,</div>
<div style="margin-bottom: 10pt; ">8 processors: 421.565 seconds,</div>
<div style="margin-bottom: 10pt; ">16 processors: 355.594 seconds,</div>
<div style="margin-bottom: 10pt; ">32 processors: 322.28 seconds,</div>
<div style="margin-bottom: 10pt; ">64 processors: 382.967 seconds.</div>
<div style="margin-bottom: 10pt; "> </div>
<div style="margin-bottom: 10pt; ">It seems like with 32 processors, it reaches the best performance. However, 322.28 seconds to solve such DAE equations is too slow than I expected.</div>
<div style="margin-bottom: 10pt; "><font face="Times New Roman, serif"> </font></div>
<div style="margin-bottom: 10pt; ">I have the following questions based on the above results:</div>
<ol style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 36pt; ">
<li style="margin-bottom: 10pt; ">Is this the usual DAE solving time in PETSc to for the problem with this dimension?</li><li style="margin-bottom: 10pt; ">I was told that in TS, by default, ksp uses GMRES, and the preconditioner is ILU(0), is there any other alterative ksp solver or options I should use in the command line to solve the problem much faster?</li><li style="margin-bottom: 10pt; ">Do you have any other suggestion for me to speed up the DAE computation in PETSc?</li></ol>
<div style="margin-bottom: 10pt; padding-left: 36pt; "><font face="Times New Roman, serif"> </font></div>
<div style="margin-bottom: 10pt; ">Thanks a lot!</div>
<div style="margin-bottom: 10pt; ">Shuangshuang</div>
<div style="margin-bottom: 10pt; "><font face="Times New Roman, serif"> </font></div>
<div style="margin-bottom: 10pt; "><font face="Times New Roman, serif"> </font></div>
</font>
</body>
</html>