[petsc-dev] Patch for ksp tutorial ex56

Hong hzhang at mcs.anl.gov
Tue Mar 10 20:12:29 CDT 2015


Sascha:
I'll replace *.txt file with a C-array to simply ex56.c.
Please ignore my previous request.

Hong

Hong,
> I do not have an immediate explanation for this. In particular, I wonder
> why
> there is no line break after 'sp=/' in this line:
> > file = 0x0, sp=/,fname=/Users/Hong/soft/petsc/
> but line breaks in the file path.
>
> On my machine I tested with make runex56, too. I will look at this again
> tomorrow.
> Can anyone else confirm this issue?
>
> Sascha
>
>
>
> On 10 Mar 2015, at 22:22, Hong <hzhang at mcs.anl.gov> wrote:
>
> > Sascha:
> > I prepared a patch regarding the reading of the data file in ksp
> tutorial ex56.
> > It sets the path to the data file required for running the example
> relative to PETSC_DIR
> > instead of relative to the tutorials folder to allow running the example
> from any folder.
> >
> > Also, I used PETSC_DIR_SEPARATOR instead of the currently hard coded ‘/‘
> > so that the code would also run on a windows machine … if anyone cared.
> > This fails on my MacPro by running 'make runex56':
> >
> > file = 0x0, sp=/,fname=/Users/Hong/soft/petsc/
> > src/
> > ksp/
> > ksp/
> > examples/
> > tutorials/
> > data/
> > elem_3d_elast_v_25.txt
> >         main failed to open input file '/Users/Hong/soft/petsc/
> >
> > I added
> > file = fopen(fname, "r");
> >       printf("file = %p, sp=%s,fname=%s\n",file,sp,fname);
> >       if (file == 0) {
> >
> > as you see, 'sp=/' is followed by a 'new line'.
> > I do not see this behavior on other machines, e.g., linux or an old iMac.
> > Any suggestion?
> >
> > Hong
> >
> >
> > Please discard the patch if you do not want to change the current
> behavior.
> >
> > Best,
> > Sascha
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150310/05fdfc9f/attachment.html>


More information about the petsc-dev mailing list