0

I am confusing about DESCINIT's lld parameter.

I set a

subrows(int(full_data_dims_b(1), kind = 4), m_b, nprow)

subrows as defined

integer function subrows(global_rows, block_rows, row_procs)
    integer global_rows, block_rows, row_procs
    subrows = (global_rows / (block_rows * row_procs)) * block_rows + min(mod(global_rows , &
    & (block_rows * row_procs)), block_rows)

end function subrows
enter code here

My descinit is

call DESCINIT( &
    desca, &
    int(full_data_dims_a(1), kind=4), &
    int(full_data_dims_a(2), kind=4), &
    m_a, &
    n_a, &
    0, &
    0, &
    ictxt, &
    & subrows(int(full_data_dims_a(1), kind = 4), m_a, nprow), & 
    & error)

My program finally cause segmentation fault.

Allocating this memory area

dset_id_a = open_dataset(file_id, dsetname_a)
dspace = open_dataspace(dset_id_a)
ndims_a = get_simple_extent_ndims(dspace) 
  • 1
    Please explain what is this DESCINIT. Where did you encounter it? What is your subroutine supposed to do? – Vladimir F Героям слава Aug 02 '23 at 06:38
  • I defined function as follows. integer function subrows(global_rows, block_rows, row_procs) integer global_rows, block_rows, row_procs subrows = (global_rows / (block_rows * row_procs)) * block_rows + min(mod(global_rows , & & (block_rows * row_procs)), block_rows) end function subrows My descinit subrows(int(full_data_dims_a(1), kind = 4), m_a, nprow) – 池田直哉 Aug 15 '23 at 08:31

1 Answers1

0

Descinit initializes an array descriptor for ScaLAPACK, the distributed memory version of LAPACK. As the link explains LLD is the "The leading dimension of the local array storing the local blocks of the distributed matrix". Thus it is almost always the local, on process, first dimension of the memory allocated for the array for which you are creating the descriptor. Contrast this with M and N which are the global dimensions.

I'm not sure what your function is trying to achieve, but you probably want to look at NUMROC

Ian Bush
  • 6,996
  • 1
  • 21
  • 27