On Mon, Feb 14, 2011 at 1:40 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Feb 14, 2011, at 1:38 PM, Matthew Knepley wrote:<br>
<br>
> Do we have a replacement for this?<br>
<br>
</div>  Nope.<br>
<div class="im"><br>
> I was using it, but it seems to be broken<br>
> and now my code spits out annoying error messages to the screen.<br>
<br>
</div>  Handle the "exception" with "regular" code that does not call the SETERRQ() but instead "handles the problem" itself.</blockquote><div><br></div><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><div><br></div><div>
<div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div>[0]PETSC ERROR: Unable to open file!</div><div>[0]PETSC ERROR: Unable to open file dft_00001.py</div><div>!</div><div>
[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: Petsc Development HG revision: f77bf280bb316b4e138b482394ca6d06ce3b63cd  HG Date: Mon Jan 31 21:25:29 2011 -0600</div>
<div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div><div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div><div>[0]PETSC ERROR: See docs/index.html for manual pages.</div><div>
[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: /PETSc3/biology/dft-rfd/bin/arch-complex-fftw-debug/dft-fft-3d on a arch-comp named <a href="http://cohn0636n.rush.edu">cohn0636n.rush.edu</a> by knepley Mon Feb 14 13:25:35 2011</div>
<div>[0]PETSC ERROR: Libraries linked from /PETSc3/petsc/petsc-dev/arch-complex-fftw-debug/lib</div><div>[0]PETSC ERROR: Configure run at Thu Feb  3 11:53:58 2011</div><div>[0]PETSC ERROR: Configure options --PETSC_ARCH=arch-complex-fftw-debug --with-shared-libearies --with-dynamic-loading --download-mpich --download-fftw --with-clanguage=cxx --with-scalar-type=complex</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: PetscFOpen() line 63 in src/sys/fileio/mpiuopen.c</div></div><div><br></div><div>   Matt</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888"><br>
   Barry<br>
</font><div><div></div><div class="h5"><br>
><br>
>    Matt<br>
><br>
> --<br>
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
> -- Norbert Wiener<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>