Notes
If this function is called on a vector v on a distributed communicator only the local part is written in output. To get a single MatrixMarket file with the whole vector when appropriate, e.g. for debugging purposes, one could gather the whole vector on a single rank and then write it. Consider the following example for a double precision vector
real(psb_dpk_), allocatable :: vglobal(:) call psb_gather(vglobal,v,desc,info) if (iam == psb_root_) then call mm_array_write(vglobal,vtitle,info,filename) end if call deallocate(vglobal, stat=info)
To simplify this procedure in C, there is a utility function
psb_i_t psb_c_<s,d,c,z>global_vec_write(vh,cdh);
that produces exactly this result.