[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speeding up ATLAS build time


Here is the latest set of patches using the new method I mentioned
last week.  On my 450MHz dual processor Pentium II with the new
PMAKE stuff, it took 19min to build ATLAS from scratch, while the
original code took 29min to build from scratch.  (Note that I used the
suggested configuration because my machine is "recognized" by
ATLAS; I didn't force it to do the full search.)  I looked through the
SUMMARY.LOG files for both builds, and it seems that both builds
chose the same configurations, so I think I didn't introduce any
dependency errors.

At any rate, here is the design I am using:

	PMAKE = $(MAKE) -j 4

	obj = tst.o tst2.o
	dlib :
	        $(PMAKE) lib.grd
	lib.grd : $(obj)
	        ar r tst.a $(obj)
	        touch lib.grd

Basically the old code used to simply have:

	obj = tst.o tst2.o
	dlib : lib.grd
	lib.grd : $(obj)
	        ar r tst.a $(obj)
	        touch lib.grd

I moved lib.grd from the dependency line to a build line, with PMAKE 
because lib.grd doesn't recursively call MAKE on its own, and this 
way we can compile all the .o files in parallel.

One of the things I had to be careful to avoid was allowing multiple
precisions to be built at once because each precision does an "ar"
on the same library file.  If two precisions are doing "ar" on the same
library file at once, then the resulting library file is usually incomplete 
or corrupted.

While I am not sure that I have identified and utilized every possible
place to introduce parallelism, at least on my machine I have already
gotten a 34% speedup for a dual processor machine.

If you have any comments/questions/problems/suggestions, please
let me know.




[(hp)]	Carl Staelin
	Senior Research Scientist
	Hewlett-Packard Laboratories
	Technion City
	Haifa, 32000
	+972(4)823-1237x221	+972(4)822-0407 fax