[petsc-dev] Open solaris 64bit printf bug?

Barry Smith bsmith at mcs.anl.gov
Fri Sep 4 00:28:47 CDT 2015


  Oh yes, I'm an idiot, as if searching for %d would be enough. Fixed now I hope. 

  Thanks!

> On Sep 4, 2015, at 12:19 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> 
> Barry - I see the 'offset' related line changes are not in your commit.
> 
> [they are required for the clean diff on opensolaris]
> 
> Satish
> 
> On Thu, 3 Sep 2015, Barry Smith wrote:
> 
>> 
>>  Satish,
>> 
>>   Thanks. I have put in master and next. 
>> 
>>   I totally missed those, I was only looking at PetscSectionView(()
>> 
>>  Barry
>> 
>>> On Sep 3, 2015, at 11:30 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>>> 
>>> Perhaps the following is the fix?
>>> 
>>> Satish
>>> 
>>> -------------
>>> diff --git a/src/vec/vec/utils/vsection.c b/src/vec/vec/utils/vsection.c
>>> index 4923238..444c8ac 100644
>>> --- a/src/vec/vec/utils/vsection.c
>>> +++ b/src/vec/vec/utils/vsection.c
>>> @@ -22,7 +22,7 @@ PetscErrorCode PetscSectionVecView_ASCII(PetscSection s, Vec v, PetscViewer view
>>>    if ((s->bc) && (s->bc->atlasDof[p] > 0)) {
>>>      PetscInt b;
>>> 
>>> -      ierr = PetscViewerASCIISynchronizedPrintf(viewer, "  (%4d) dim %2d offset %3d", p+s->pStart, s->atlasDof[p], s->atlasOff[p]);CHKERRQ(ierr);
>>> +      ierr = PetscViewerASCIISynchronizedPrintf(viewer, "  (%4D) dim %2D offset %3D", p+s->pStart, s->atlasDof[p], s->atlasOff[p]);CHKERRQ(ierr);
>>>      for (i = s->atlasOff[p]; i < s->atlasOff[p]+s->atlasDof[p]; ++i) {
>>>        PetscScalar v = array[i];
>>> #if defined(PETSC_USE_COMPLEX)
>>> @@ -43,7 +43,7 @@ PetscErrorCode PetscSectionVecView_ASCII(PetscSection s, Vec v, PetscViewer view
>>>      }
>>>      ierr = PetscViewerASCIISynchronizedPrintf(viewer, "\n");CHKERRQ(ierr);
>>>    } else {
>>> -      ierr = PetscViewerASCIISynchronizedPrintf(viewer, "  (%4d) dim %2d offset %3d", p+s->pStart, s->atlasDof[p], s->atlasOff[p]);CHKERRQ(ierr);
>>> +      ierr = PetscViewerASCIISynchronizedPrintf(viewer, "  (%4D) dim %2D offset %3D", p+s->pStart, s->atlasDof[p], s->atlasOff[p]);CHKERRQ(ierr);
>>>      for (i = s->atlasOff[p]; i < s->atlasOff[p]+s->atlasDof[p]; ++i) {
>>>        PetscScalar v = array[i];
>>> #if defined(PETSC_USE_COMPLEX)
>>> @@ -87,7 +87,7 @@ PetscErrorCode PetscSectionVecView(PetscSection s, Vec v, PetscViewer viewer)
>>>    if (s->numFields) {
>>>      ierr = PetscViewerASCIIPrintf(viewer, "%s with %d fields\n", name, s->numFields);CHKERRQ(ierr);
>>>      for (f = 0; f < s->numFields; ++f) {
>>> -        ierr = PetscViewerASCIIPrintf(viewer, "  field %d with %d components\n", f, s->numFieldComponents[f]);CHKERRQ(ierr);
>>> +        ierr = PetscViewerASCIIPrintf(viewer, "  field %D with %D components\n", f, s->numFieldComponents[f]);CHKERRQ(ierr);
>>>        ierr = PetscSectionVecView_ASCII(s->field[f], v, viewer);CHKERRQ(ierr);
>>>      }
>>>    } else {
>>> --------------------
>>> 
>>> balay at n-gage:~/petsc.clone/src/dm/impls/plex/examples/tests$ make runex3_nonconforming_tensor_2
>>> 319,321c319,321
>>> < Null vector 0 is likely null vector|| A * v[0] || = 8.64582e-17
>>> < Null vector 1 is likely null vector|| A * v[1] || = 5.97914e-17
>>> < Null vector 2 is likely null vector|| A * v[2] || = 7.89038e-17
>>> ---
>>>> Null vector 0 is likely null vector|| A * v[0] || = 2.73185e-17
>>>> Null vector 1 is likely null vector|| A * v[1] || = 7.80433e-17
>>>> Null vector 2 is likely null vector|| A * v[2] || = 5.42673e-17
>>> /home/balay/petsc.clone/src/dm/impls/plex/examples/tests
>>> Possible problem with with runex3_nonconforming_tensor_2, diffs above
>>> 
>>> 
>>> On Thu, 3 Sep 2015, Barry Smith wrote:
>>> 
>>>> 
>>>> And just to annoy me I cannot get -start_in_debugger to work on that machine. Valgrind has no complaints on a Mac with the examples.
>>>> 
>>>> I've found some miss-use of PetscViewerASCIIPushSynchronized() and %d in parts of plex, I don't see how they could cause this problem but I am fixing them and will push that. Maybe we'll get lucky.
>>>> 
>>>> Barry
>>>> 
>>>>> On Sep 3, 2015, at 10:06 AM, Tobin Isaac <tisaac at ices.utexas.edu> wrote:
>>>>> 
>>>>> 
>>>>> Here's a partial diff from http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2015/09/03/examples_next_arch-opensolaris-misc_n-gage.log:
>>>>> 
>>>>>  232c232
>>>>>  <   field 0 with 2 components
>>>>>  ---
>>>>>> field 0 with 0 components
>>>>>  234,242c234,242
>>>>>  <   (   2) dim  2 offset   0 0.5 0
>>>>>  <   (   3) dim  2 offset   2 1 0
>>>>>  <   (   4) dim  2 offset   4 0 0.5
>>>>>  <   (   5) dim  2 offset   6 0.5 0.5
>>>>>  <   (   6) dim  2 offset   8 1 0.5
>>>>>  <   (   7) dim  2 offset  10 0 1
>>>>>  <   (   8) dim  2 offset  12 0.5 1
>>>>>  <   (   9) dim  2 offset  14 0.5 0.25
>>>>>  <   (  10) dim  2 offset  16 0.25 0.5
>>>>>  ---
>>>>>> (   2) dim  0 offset   2 0.5 0
>>>>>> (   3) dim  0 offset   2 1 0
>>>>>> (   4) dim  0 offset   2 0 0.5
>>>>>> (   5) dim  0 offset   2 0.5 0.5
>>>>>> (   6) dim  0 offset   2 1 0.5
>>>>>> (   7) dim  0 offset   2 0 1
>>>>>> (   8) dim  0 offset   2 0.5 1
>>>>>> (   9) dim  0 offset   2 0.5 0.25
>>>>>> (  10) dim  0 offset   2 0.25 0.5
>>>>> 
>>>>> The numbers that printf is making 0 (or 2) clearly aren't, because
>>>>> they are used to iterate over a section and display its contents.  But
>>>>> other PetscInt's are printed fine elsewhere.  Weird.
>>>>> 
>>>>> Toby
>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 




More information about the petsc-dev mailing list