| Olivier Ramare on Sun, 25 May 2008 18:49:24 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Erreur de segmentation ??? |
Dear all, I join a script than I want to run with gp. The output is, after some time (around an hour, I think) : -------------------------------------------------------------------------/bin/bash: line 1: 3973 Erreur de segmentation env TERM=emacs PAGER=cat LINES=1000 COLUMNS=118 /usr/bin/gp -s 100000000 -p 10000000 -emacs
-------------------------------------------------------------------------
When I use /usr/bin/gp directly, the same segfault appears, at
the same point. In two days I'll be able to run it on a different machine.
Best,
Amities,
Olivier
If you need, I can get more informations; just tell me how :-)
(I doubt a simple use of gdb would suffice).
--------------------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------------------
Appele avec : /usr/bin/gp -s 100000000 -p 10000000 -emacs
Reading GPRC: /etc/gprc ...Done.
GP/PARI CALCULATOR Version 2.3.3
(released)
i486 running linux (ix86/GMP-4.2.2 kernel)
32-bit version
compiled: Jan 21 2008, gcc-4.2.3 20080114
(prerelease) (Debian 4.2.2-7)
(readline v5.2 enabled, extended help
available)
Copyright (C) 2000-2006 The PARI Group
PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.
Type ? for help, \q to quit. Type ?12 for how to get moral (and possibly technical) support. parisize = 100000000, primelimit = 10000000 ? \r /home/ramare/tex/Articles/ZetaLocal/Diff.gp ? Walk(2,3)[Walk] Inspecting [0.2000000000000000000000000000, 0.2000000000000000000000000000]
[Walk] Y = 0.1000000000000000000000000000 [... lots of output ...][Walk] Inspecting [0.2280000000000000000000000000, 2.272000000000000000000000000]
[Walk] Y = 0.1000000000000000000000000000 [Walk] Y = 0.1040000000000000000000000000 [Walk] Y = 0.1080000000000000000000000000 [Walk] Y = 0.1120000000000000000000000000 [Walk] Y = 0.1160000000000000000000000000/bin/bash: line 1: 3973 Erreur de segmentation env TERM=emacs PAGER=cat LINES=1000 COLUMNS=118 /usr/bin/gp -s 100000000 -p 10000000 -emacs
--------------------------------------------------------------------------------------------
SCRIPT
--------------------------------------------------------------------------------------------
{DiscreteValue(mygamma, bigY, p ,etaa, lambdaa, verbose=1)=
local(bigD = length(mygamma), res = 0.0, normalization = 0.0,
mybiggamma = vector(bigD));
/* Beware !! In the paper, mybiggamma goes from
index 0 to D while mygamma goes from 0 to D-1;
Here mygamma goes from 1 to D and so does mybiggamma:
this is shifted by one, and mybiggamma[1] = 0 */
if(verbose == 1,
if(etaa > 1/2-0.00001,
print("etaa is too large (should be <= 1/2-0.00001)");
return(0),);
if(bigY >= 1/2,
print("bigY is too large (should be < 1/2)");
return(0),);,);
for(d = 1, bigD, normalization += mygamma[d]);
for(d = 1, bigD, mygamma[d] = bigD*mygamma[d]/normalization);
mybiggamma[1] = 0;
for(d = 2, bigD, mybiggamma[d] = mygamma[d-1]+mybiggamma[d-1]);
if(verbose == 1,
print("[DiscreteValue, 0] ", (mybiggamma[bigD]+mygamma[bigD])/bigD),);
/* printed value should be 1 */
res = (lambdaa*(1-2*bigY)-1+2*etaa)/(lambdaa*(1-2*bigY)+1-2*etaa)
*(1-2*bigY)/2;
if(verbose == 1,
print("[DiscreteValue, 1] ", res),);
res += bigY*(p^2+2*p-1)/(p-1)^2;
if(verbose == 1,
print("[DiscreteValue, 2] ", res),);
for(d = 1, bigD,
res += mygamma[bigD-d+1]*bigY^2/bigD/(p-1)^2
*(2*lambdaa/etaa*mygamma[bigD-d+1]
-(p^2-1)*mybiggamma[d]
-(p^2-1)/2/bigD*mygamma[d]));
if(verbose == 1,
print("[DiscreteValue, 3] ", res),);
for(d = 1, bigD,
res += -mygamma[bigD-d+1]/mygamma[d]*2/(p-1)^3
*((lambdaa/etaa)*bigY*mygamma[bigD-d+1]+p)^2
*log((1+bigY*(lambdaa/etaa*mygamma[bigD-d+1]+(p-1)*mybiggamma[d]
+(p-1)*mygamma[d]/bigD))
/(1+bigY*(lambdaa/etaa*mygamma[bigD-d+1]
+(p-1)*mybiggamma[d]))));
if(verbose == 1,
print("[DiscreteValue, 4] ", res),);
if(verbose == 1,
if(res<0,
print(" Lambda(p) <= ", majsize(p ,etaa, lambdaa)),
print("No luck!")),);
return(res)}
{majsize(p ,etaa, lambdaa) = (1-etaa)/lambdaa/exp(Euler)*((p+1)/4-1/2)}
{Walk(bigD, p)=
local(minslope = 0.2, maxslope = 3.0, nbstepslope = 100, /* minslope
>0 */
/* Donc mygamma est un vecteur de longueur bigD
et dont chaque composante varie entre minslope et
maxslope par increment de stepslope. */
stepslope = (maxslope - minslope)/nbstepslope,
minindices = vector(bigD),
maxindices = vector(bigD, k, nbstepslope),
mygamma = vector(bigD),
minbigY = 0.1, maxbigY = 0.5, nbstepsbigY = 100,
stepbigY = (maxbigY - minbigY)/nbstepsbigY,
bigY, howmanyfound, foundnewone,
stepetaa = 0.001, etaa, foundonelambdaa, foundoneetaa,
hasfoundalambdaa,
steplambdaa = 0.001, lambdaa,
bestoldvalue = [vector(bigD),0,p,0,0, p], res, majo);
/* bestoldvalue has shape
[mygamma, bigY, p ,etaa, lambdaa, majo] */
forvec(myindex = vector(bigD, k, [minindices[k], maxindices[k]]),
for(d = 1, bigD, mygamma[d] = minslope+myindex[d]*stepslope);
print("[Walk] Inspecting ", mygamma);
bigY = minbigY;
hasfoundalambdaa = 0;
howmanyfound = 0; /* if bigY finds no *new* results
and is the second one like that, skip
gamma */
while( bigY <= maxbigY,
print("[Walk] Y = ", bigY);
foundoneetaa = 0;
etaa = stepetaa;
foundnewone = 0;
while( etaa <= 0.3,
lambdaa = 0.7;
foundonelambdaa = 0;
while( lambdaa <= 1,
res = DiscreteValue(mygamma, bigY, p ,etaa,
lambdaa, 0);
if(res < 0,
foundonelambdaa = 1;
foundoneetaa = 1;
majo = majsize(p ,etaa, lambdaa);
if(majo < bestoldvalue[6],
for(d = 1, bigD, bestoldvalue[1][d] =
mygamma[d]);
bestoldvalue[2] = bigY;
bestoldvalue[4] = etaa;
bestoldvalue[5] = lambdaa;
bestoldvalue[6] = majo;
print(" Found: ", majo);
foundnewone = 1;
,),
lambdaa += 1;);/* On sort des que lambdaa
est trop gros */
lambdaa += steplambdaa;);
if(foundonelambdaa == 0, etaa += 1,);/* On sort
des que etaa est trop gros */
etaa += stepetaa;);
if((foundoneetaa == 0)
&&(hasfoundalambdaa == 1), bigY += 1,); /* ?? On sort
des que bigY est trop gros ?? */
if(foundoneetaa == 1, hasfoundalambdaa = 1,);
if(foundnewone == 0, howmanyfound += 1,);
\\if(howmanyfound == 2, bigY+= 1,);
bigY += stepbigY;););
return(bestoldvalue);
}
-----------------------------------------------------------------------------------