[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PETSC debug



  Look at the vector entries earlier and earlier in the code
until you find the point when they are not nuts. Then you know the
small piece of code that is making them nuts.

  Also use -malloc_debug (-trmalloc in old versions of PETSc) or
better valgrind www.valgrind.org to make sure that it is not
memory corruption making the crazy values.

  Barry

On Wed, 15 Nov 2006, billy@xxxxxxxxxxxxx wrote:

> 
> Hi,
> 
> How do you suggest I track the origin of the problem. Which data should I look at?
> 
> Thanks,
> 
> Billy.
> 
> Quoting Barry Smith <bsmith@xxxxxxxxxxx>:
> 
> > 
> >   These numbers are all garbage (tiny numbers like this very, very, very
> > rarely
> > appear). It looks like the vector or the array you are using is not being 
> > initialized or is getting totally written over incorrectly.
> > 
> >    Barry
> > 
> > 
> > On Wed, 15 Nov 2006, billy@xxxxxxxxxxxxx wrote:
> > 
> > > 
> > > x has very small values and some zeros. Is this a problem?
> > > 
> > > 
> > > (gdb) p *x@1710
> > > 
> > > {5.6661805945484757e-226, -1.1627609243420647e-234, 
> > >   -3.0191454638161275e-228, 4.9827910759046858e-233,
> > -2.0736747864315411e-242, 
> > >   -6.2486892875076229e-236, 7.936938687044959e-240,
> > -2.7194212807360601e-249, 
> > >   -8.588425549413817e-243, 2.3024631606271122e-243,
> > -5.9846691224557681e-252, 
> > >   -2.2335202330567468e-245, 9.7831244726432479e-236,
> > -1.3552548630405792e-244, 
> > >   -3.495520937088327e-238, 5.4989262786345397e-243,
> > -1.3210098902792841e-252, 
> > >   -3.8682663837382384e-246, 8.8387035435575233e-250,
> > -1.8090256621813952e-259, 
> > >   -5.4716023064278407e-253, 3.588000018861786e-253,
> > -6.2458537296193104e-262, 
> > >   -2.3148026340361519e-255, 1.0977920182613153e-245,
> > -1.0249411693868054e-254, 
> > >   -2.6419424389659324e-248, 3.9853740743647345e-253,
> > -5.4255411897492446e-263, 
> > >   -1.5685468152877737e-256, 6.4972881272145346e-260,
> > -7.7132606040774855e-270, 
> > >   -2.2883458301363077e-263, 3.7376905182602783e-263,
> > -4.3589162441629927e-272, 
> > >   -1.6122153535564706e-265, 5.4679961341990742e-256,
> > -3.4946761363871895e-265, 
> > >   -9.0506057005070676e-259, 1.2625051605987276e-263,
> > -9.8127138874528815e-274, 
> > >   -2.8171459920204651e-267, 2.1144094764316537e-270,
> > -1.4661783326174102e-280, 
> > >   -4.3021011674687748e-274, 1.7171839888390158e-273,
> > -1.355360583021068e-282, 
> > >   -5.0256495711998189e-276, 2.3441225393534538e-275,
> > -1.4167665839646082e-284, 
> > >   -9.5098664261506559e-276, 5.8664086258683721e-265,
> > -5.2303663615699708e-274, 
> > >   -3.4638320353774473e-265, 7.1774245671418306e-255,
> > -9.5315249514698032e-264, 
> > >   -6.22580454316614e-255, 4.3135135163622493e-245,
> > -8.6106571400568118e-254, 
> > >   -5.54411948811998e-245, 1.2782302660591342e-235,
> > -3.8700430138360975e-244, 
> > >   -2.4540088843175776e-235, 1.8714298666616161e-226,
> > -8.667061714016371e-235, 
> > >   -5.4046157807505651e-226, 1.3558688389339507e-217,
> > -9.6883371298320722e-226,
> > > ---Type <return> to continue, or q <return> to quit---
> > >  -5.9285856500623996e-217, 4.8468289723098665e-209,
> > -5.3857466678811828e-217, 
> > >   -3.2242188218384035e-208, 8.4534293726532241e-201,
> > -1.4738192384650725e-208, 
> > >   -8.5980759783639217e-200, 6.907091796675751e-193,
> > -1.9033438119138147e-200, 
> > >   -1.0763770568701642e-191, 2.6478532383011193e-272,
> > -1.4903005865209107e-282, 
> > >   -7.7998156143119667e-274, 9.305780800265163e-262,
> > -8.8839704462246742e-272, 
> > >   -4.5901635372628567e-263, 1.6034530482636144e-251,
> > -2.6131364216028464e-261, 
> > >   -1.3303679068670779e-252, 1.3592022238328847e-241,
> > -3.7997620105273078e-251, 
> > >   -1.9017131279478928e-242, 5.6792247063849799e-232,
> > -2.7364107576938111e-241, 
> > >   -1.3423648502867758e-232, 1.1692077782649843e-222,
> > -9.7510387600061777e-232, 
> > >   -4.6696270174942923e-223, 1.1853783027581269e-213,
> > -1.7218922665317482e-222, 
> > >   -8.0083000299810735e-214, 5.8785159049366656e-205,
> > -1.495807982671848e-213, 
> > >   -6.7077377611273877e-205, 1.4070570606363661e-196,
> > -6.3472382608798458e-205, 
> > >   -2.7230139900247648e-196, 1.5497123236581113e-188,
> > -1.2485875796131097e-196, 
> > >   -5.0753617625768587e-188, 1.5434660362531493e-265,
> > -9.6427364575548134e-276, 
> > >   -4.9469124048614407e-267, 5.5771128650726324e-255,
> > -6.0715211415635001e-265, 
> > >   -3.0557860054339049e-256, 9.7596266862900188e-245,
> > -1.8630746938040184e-254, 
> > >   -9.1835699478680429e-246, 8.400502948812723e-235,
> > -2.8372007398618318e-244, 
> > >   -1.365943291479874e-235, 3.5683163152848973e-225,
> > -2.1529642010355749e-234, 
> > >   -1.0086136614457182e-225, 7.470797689290204e-216,
> > -8.1244038233290801e-225, 
> > >   -3.6841086790658924e-216, 7.6946486289534802e-207,
> > -1.5231479988588442e-215, 
> > >   -6.6343355238597203e-207, 3.8658097394017472e-198,
> > -1.4018784919234662e-206, 
> > >   -5.7883232195093694e-198, 9.3704091845606854e-190,
> > -6.2833327107970169e-198, 
> > >   -2.4015591026235036e-189, 1.0604778036924017e-181,
> > -1.3130129893123058e-189,
> > > ---Type <return> to continue, or q <return> to quit---
> > >   -4.3944520676710034e-181, 5.3191550180698584e-174,
> > -1.2276467039908345e-181, 
> > >   6.582654853774009e-258, -3.6960150023175459e-267,
> > -1.541051696004311e-258, 
> > >   1.5081568307026851e-247, -1.2291453940848028e-256,
> > -5.045748607868979e-248, 
> > >   1.6985391993644289e-237, -2.0388029995970922e-246,
> > -8.2307676982689932e-238, 
> > >   9.31882138782716e-228, -1.6611812318932581e-236,
> > -6.5847692143411066e-228, 
> > >   2.4911590486436157e-218, -6.6411748999525368e-227,
> > -2.578412473673239e-218, 
> > >   3.2461544324197385e-209, -1.3019895450678336e-217,
> > -4.930407732106102e-209, 
> > >   2.0647053899839311e-200, -1.2536927838659388e-208,
> > -4.5973820374997486e-200, 
> > >   6.3999453950640209e-192, -5.9162039831540975e-200,
> > -2.0733460339667467e-191, 
> > >   9.6386220362933024e-184, -1.3685224770731774e-191,
> > -4.468872196846956e-183, 
> > >   6.9383373250314803e-176, -1.5267617834505389e-183,
> > -4.3847638022619328e-175, 
> > >   2.2993251811195029e-168, -8.018740019783814e-176,
> > 8.0187312547169491e-280, 
> > >   -1.9681088822187587e-289, -8.6000837193564188e-281,
> > 2.4418184153863893e-291, 
> > >   -3.6413466395574048e-301, -1.6520119055708723e-292,
> > 6.2083711391797733e-303, 
> > >   0, -2.7166342721641981e-304, 0 <repeats 54 times>,
> > 1.3382706765032754e-300, 
> > >   0, -3.7946354577853773e-304, 6.3527319749529548e-289, 
> > >   -1.0316342902978391e-298, -2.7857994540718757e-292,
> > 1.3926426017545835e-277, 
> > >   -3.7119818003349503e-287, -9.8649586986765956e-281...}
> > > 
> > > 
> > > 
> > > Billy.
> > > 
> > > 
> > > Quoting Barry Smith <bsmith@xxxxxxxxxxx>:
> > > 
> > > > 
> > > >   Billy,
> > > > 
> > > >    The x array contains the vector entries. It is either that
> > > > 1) idx == 1710 is not a valid index or more likely
> > > > 2) x[] on input has garbage values in it.
> > > > 
> > > >    Can you call VecView() on x right before or after
> > > > it is passed into the MatMult? My guess is it has
> > > > garbage in it from earlier in the code.
> > > > 
> > > >    Barry
> > > > 
> > > > On Tue, 14 Nov 2006, billy@xxxxxxxxxxxxx wrote:
> > > > 
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > I was running my code and I got FPE error on alpha machines.
> > > > > 
> > > > > Using gdb the output is the following. I am using 4 processors.
> > > > > 
> > > > > Program received signal SIGFPE, Arithmetic exception.
> > > > > 0x1202c4e1c in MatMult_SeqBAIJ_1 (A=0x120bbc7c0, xx=0x120be0770,
> > > > >     zz=0x120bc9fb0) at baij2.c:260
> > > > > 260         while (n--) sum += *v++ * x[*idx++];
> > > > > (gdb) print n
> > > > > $1 = 0
> > > > > (gdb) print idx
> > > > > $2 = (PetscInt *) 0x120c7aab8
> > > > > (gdb) print *idx
> > > > > $3 = 1710
> > > > > (gdb) print v
> > > > > $4 = (MatScalar *) 0x120c99190
> > > > > (gdb) print *v
> > > > > $5 = 4.0109832449655266e-12
> > > > > (gdb) print x
> > > > > $6 = (PetscScalar *) 0x120be1690
> > > > > (gdb) print x[*idx]
> > > > > $7 = 1.2349520920477556e-308
> > > > > (gdb) print sum
> > > > > $8 = 0
> > > > > 
> > > > > 
> > > > > Billy
> > > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > 
> > 
> 
> 
>