problem with PetscSynchronizedFPrintf (fwd)

Barry Smith bsmith at mcs.anl.gov
Mon Jul 21 15:03:27 CDT 2008


   Matt,

     You have to be careful here. You use PetscMalloc() here, are you  
positive this
routine will never be called BEFORE PetscMalloc() is setup for  
(sometime in PetscInitialize), or after PetscMalloc()
is taken down (somewhere in PetscFinalize())? Is there someway you can  
make sure that
it is safe? In a few places on setup I have to use a raw malloc  
instead of PetscMalloc(), I don't
want you to have to do that here.

   I'm not saying to change back the code, just to be careful and  
check it.

    Barry

On Jul 21, 2008, at 2:47 PM, Matthew Knepley wrote:

> I made this change because synchronized printing was cutting off my
> stuff. Now the queue is dynamically allocated so it can accomodate
> any size string.
>
> I tried ex7 and it runs fine for me, even under valgrind.
>
> Shi, can you reproduce this with a Sieve example?
>
>  Matt
>
> On Mon, Jul 21, 2008 at 2:37 PM, Satish Balay <balay at mcs.anl.gov>  
> wrote:
>> Looks like this could be related to changeset 9e3fbe04a926
>>
>> --> mprint.h <--
>>
>> -  char        string[QUEUESTRINGSIZE];
>> +  char       *string;
>>
>> So now strings needs to use malloc()/free()?
>>
>> Matt - you can reproduce this issue with dm/ao/examples/tests/ex7.c
>>
>> Satish
>>
>> On Mon, 21 Jul 2008, Satish Balay wrote:
>>
>>>
>>> ---------- Forwarded message ----------
>>> Date: Sun, 20 Jul 2008 22:39:13 -0700 (PDT)
>>> From: Shi Jin <jinzishuai at yahoo.com>
>>> Subject: problem with PetscSynchronizedFPrintf
>>> To: petsc-dev at mcs.anl.gov
>>>
>>> Hi,
>>>
>>> I recently updated my petsc-dev and found my previously working  
>>> code is having trouble running in parallel. I've narrowed it down  
>>> to the calls to PetscSynchronizedFPrintf. Even if I don't have  
>>> those, I will have errors at the end of my MPI runs like:
>>> [1]PETSC ERROR: PetscMemzero() line 189 in src/sys/utils/memc.c
>>> [1]PETSC ERROR: PetscViewerASCIISynchronizedPrintf() line 859 in  
>>> src/sys/viewer/impls/ascii/filev.c
>>> [1]PETSC ERROR: PetscMemoryShowUsage() line 367 in src/sys/memory/ 
>>> mtr.c
>>> [1]PETSC ERROR: PetscFinalize() line 675 in src/sys/objects/pinit.c
>>> [1]PETSC ERROR: completeSection() line 163 in main.cxx
>>> [0]0:Return code = 0, signaled with Interrupt
>>> [0]1:Return code = 85
>>>
>>> Since the same code was running fine before the update. I am  
>>> wondering if it is something recently introduced.
>>> Thanks a lot.
>>>
>>> --
>>> Shi Jin, PhD
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> -- 
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> their experiments lead.
> -- Norbert Wiener
>




More information about the petsc-dev mailing list