Open mlell opened 6 years ago
This is a good point. The base/dmat design has some idiosyncrasies about it for some historical reasons. The current goal is to keep the base wrappers somewhat close to scalapack itself (albeit slightly higher level), which assumes you do your own error checking. I think I may instead send error codes as part of the return (or as an attribute maybe) in base and then if there's a non-zero return, error on the dmat side.
When a singular matrix is inverted using the pbdDMAT package, an invalid result is produced, with a warning:
Output when called as
mpirun -n 2 Rscript example2.R
The base R function throws an error in this case:
Because code like the above is used non-interactively and is possibly itself called many times in an automated fashion, the warning message might well be missed in certain setups. In that case false results would corrupt downstream analyses, possibly without being ever noticed, which is very dangerous.
I would therefore propose to replace the relevant
comm.warning(....
lines in R/base_lm.R and R/base_scalapack.R to generate errors in that case.