<div class="gmail_quote">On Mon, Feb 14, 2011 at 20:43, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>This code</div><div><br></div><div>
<div> for(i = 0; i < 10000; ++i) {</div><div> std::ostringstream trial;</div><div> FILE *fp;</div><div><br></div><div> trial << "dft_" << std::setw(5) << std::setfill('0') << i << ".py";</div>
<div> //ierr = PetscExceptionTry1(PetscFOpen(PETSC_COMM_WORLD, trial.str().c_str(), "r", &fp), PETSC_ERR_FILE_OPEN);</div><div> ierr = PetscFOpen(PETSC_COMM_WORLD, trial.str().c_str(), "r", &fp);</div>
<div> if (ierr == PETSC_ERR_FILE_OPEN) break;</div><div> ierr = PetscFClose(PETSC_COMM_WORLD, fp);CHKERRQ(ierr);</div><div> }</div></div><div><br></div><div>produces the following printout</div></blockquote></div>
<br><div>You need to PetscPushErrorHandler(PetscReturnErrorHandler,0);</div>