PETSc cannot read .mat Matlab files. It can only read files saved with the PetscBinaryWrite.m script that we provide.
Barry > On Jan 30, 2015, at 1:12 AM, siddhesh godbole <[email protected]> > wrote: > > hello, > i tried importing matlab file containing 10000 scalars to petsc. > > > [0]PETSC ERROR: Read from file failed > [0]PETSC ERROR: Error reading from file, errno 9 > [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: ./10D on a arch-linux2-c-debug named renoir by hridya Fri Jan > 30 12:32:52 2015 > [0]PETSC ERROR: Configure options --download-mpich > [0]PETSC ERROR: #1 PetscBinaryRead() line 275 in > /home/hridya/Downloads/petsc-3.5.2/src/sys/fileio/sysio.c > > > i dont understand why should it not import the file. Please help! > > > just in case for reference i have used following routines; > ierr = > PetscViewerBinaryOpen(PETSC_COMM_WORLD,"psi.mat",FILE_MODE_READ,&fd);CHKERRQ(ierr); > > PetscViewerBinaryGetDescriptor(fd,&REV); > PetscBinaryRead(REV,trial,trial,PETSC_SCALAR); > > > > > > Siddhesh M Godbole > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras
