<div dir="ltr"><br><div class="gmail_extra">On Tue, Apr 30, 2013 at 11:49 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matt, would you like to go about this differently, maybe by preventing<br>
duplicates from appearing in the first place?<br></blockquote><div><br></div><div style>I was originally worried about state (like LIBS) since this is manipulated in autoconf.</div><div style>If we agree that all these checks should be stateless, we could do something with</div>
<div style>this toplevel check, like everyone registers the function/headers they are looking</div><div style>for in __init__() and we check up front.</div><div style><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> writes:<br>
<br>
> Many functions and headers are mentioned in both BuildSystem and PETSc,<br>
> thus being tested more than once.  Removing this redundancy speeds up my<br>
> configure from 125 seconds to 110 seconds.<br>
> ---<br>
<br>
[...]<br>
<br>
> I have not de-duplicated libraries.py yet because it passes in more<br>
> structured arguments.  It only runs a few tests multiple times:<br>
><br>
> [(['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes'), (['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes')]<br>
><br>
> These are actually all defined in one place, but it is visited multiple<br>
> times:<br>
><br>
>   /home/jed/petsc/mpich-basic/conf/reconfigure-mpich-basic.py(12)<module>()<br>
> -> configure.petsc_configure(configure_options)<br>
>   /home/jed/petsc/config/configure.py(290)petsc_configure()<br>
> -> framework = config.framework.Framework(['--configModules=PETSc.Configure','--optionsModule=PETSc.compilerOptions']+sys.argv[1:], loadArgDB = 0)<br>
>   /home/jed/petsc/config/BuildSystem/config/framework.py(110)__init__()<br>
> -> self.createChildren()<br>
>   /home/jed/petsc/config/BuildSystem/config/framework.py(319)createChildren()<br>
> -> self.getChild(moduleName)<br>
>   /home/jed/petsc/config/BuildSystem/config/framework.py(304)getChild()<br>
> -> config.setupDependencies(self)<br>
>> /home/jed/petsc/config/PETSc/Configure.py(105)setupDependencies()<br>
> -> self.libraries.libraries.extend(libraries1)<br>
><br>
><br>
>   /home/jed/petsc/mpich-basic/conf/reconfigure-mpich-basic.py(12)<module>()<br>
> -> configure.petsc_configure(configure_options)<br>
>   /home/jed/petsc/config/configure.py(293)petsc_configure()<br>
> -> framework.configure(out = sys.stdout)<br>
>   /home/jed/petsc/config/BuildSystem/config/framework.py(929)configure()<br>
> -> self.updateDependencies()<br>
>   /home/jed/petsc/config/BuildSystem/config/framework.py(385)updateDependencies()<br>
> -> child.setupDependencies(self)<br>
>> /home/jed/petsc/config/PETSc/Configure.py(105)setupDependencies()<br>
> -> self.libraries.libraries.extend(libraries1)<br>
<br>
Matt, can we avoid visiting here more than once?<br>
<br>
>  config/BuildSystem/config/functions.py | 4 ++++<br>
>  config/BuildSystem/config/headers.py   | 4 ++++<br>
>  2 files changed, 8 insertions(+)<br>
><br>
> diff --git a/config/BuildSystem/config/functions.py b/config/BuildSystem/config/functions.py<br>
> index 30da45e..7b700cb 100644<br>
> --- a/config/BuildSystem/config/functions.py<br>
> +++ b/config/BuildSystem/config/functions.py<br>
> @@ -197,5 +197,9 @@ choke me<br>
>        self.executeTest(self.checkSignalHandlerType)<br>
>      self.executeTest(self.checkFreeReturnType)<br>
>      self.executeTest(self.checkVariableArgumentLists)<br>
> +    try:<br>
> +      self.functions = list(set(self.functions))<br>
> +    except:<br>
> +      pass<br>
<br>
I put in this guard because I thought set() was python-2.5.  Evidently<br>
it is in python-2.4, so we're safe, provided the list contains only<br>
hashable objects.  It should, right?<br>
<br>
>      map(lambda function: self.executeTest(self.check, function), self.functions)<br>
>      return<br>
> diff --git a/config/BuildSystem/config/headers.py b/config/BuildSystem/config/headers.py<br>
> index e180eaa..f3da45c 100644<br>
> --- a/config/BuildSystem/config/headers.py<br>
> +++ b/config/BuildSystem/config/headers.py<br>
> @@ -230,6 +230,10 @@ class Configure(config.base.Configure):<br>
>      self.executeTest(self.checkSysWait)<br>
>      self.executeTest(self.checkTime)<br>
>      self.executeTest(self.checkMath)<br>
> +    try:<br>
> +      self.headers = list(set(self.headers))<br>
> +    except:<br>
> +      pass<br>
>      map(lambda header: self.executeTest(self.check, header), self.headers)<br>
>      self.executeTest(self.checkRecursiveMacros)<br>
>      return<br>
<span class="HOEnZb"><font color="#888888">> --<br>
> 1.8.2.1<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>