parallel solutions on the grid

Forums Feedback, suggestions, wishes, etc. parallel solutions on the grid

This topic contains 2 replies, has 2 voices, and was last updated by Gianni Lombardo November 16, 2022 at 6:28 pm.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2014

    Gianni Lombardo
    User

    Hi,

    I’ve parallelized the solution of (a version of) the stochastic growth model (with OMP PARALLEL DO on the NK and NS loops — see book example 9.3)

    To do so I had to bypass the communication variables is_com and k_com, passing them as additional inputs in the foc and fzero procedures.

    On a HP workstatioin the parallelization slashes the computing time by a factor > 10.

    I wonder whether others have implemented parallelized solutions of the intermediate step on the grid (ie not the iterations of course). Any tip?

    Cheers

    Gianni

    • This topic was modified 2 months ago by Gianni Lombardo.
    • This topic was modified 2 months ago by Gianni Lombardo.
    #2028

    Fabian Kindermann
    Moderator

    Dear Gianni,

    great that you managed this. In fact, its quite easy to parallelize using Fortran. In fact, what you could have done was to declare is_com and ik_com as threadprivate in the module file by just writing

    
    !$OMP threadprivate(is_com, ik_com)
    

    into the module file. This would have made it even simpler.

    Usually, parallelizing on the grid level is not so super efficient. But of course it can reduce computing time if done in the right way (not that our models would have a super long runtime).

    By the way, did you check the performance of parallelizing only on ik and not on is (with the assumption that is is the inner loop? Does this make things faster or slower?

    Best,
    Fabian

    #2029

    Gianni Lombardo
    User

    Thanks Fabian for your feedback.
    I’ll try your suggestion once I can get back to my project
    Cheers
    Gianni

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.