Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Another application of dcopy subroutine

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Hyoun-tae_Hwang

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-25-2010
10:25 AM

52 Views

Another application of dcopy subroutine

I am trying to apply dcopy to my parallel codes.In that, I want to chop one big array into several small arrays which sizes are defined by the number of threads applied.

For example,

* big_array(1~100)can beseparated into4 smallarrays such as small_array1(1~25),small_array2(26~50), small_array3(51~75), small_array4(76~100).

In this case, the small_array1,2,3, and 4 will copy values in the big_array so i need to assign the range which the small_arrays will copy from the big_array.

Rough idea for this function is

dcopy1(start,end,big_array,indx,small_array1,indx)

I am wondering if you have any ideas about this. Any comments will be helpful!

Cheers,

Link Copied

4 Replies

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-25-2010
04:48 PM

52 Views

[fortran]subroutine sub(A,N,...) real(wp), dimension(N) :: A real(wp),allocatable, dimension(:) :: A1,A2,A3 ... nby3=N/3 ! N should be an exact multiple of 3 A1=A(1:nby3); A2=A(nby3+1:2*nby3); A3=A(2*nby3+1:N) [/fortran]How to go about this depends on what fate you have in store for the pieces so extracted.

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-25-2010
10:04 PM

52 Views

moreover it would be faster then using dcopy for such cases.

Hyoun-tae_Hwang

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-26-2010
11:33 AM

52 Views

By the way, the output variables (A1,A2,A3)will bedepend on the number of threadassigned.

So,I am wondering ifIuse two dimensional arrays such as

subroutine sub(A,N,start,end,A1,numthread)

real(wp), dimension(N) :: A

real(wp),allocatable, dimension(:,:) :: A1

...

A1(start(1):end(1),1) = A(start(1):end(1));

A1(start(2):end(2),2) = A(start(2):end(2));

....

A1(start(numthread):end(numthread),numthread)=A(start(numthread):end(numthread))

end subroutine sub

Hyoun-tae_Hwang

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-26-2010
11:35 AM

52 Views

Okay, then I will try it. Thanks

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.