On Sun, Jul 24, 2022 at 09:29:24PM +0800, Qian Yun wrote:
> As you know, the majority time of building FriCAS is to compile
> over 1000 SPAD files to LSP files and then to LISP_BIN file.
> Luckily, this step can be paralleled.
> 
> So on a multi-core machine, to reduce build time, the focus should
> be on the serial part of build process.
> 
> The building of algebra/*daase is the most important serial part.
> 
> I'm not entirely familiar with the process, but it seems there
> are a few stages to generate daase, and each stage requires to
> compile many (if not full) spad files, and the compiled result
> is discarded.

More precisely, the result is replaced by result of subsequent
compilation.  But we compile them because we need to load
some of them (at it is tricky to decide if we can skip some).

>  So I think in this step, it is wasteful to compile
> these *lsp file to *fasl file, especially for SBCL with :SB-FASTEVAL.

Quite likely.

> So some simple testing:
> 
> Compile FriCAS (without X11) with 8 cores (2.2GHz) takes
> 2m53s real time and 11m CPU time.
> 
> (So a rough estimation is that parallel part takes around 1min10s and
> serial part takes around 1m40s.)

Build time is rather nonliner, for example CPU time grows with
growing number of jobs.  For example on machine with 20
physical cores and 40 logical ones due to hypethreading
(all builds including X11 and generation of textual
HyperDoc pages):

-j 30
real    2m14.979s
user    15m0.109s
sys     1m46.336s

-j 15
real    2m30.543s
user    12m39.773s
sys     1m35.727s

-j 10
real    2m44.613s
user    11m35.911s
sys     1m25.861s

-j 5
real    3m51.130s
user    11m5.644s
sys     1m23.756s

-j 1
real    12m20.886s
user    10m16.380s
sys     1m22.216s

Still, roughly enough your estimate is probably OK.

> The first stage to generate daase is "make stamp-db" in src/algebra.
> This serial step alone takes 60s.  Skipping the lsp->fasl compilation
> reduce this step to 40s.  This will make the whole compilation 11%
> faster.
> 
> This is just a rough idea, still a long way to figure out all the
> details.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20220724184746.GA29120%40fricas.math.uni.wroc.pl.

Reply via email to