[OS X TeX] multi cores

Peter Dyballa Peter_Dyballa at Web.DE
Sun Dec 13 19:52:34 EST 2009


Am 13.12.2009 um 23:40 schrieb George Gratzer:

> a long log file displayed in the terminal (would it get faster if I  
> could suppress that?)

Definitely! "*tex -interaction=batchmode <file>" should save some  
seconds...

>
> And at the end:
>
> user  	0m1.597s


You are using the shell's built-in timer, which cannot be very exact.  
In bash and GNU's date command, i.e., the command gdate, which has a  
resolution of nsec, you could run

	START=$(gdate +%s.%N) ; latex -interaction=batchmode GLT3 ; END=$ 
(gdate +%s.%N) ; DIFF=$(echo "$END - $START" | bc) ; echo $DIFF

This one-liner will measure from start to end of the execution. The  
DIFF value times four (you mentioned once that not all the cores are  
used) might give the "real" time. Another approach is to use Sun's  
built-in DTraceToolkit:

	sudo procsystime -eoT latex -interaction=batchmode GLT3

This will deliver some KB of information exact to the nsec (and for me  
that most time was spent wait'ing 4 something). (Although I really  
don't know how correct it will be with a multi-core CPU...) In tcsh I  
use this setting to have some useful and easy to understand (more or  
less) correct data:

set time=(4 "\
     Time spent in user mode   (CPU seconds) : %Us\
     Time spent in kernel mode (CPU seconds) : %Ss\
     Total time                              : %Es\
     CPU utilisation (percentage)            : %P")


If you want to use dtrace, dtruss, etc. more often it might be useful  
to set ACLs for your account that allow you to use the dtrace_kernel  
privileges. (I haven't done it yet.)

--
Greetings

   Pete

Genius may have its limitations, but stupidity is not thus handicapped.
				– Elbert Hubbard




More information about the MacOSX-TeX mailing list