- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am just getting acquainted with parallelization, so my question is probably dumb. But here is a brief description of the problem: I want to solve a finite horizon dynamic programming problem by backward induction. I start in the last period (T), and for all possible elements of the state space (state space is discrete) I solve for the optimal values of the choice variables. This gives me the value function, which allows me to iterate one step backward and use the Bellman equation to solve for the period T-1 value function.
Now it is clear that the program has to do the same thing for a lot of times, namely solve for the optimal choices for a given state. This is done inside a DO loop, where the index variable indexes the states. The solution for one state is totally independent of the solution for another state, so I thought there is room for multi-threading. When I found the DO CONCURRENT construct, I thought this is exactly what I need. Although there is a lot of stuff inside this loop (including other loops), but the order of execution in the main loop is irrelevant.
I followed the requirements for DO CONCURRENT (only pure procedures and so on), and I compiled my code with the /Qparallel option. There was no error during compilation. But if anything, my code got slower, instead of faster. Did I completely misunderstand the DO CONCURRENT construct? How can I know if the compiler was able to paralellize at all?
Thanks for any hint,
Andras
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/Qpar-report options inform you about parallelism undertaken by the compiler, and about reasons for not parallelizing.
DO CONCURRENT doesn't force parallelism, as OpenMP directives could do.
DO CONCURRENT doesn't force parallelism, as OpenMP directives could do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let me guess: you are an economist?
I found with OpenMP that it can become slower if you have only few cores, e.g. dual core. This is due to the overhad, and the cost of distributing and collecting all data, which (as you say) has to happen at every t.
I found with OpenMP that it can become slower if you have only few cores, e.g. dual core. This is due to the overhad, and the cost of distributing and collecting all data, which (as you say) has to happen at every t.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try adding the /Qparallel switch to the command line. It may inspire more parallelization of your DO CONCURRENT loop.
-- Lorri
-- Lorri
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