- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I made a mistake when phrasing the question - it is about private, not shared, allocatable arrays.
When defining a parallel do loop which involves an allocatable *private* array, I had to put the allocation statement inside the parallel region for the construct to work as expected - allocation outside the parallel region lead to an error.
Why does it matter where it is allocated?
Cheers -RalfLink Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Outside the parallel region only the initial thread is active. It creates a single allocated array. Within the parallel region a team of threads is active. As the array is private, each of those threads has its own copy, but only the array of the master thread (the former initial thread) has been allocated.
Hence, in order to have the private copy of the array allocated for all threads, it has to be done within the parallel region.
Hence, in order to have the private copy of the array allocated for all threads, it has to be done within the parallel region.
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