Chudnovski to file Windows xp

cino hilliard hillcino368 at hotmail.com
Sun Nov 11 03:16:36 CET 2007


Hi,
Here is a re-send in Plain text.
Cino Hilliard


________________________________

From: hillcino368 at hotmail.com
To: gmp-discuss at swox.com
Subject: RE: Chudnovski to file Windows xp
Date: Sat, 10 Nov 2007 17:11:16 -0600




> Today's Topics:
>
> 1. Re: Low efficiency of the mpf_out_str function ! (Jason Lin)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 9 Nov 2007 21:21:01 +0800 (CST)
> From: Jason Lin 
> Subject: Re: Low efficiency of the mpf_out_str function !
> To: Jan Doornaert 
> Cc: gmp-discuss at swox.com
> Message-ID: 
> Content-Type: text/plain; charset=big5
>
>> Jason,
>>
>> Have you tried running the program with output NOT
>> to stdout, but to
>> file?
>
> yes, both to stdout and to file are the same !
>
>
>> I don't think the "conversion" from GMP-internal
>> format to decimal takes
>> *that* much time, but the actual formatted output
>> on-screen (think
>> "printf") might slow things down (especially for the
>> number of characters
>> you're outputting)...
>
> 1. I don't think either ! but I must emphasis that the
> code was compiles on DJGPP 2.03 with GMP 4.1.2 . I am
> not sure if the GMP 4.2.2 have the same problem.
>
> 2. I don't think the bottleneck is the printf
> function.
> because the output screen ceased there for a long time
> before the mess digits bursting out. It is the
> mpf_out_str cause the ceasing ! (and the printf give
> the bursting out digits almost in second)
>
> 3. Today I tried to compile the code with DEV-CPP
> 4.9.9.2 with GMP4.1.? (pre compiled. download from
> http://old.devpaks.org/list.php?category=Mathematics)
> but the results is more worse, try to calculate more
> than 500000 digits will get a runtime error.(general
> protection error for OP code I think !)
>
> 4.The program Chudnovsky.c can be download from
> http://gmplib.org/pi-with-gmp.html
> Can some one give it a try ?? (with GMP 4.1.2)


Hi,
System: p4 2.53 ghz 2 gig ram windows xp pro

I am running mingw gcc 4.1.2  GMP 4.2.2 built (dynamic) with instructions from
http://cs.nyu.edu/exact/core/gmp/

  For chudnovski.c. I renamed this to chudpi.c and modified it a little for output and timing.

Add the following in main

FILE *fptr1;
char fil[] = "zpi.txt";
fptr1=fopen(fil,"w");

Modify the output if statement

  if (out&1)  {
  begin = clock();
    printf("pi(0,%ld)=\n", terms);
  //mpf_out_str(stdout, 10, d+2, qi);
    mpf_out_str(fptr1, 10, d+2, qi);
  end = clock();
  printf("Time to save to %s = %6.3f\n",fil, (double)(end-begin)/CLOCKS_PER_SEC);
    printf("\n");
  }

Run for 10 million
f:\GmpGcc>chudpi 10000000 1
#terms=705136, depth=21
sieve   time =  0.296
...................................................
bs      time = 64.391
gcd     time = 11.306
div     time =  9.031
sqrt    time =  5.172
mul     time =  3.484
total   time = 82.437
   P size=14561191 digits (1.456119)
   Q size=14561184 digits (1.456118)
pi(0,705136)=
Time to save to zpi.txt = 48.563

f:\GmpGcc>dir zpi.txt
 Volume in drive F is New Volume
 Volume Serial Number is 186E-0843
 Directory of f:\GmpGcc
11/10/2007  04:45 PM        10,000,006 zpi.txt
               1 File(s)     10,000,006 bytes
               0 Dir(s)  451,460,153,344 bytes free

For gmp 4.1. I get an error for over 500,000 also

Cino Hilliard



More information about the gmp-discuss mailing list