More floating point exceptions in the examples

Open forum for general discussions relating to PLASMA.

More floating point exceptions in the examples

Postby jimy_b » Tue Aug 20, 2013 11:17 am

The xposv examples have a bug in them I think.
When I run it, it encounters a division by zero in the routine PLASMA_xplgsy.
Debugging it is tricky because of the preprocessor functions which confuse the debugger, but I'm fairly certain that the problem with the example is that the matrix is too small. There are no calls which set the tile or group size in the main program like there are in the ones that work so I assume they get set to defaults.
In the routine which converts from tiled to LAPACK formats (PLASMA_xgecfi_async) the future culprit of the division by zero is computed - a variable called 'oml'. This variable is computed from:
Code: Select all
oml = (m/omb)*omb

Where m and omb are arguments to the function. M seems to be size of the matrix. omb's value is always 120. I can't confirm, but this looks like it may be the tile size because 120 seems to be its typical size throughout the examples.
So in conclusion is seems that in the example the matrix size is set to be small at 10, but the tile size is 120 so bigger than the whole matrix! I set the matrix size to be >= 120 and the program runs successfully.

Can you confirm that this is the case on your end also? I spent the whole afternoon thinking that it was some evil bug in the way I compiled it. :-)
jimy_b
 
Posts: 12
Joined: Wed Jul 31, 2013 1:06 pm

Re: More floating point exceptions in the examples

Postby mateo70 » Tue Aug 20, 2013 11:57 am

Hello,

Thanks for the report. Here is a patch that should fix it. It was a corner case I forgot to try :(. I'll add it to the nightly tests, and the patch will be in the next release when the hwloc problem will be correctly fixed.

Mathieu

Edit: I don't know why, but I can't upload the file. So here it is as code.

Code: Select all
Index: compute/pzpack.c
===================================================================
--- compute/pzpack.c   (révision 3595)
+++ compute/pzpack.c   (copie de travail)
@@ -71,8 +71,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
@@ -196,8 +199,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
Index: compute/pcpack.c
===================================================================
--- compute/pcpack.c   (révision 3595)
+++ compute/pcpack.c   (copie de travail)
@@ -71,8 +71,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
@@ -196,8 +199,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
Index: compute/pdpack.c
===================================================================
--- compute/pdpack.c   (révision 3595)
+++ compute/pdpack.c   (copie de travail)
@@ -71,8 +71,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
@@ -196,8 +199,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
Index: compute/pspack.c
===================================================================
--- compute/pspack.c   (révision 3595)
+++ compute/pspack.c   (copie de travail)
@@ -71,8 +71,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
@@ -196,8 +199,11 @@
     /* Quick return */
     if ( n <= 1 )
       return;
+    if ( (m == m0) || (m0 == 0) )
+        return;
 
     m1 = m - m0;
+    assert( m1 > 0 );
 
     size = PLASMA_SIZE;
     rank = PLASMA_RANK;
mateo70
 
Posts: 98
Joined: Fri May 07, 2010 3:48 pm


Return to User discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest