Performance analysis of Mul algorithms in the same range
Lingchuan Meng
lingchuanmeng at gmail.com
Sun Jan 4 17:44:15 CET 2009
On Sun, Jan 4, 2009 at 10:39 AM, Torbjorn Granlund <tg at swox.com> wrote:
> "Lingchuan Meng" <lingchuanmeng at gmail.com> writes:
>
> Thank you for the reply. The symlink is pointing to the 'gmp-mpara.h'
> located in /mpn/x86/k7/ in my case. And after editing, both files in
> the build directory and /mpn/x86/k7/ have been changed. I've compared
> the performances of untuned and tuned library by copying the
> thresholds from the tuning program to 'gmp-mpara.h' in the build
> folder, and it worked as expected. However, as mentioned in previous
> email, editing those thresholds manually to force certain algorithm to
> run doesn't deliver the expected result. And the new 'gmp-mpara.h' did
> survive the reconfigure and rebuild.
>
> Since I don't know what result you expect, I don't think I can provide
> much more assistance. But perhaps a little debugger session would help
> you?
>
The expected result should show dramatic difference among the four
multiplication algorithms when forced to run in the same range.
> If you compile in MUL_KARATSUBA_THRESHOLD as 1, I'd expect crashes
> and/or incorrect results. If you don't get that, I doubt you have
> compiled in that value.
>
I did compile in that value, and at least didn't get crashes. However,
the building did stop when the SQR thresholds got modified incorrectly
in the gmp-mpara.h due to violation of assertion.
> The speed program is great, but, in my case, I'm hoping to get more
> information by inserting PAPI codes.
>
> I don't understand what you mean.
>
I mean I need more information of the program performance, such as L1
cache miss rate, etc, which is not available in 'speed'.
PAPI is defined as "PAPI aims to provide the tool designer and
application engineer with a consistent interface and methodology for
use of the performance counter hardware found in most major
microprocessors" by http://icl.cs.utk.edu/papi/.
Anyway, I'll try calling the mpn_ functions directly if the thresholds
in gmp-mpara.h don't work.
On Sun, Jan 4, 2009 at 10:39 AM, Torbjorn Granlund <tg at swox.com> wrote:
> "Lingchuan Meng" <lingchuanmeng at gmail.com> writes:
>
> Thank you for the reply. The symlink is pointing to the 'gmp-mpara.h'
> located in /mpn/x86/k7/ in my case. And after editing, both files in
> the build directory and /mpn/x86/k7/ have been changed. I've compared
> the performances of untuned and tuned library by copying the
> thresholds from the tuning program to 'gmp-mpara.h' in the build
> folder, and it worked as expected. However, as mentioned in previous
> email, editing those thresholds manually to force certain algorithm to
> run doesn't deliver the expected result. And the new 'gmp-mpara.h' did
> survive the reconfigure and rebuild.
>
> Since I don't know what result you expect, I don't think I can provide
> much more assistance. But perhaps a little debugger session would help
> you?
>
> If you compile in MUL_KARATSUBA_THRESHOLD as 1, I'd expect crashes
> and/or incorrect results. If you don't get that, I doubt you have
> compiled in that value.
>
> The speed program is great, but, in my case, I'm hoping to get more
> information by inserting PAPI codes.
>
> I don't understand what you mean.
>
> --
> Torbjörn
>
--
Best regards,
Lingchuan Meng
More information about the gmp-discuss
mailing list