- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm attempting to understand how to pass a slice of a multidimensional co-array to a function. I would like to use a function like this:
function get_int_vec(vec_int_2get, rank) result(ret_val)
implicit none
integer, dimension(:), codimension
, intent(in) :: vec_int_2get
integer, intent(in) :: rank
integer, allocatable, dimension(:) :: ret_val
ret_val = vec_int_2get(:)[rank]
end function ! get_int_vec
It works fine to get an entire array. But when passing a slice of a coarray, like:
vec_getA(:) = get_int_vec(matrix_A(n, :), rank)
where matrix_A
is declared as
integer, dimension(:, :), codimension[:], allocatable :: matrix_A
and properly allocated, I always get the first column of
matrix_A
instead of the n-th.I am compiling with Intel Parallel Studio XE 2018 cluster edition.
I am attaching a minimal working example of the problem: it should print the same number as the rank of the image that is printing, instead of always 1.
Thank you in andvance for the attention.
- Tags:
- Parallel Computing
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page