Re: [petsc-dev] [PATCH] config: test functions and headers only once
Matt, would you like to go about this differently, maybe by preventing duplicates from appearing in the first place? Jed Brown <[email protected]> writes:
Many functions and headers are mentioned in both BuildSystem and PETSc, thus being tested more than once. Removing this redundancy speeds up my configure from 125 seconds to 110 seconds. ---
[...]
I have not de-duplicated libraries.py yet because it passes in more structured arguments. It only runs a few tests multiple times:
[(['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes'), (['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes')]
These are actually all defined in one place, but it is visited multiple times:
/home/jed/petsc/mpich-basic/conf/reconfigure-mpich-basic.py(12)<module>() -> configure.petsc_configure(configure_options) /home/jed/petsc/config/configure.py(290)petsc_configure() -> framework = config.framework.Framework(['--configModules=PETSc.Configure','--optionsModule=PETSc.compilerOptions']+sys.argv[1:], loadArgDB = 0) /home/jed/petsc/config/BuildSystem/config/framework.py(110)__init__() -> self.createChildren() /home/jed/petsc/config/BuildSystem/config/framework.py(319)createChildren() -> self.getChild(moduleName) /home/jed/petsc/config/BuildSystem/config/framework.py(304)getChild() -> config.setupDependencies(self)
/home/jed/petsc/config/PETSc/Configure.py(105)setupDependencies() -> self.libraries.libraries.extend(libraries1)
/home/jed/petsc/mpich-basic/conf/reconfigure-mpich-basic.py(12)<module>() -> configure.petsc_configure(configure_options) /home/jed/petsc/config/configure.py(293)petsc_configure() -> framework.configure(out = sys.stdout) /home/jed/petsc/config/BuildSystem/config/framework.py(929)configure() -> self.updateDependencies() /home/jed/petsc/config/BuildSystem/config/framework.py(385)updateDependencies() -> child.setupDependencies(self)
/home/jed/petsc/config/PETSc/Configure.py(105)setupDependencies() -> self.libraries.libraries.extend(libraries1)
Matt, can we avoid visiting here more than once?
config/BuildSystem/config/functions.py | 4 ++++ config/BuildSystem/config/headers.py | 4 ++++ 2 files changed, 8 insertions(+)
diff --git a/config/BuildSystem/config/functions.py b/config/BuildSystem/config/functions.py index 30da45e..7b700cb 100644 --- a/config/BuildSystem/config/functions.py +++ b/config/BuildSystem/config/functions.py @@ -197,5 +197,9 @@ choke me self.executeTest(self.checkSignalHandlerType) self.executeTest(self.checkFreeReturnType) self.executeTest(self.checkVariableArgumentLists) + try: + self.functions = list(set(self.functions)) + except: + pass
I put in this guard because I thought set() was python-2.5. Evidently it is in python-2.4, so we're safe, provided the list contains only hashable objects. It should, right?
map(lambda function: self.executeTest(self.check, function), self.functions) return diff --git a/config/BuildSystem/config/headers.py b/config/BuildSystem/config/headers.py index e180eaa..f3da45c 100644 --- a/config/BuildSystem/config/headers.py +++ b/config/BuildSystem/config/headers.py @@ -230,6 +230,10 @@ class Configure(config.base.Configure): self.executeTest(self.checkSysWait) self.executeTest(self.checkTime) self.executeTest(self.checkMath) + try: + self.headers = list(set(self.headers)) + except: + pass map(lambda header: self.executeTest(self.check, header), self.headers) self.executeTest(self.checkRecursiveMacros) return -- 1.8.2.1
participants (1)
-
Jed Brown