I have try to use the direct-iterative method (iparm(4)=31) to solve unsymmetric matrices coming out from our finite elements hydrodynamic model (SHYFEM model).
The direct method (iparm(4)=0) works fine though it does not give good speedup passing from 1 to 2 threads.
With iparm(4)=31 it is almost 2 times faster than with iparm(4)=0. Maybe because in this case it performs the analysis phase only the first time. The problem is that it works only if the non-zero elements of the matrix are constant.
Some simulations have a different number of non-zero elements at each time steps, in this case the model stops at different time steps with different errors. For example running the same code many times I obtain randomly the following errors (iparm(20)):
-52; -16; -11; -42
at different random time steps.
These are the solving procedures executed at each time step with the direct-iterative method:
- Assemble a coo matrix
- Convert into csr format (coocsr, routine of Sparskit)
- Clean non-zeros inside the band and sort the matrix (clncsr, routine of Sparskit)
- Only the FIRST time step: Set and save iparm, pt. Run pardiso phase=11
- Run pardiso phase=23
There is no release of memory. METIS algorithm slows the execution.
Also with the direct-iterative method I don't have speedup passing from 1 to 2 threads.
The matrices have from 10,000 to 30,000 elements.
- Is it possible to run the direct-iterative method in a more "stable" way? Or switch to the direct method if it fails? Maybe a release memory and a new analysis can be a solution if I could understand when the method will fail.
- Why I don't have speedup with two threads?