[petsc-users] static libs

Jed Brown jed at jedbrown.org
Thu Feb 20 15:46:36 CST 2020


Yeah, this startup is typically not bad for normal compiled programs,
but can be substantial if you have many libraries or are using a
language like Python, which may search hundreds or thousands of paths.
In any case, it's mainly a filesystem metadata scalability stress, and
one reason some people like to use containers.

Making private symbols private helps improve the performance of symbol
relocation (a sequential operation).  People rarely care about this in
scientific software since the actual symbol relocation rarely takes more
than a second or two.  Those interested in symbol visibility and
optimizing startup time for shared libraries can check out this classic
guid.

  https://www.akkadia.org/drepper/dsohowto.pdf

Junchao Zhang via petsc-users <petsc-users at mcs.anl.gov> writes:

> Copy & paste from a Cray paper:
> "The main disadvantage of dynamic shared libraries is the runtime
> performance costs of dynamic linking. Every time the program is executed it
> has to perform a large part of its linking process. The lookup of symbols
> in a dynamic shared library is much less efficient than in static
> libraries. The loading of a dynamic shared library during an application‟s
> execution may result in a “jitter” effect where a single process holds up
> the forward progress of other processes of the application while it is
> loading a library. "
>
> BTW,  Cori's default is changed from static to dynamic.  I heard Frontier
> will also use dynamic.
>
> --Junchao Zhang
>
>
> On Thu, Feb 20, 2020 at 2:03 PM Amil Sharma via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
>> Just wondering if static linking is better for performance?
>>
>> On Thu, Feb 20, 2020 at 2:58 PM Albert Mollen <amollen at pppl.gov> wrote:
>>
>>> Hi Mark,
>>> I'm trying to rebuild Adios2 with dynamic linking on cori. Hopefully we
>>> can move over to that.
>>>
>>> Best regards
>>> ----------
>>> Albert Mollén
>>> Associate Research Physicist
>>>
>>> Theory Department
>>> Princeton Plasma Physics Laboratory
>>> P.O. Box 451
>>> Princeton, NJ 08543-0451
>>> USA
>>>
>>> Tel. +1 609-243-3909
>>> E-mail: amollen at pppl.gov
>>>
>>>
>>> On Thu, Feb 20, 2020 at 2:52 PM Amil Sharma <asharma at pppl.gov> wrote:
>>>
>>>> We need static linking in order to link an existing static IO library,
>>>> but we did not know the PETSc static build configure option.
>>>>
>>>> On Thu, Feb 20, 2020 at 2:30 PM Satish Balay <balay at mcs.anl.gov> wrote:
>>>>
>>>>> BTW: What do you mean by 'Cray static library environment variable'? Is
>>>>> it CRAYPE_LINK_TYPE? What is set to? What problems are you having?
>>>>>
>>>>> One can get shared library build of PETSc working with:
>>>>>
>>>>> export CRAYPE_LINK_TYPE=dynamic
>>>>>
>>>>> Satish
>>>>>
>>>>> On Thu, 20 Feb 2020, Satish Balay via petsc-users wrote:
>>>>>
>>>>> > You can build PETSc statically with configure option:
>>>>> >
>>>>> > --with-shared-libraries=0
>>>>> >
>>>>> > Satish
>>>>> >
>>>>> > On Thu, 20 Feb 2020, Mark Adams wrote:
>>>>> >
>>>>> > > We are having problems linking with at Cray static library
>>>>> environment
>>>>> > > variable, that is required to link Adios, and IO package. How does
>>>>> one
>>>>> > > build with static PETSc libs?
>>>>> > > Thanks,
>>>>> > > Mark
>>>>> > >
>>>>> >
>>>>>
>>>>>


More information about the petsc-users mailing list