Inconsistent zero pivots after calling "cusparseDcsrilu02" when I'm creating a preconditioner using LU factorization

I am building a GMRES solver with preconditioning and following the codes in the 11.2.4 section of this link. As the sample program, I checked zero pivots before and after calling cusparseDcsrilu02. They are expected to produce the same results since A(%d,%d) is missing is equivalent to U(%d,%d) is zero.

However, the A(%d,%d) is missing message is not displayed in my case, but the U(2048, 2048) is zero message is printed after LU factorization.

I wonder if there is anything wrong with the cusparseDcsrilu02 function.

Any assistance would be greatly appreciated.

Hi xinyi.li.nicole,
Can you please provide the sample code and the sparse matrix A you used?

Thanks,

Hi malmasri, I apologize for the delay in getting back to you regarding sharing the codes (I had to confirm with our collaborator if we can share the codes).

I have now uploaded the sample codes as an attachment (samples.zip) in this message for your reference.
samples.zip (82.2 KB)

Here are the instructions for running the code, you may need to replace 86 with the appropriate architecture for your system:

nvcc codes.cu -lcusparse -lcublas -lcusolver -gencode arch=compute_86,code=sm_86 -o a.o
./a.o matrix_RTS_Two_Time_Period_00.mtx rhs_RTS_Two_Time_Period_000.mtx 2000 2000 2 1e-14

I wanted to let you know that we have used the cusparseDcsrilu02 function in the createPreconditioner function. Additionally, we have also implemented a check for zero pivots before and after calling this function.

Our program will print the message:

NO ZERO PIVOTS detected!
U(2768,2768) is zero

Thank you for your help and I hope this information is useful. Let me know further information is needed.

Hi xinyi.li.nicole,
I think you are mixing between structural zero and numerical zero:

  • Structural zero pivot means that there is a missing diagonal value in the matrix. By checking your matrix file, there are no missing diagonal values (this is why NO ZERO PIVOTS detected! is printed).
  • Numerical zero pivot results from a structural zero or is generated during the ILU computation. In your case, the numerical zero is not a structural zero, it results from the ILU computation.

I hope this helps.