# mm_array_write — Write a dense array from a file in the MatrixMarket format

[prev] [prev-tail] [tail] [up]

#### 9.6 mm_array_write — Write a dense array from a file in the MatrixMarket format

call mm_array_write(b, vtitle, iret, iunit, filename)

Type:
  Asynchronous.
On Entry
b
  Rigth hand side(s).
  Type: required
  An array of type real or complex, rank 1 or 2, or an object of type psb_T_vect_type, of type real or complex; its contents will be written to disk.
filename
  The name of the file to be written.
vtitle
  Matrix title.
  Type: required
  A charachter variable holding a descriptive title for the vector to be written to file. Type:optional.
  Specified as: a character variable containing a valid file name, or -, in which case the default input unit 5 (i.e. standard input in Unix jargon) is used. Default: -.
iunit
  The Fortran file unit number.
  Type:optional.
  Specified as: an integer value. Only meaningful if filename is not -.

On Return
iret
  Error code.
  Type: required
  An integer value; 0 means no error has been detected.

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.

[prev] [prev-tail] [front] [up]