Hello,
I am running an MBP with OSX 10.4.11. This has an Intel Core 2 duo at 2.13GHz I also have a Linux box with Fedora Core 6 and an Intel Core 2 duo at 2.13 GHz. Both have 3 GB RAM. I compiled the attached code 'sample_bat.c' a sample program using gmp and mpfr on both machines with the following execution times. The code on the MBP was compiled with cc -O3 and on the Linux bax with cc -O.
Here are the execution times:

MBP: [EMAIL PROTECTED] MPFR]$ time ./sample_bat
Sum is 2.7182818284590452353602874713526624977572470936999

real    0m2.384s
user    0m2.242s
sys     0m0.025s


Linux:
[EMAIL PROTECTED] MPFR]$ time sample_bat
Sum is 2.7182818284590452353602874713526624977572470936999

real    0m1.057s
user    0m1.056s
sys     0m0.000s


Anyone know why the MBP is less than half the speed of the Linux box? Is there some setting that I am missing?
Thanks for any ideas.

-sen


#include <stdio.h>

#include <gmp.h>
#include <mpfr.h>

int main (void)
{
  unsigned int i;
  mpfr_t s, t, u;

  mpfr_init2 (t, 30000);
  mpfr_set_d (t, 1.0, GMP_RNDD);
  mpfr_init2 (s, 30000);
  mpfr_set_d (s, 1.0, GMP_RNDD);
  mpfr_init2 (u, 30000);
  for (i = 1; i <= 1000; i++)
    {
      mpfr_mul_ui (t, t, i, GMP_RNDU);
      mpfr_set_d (u, 1.0, GMP_RNDD);
      mpfr_div (u, u, t, GMP_RNDD);
      mpfr_add (s, s, u, GMP_RNDD);
    }
  printf ("Sum is ");
  mpfr_out_str (stdout, 10, 50, s, GMP_RNDD);
  putchar ('\n');
  mpfr_clear (s);
  mpfr_clear (t);
  mpfr_clear (u);
  return 0;
}
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Fink-users mailing list
Fink-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to