- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have a problem when auto parallelizing forall constructs containing a sum() or spread() function. The problem with the sum() functions occurs when using a logical mask. for instance:
real, dimension(100,100) :: a
real, dimension(100,100,100) :: b,c
forall(i=1:100)
forall(j=1:100)
a(j,i) = sum(b(:,:,j)*c(:,:,i))
end forall
end forall
works fine and is parallelized, however if I use in the above example something like
a(j,i) = sum(b(:,:,j)*c(:,:,i), mask=(d(:,:) > 0.)
i.e. use a logical mask, the forall construct can not be parallelized. Is this a problem of the ifc compiler or can masked summations simply not be parallel?
Also, when using the spread() function in something like
real, dimension(100,100,100) :: a
real, dimension(100) :: b
forall (i=1:100)
a(i,:,:) = spread(b,dim=1,ncopies=100 )
end forall
does not parallelize. Still, one can use these functions within a forall construct without the compiler complaining so it should be possible to run things parallel or not?
I have a problem when auto parallelizing forall constructs containing a sum() or spread() function. The problem with the sum() functions occurs when using a logical mask. for instance:
real, dimension(100,100) :: a
real, dimension(100,100,100) :: b,c
forall(i=1:100)
forall(j=1:100)
a(j,i) = sum(b(:,:,j)*c(:,:,i))
end forall
end forall
works fine and is parallelized, however if I use in the above example something like
a(j,i) = sum(b(:,:,j)*c(:,:,i), mask=(d(:,:) > 0.)
i.e. use a logical mask, the forall construct can not be parallelized. Is this a problem of the ifc compiler or can masked summations simply not be parallel?
Also, when using the spread() function in something like
real, dimension(100,100,100) :: a
real, dimension(100) :: b
forall (i=1:100)
a(i,:,:) = spread(b,dim=1,ncopies=100 )
end forall
does not parallelize. Still, one can use these functions within a forall construct without the compiler complaining so it should be possible to run things parallel or not?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't speak to the parallelizing aspect, but just because you CAN say something in a FORALL, that doesn't mean it automatically can (or will) be run in parallel. The FORALL is your hint to the compiler that you don't care about the order of execution across the FORALL, but the compiler needs to do its own analysis and there may be some complex expressions it doesn't know how to automatically run in parallel.
Steve
Steve

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