[petsc-users] Error when trying to write solution to a file
Miguel Angel Salazar de Troya
salazardetroya at gmail.com
Tue Oct 7 11:47:12 CDT 2014
Hi all
I'm solving a discretized PDE with TS. Inside my MonitorFunction(), hooked
up with TSMonitorSet(), I process the solution at each time step to write
another PETSc Vec. Then, I write this Vec to a matlab binary file. The name
of the binary file is the time step. I save it inside of the folder
"ForceHistory"
// File name
PetscViewer viewer;
std::string filehistory("ForceHistory/");
std::ostringstream temp;
temp << step;
filehistory.append(temp.str());
filehistory.append(".mat");
// Open and set Binary file
PetscViewerBinaryOpen(PETSC_COMM_WORLD,filehistory.c_str(),FILE_MODE_WRITE,&viewer);
PetscViewerSetFormat(viewer, PETSC_VIEWER_BINARY_MATLAB);
// Print
VecView(Context->Felement,viewer);
It works well until I reach the time step number 509. Beyond that time
step, I get errors like this:
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Unable to open file
[0]PETSC ERROR: Cannot create file ForceHistory/758.mat for writing
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014
[0]PETSC ERROR: ./beads on a linux-mpich named miguelito by miguel Tue Oct
7 11:20:51 2014
[0]PETSC ERROR: Configure options --download-hypre=yes --download-metis
--download-ml=yes --download-mpich --download-mumps --download-parmetis
--download-scalapack --download-superilu
--with-blas-lib=/usr/lib/libblas.so --with-language=cxx
--with-lapack-lib=/usr/lib/liblapack.so PETSC_ARCH=linux-mpich
--download-chaco
[0]PETSC ERROR: #2242 PetscViewerFileSetName_Binary() line 1102 in
/home/miguel/petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c
[0]PETSC ERROR: #2243 PetscViewerFileSetName() line 624 in
/home/miguel/petsc-3.5.2/src/sys/classes/viewer/impls/ascii/filev.c
[0]PETSC ERROR: #2244 PetscViewerBinaryOpen() line 711 in
/home/miguel/petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Write to file failed
[0]PETSC ERROR: Error writing to file total size 2 err -1 wsize 8
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014
[0]PETSC ERROR: ./beads on a linux-mpich named miguelito by miguel Tue Oct
7 11:20:51 2014
[0]PETSC ERROR: Configure options --download-hypre=yes --download-metis
--download-ml=yes --download-mpich --download-mumps --download-parmetis
--download-scalapack --download-superilu
--with-blas-lib=/usr/lib/libblas.so --with-language=cxx
--with-lapack-lib=/usr/lib/liblapack.so PETSC_ARCH=linux-mpich
--download-chaco
[0]PETSC ERROR: #2245 PetscBinaryWrite() line 401 in
/home/miguel/petsc-3.5.2/src/sys/fileio/sysio.c
[0]PETSC ERROR: #2246 PetscBinarySynchronizedWrite() line 656 in
/home/miguel/petsc-3.5.2/src/sys/fileio/sysio.c
[0]PETSC ERROR: #2247 PetscViewerBinaryWrite() line 817 in
/home/miguel/petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c
[0]PETSC ERROR: #2248 VecView_MPI_Binary() line 372 in
/home/miguel/petsc-3.5.2/src/vec/vec/impls/mpi/pdvec.c
[0]PETSC ERROR: #2249 VecView_MPI() line 837 in
/home/miguel/petsc-3.5.2/src/vec/vec/impls/mpi/pdvec.c
[0]PETSC ERROR: #2250 VecView() line 604 in
/home/miguel/petsc-3.5.2/src/vec/vec/interface/vector.c
For some reason, it cannot create more files. It's not that I ran out of
space in the disk or that no more files can't be created in that folder.
Any suggestion? Thanks.
Miguel
--
*Miguel Angel Salazar de Troya*
Graduate Research Assistant
Department of Mechanical Science and Engineering
University of Illinois at Urbana-Champaign
(217) 550-2360
salaza11 at illinois.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141007/78c74f4f/attachment-0001.html>
More information about the petsc-users
mailing list