On 27 September 2013 21:23, Barry Smith <[email protected]> wrote: > Just use MatCreateMPIBAIJWithArrays() saves thinking and work.
BTW, Have you ever thought about how hard to use is this API if you want to provide the matrix values? How are users supposed to fill the "values" array for a matrix with bs>1 ? This API is certainly not Fortran-friendly (and I think it not even C-friendly). Mateo had the CSR indices as well as the block values, but I recommended to use the CSR indices to perform proper matrix preallocation, then loop over cells and call MatSetValuesBlocked(). Otherwise, he would need to create an new intermediate array and fill it the right way for MatCreateMPIBAIJWithArrays() to work as expected. The root of the problem is how MatSetValuesBlocked() expects the array of values to be layout in memory. While I understand that the current convention make it compatible with MatSetValues(), I'm always wondering if a layout like values[nblockrows][nblockcols][bs][bs] would not be much more convenient for users. -- Lisandro Dalcin --------------- CIMEC (UNL/CONICET) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo 3000 Santa Fe, Argentina Tel: +54-342-4511594 (ext 1016) Tel/Fax: +54-342-4511169
