{"action":"created","issue":{"url":"https://api.github.com/repos/ESCOMP/ctsm/issues/293","repository_url":"https://api.github.com/repos/ESCOMP/ctsm","labels_url":"https://api.github.com/repos/ESCOMP/ctsm/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/ESCOMP/ctsm/issues/293/comments","events_url":"https://api.github.com/repos/ESCOMP/ctsm/issues/293/events","html_url":"https://github.com/ESCOMP/ctsm/issues/293","id":296928079,"number":293,"title":"Rework threading to be done at a higher level, simplifying array argument passing","user":{"login":"billsacks","id":6266741,"avatar_url":"https://avatars0.githubusercontent.com/u/6266741?v=4","gravatar_id":"","url":"https://api.github.com/users/billsacks","html_url":"https://github.com/billsacks","followers_url":"https://api.github.com/users/billsacks/followers","following_url":"https://api.github.com/users/billsacks/following{/other_user}","gists_url":"https://api.github.com/users/billsacks/gists{/gist_id}","starred_url":"https://api.github.com/users/billsacks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billsacks/subscriptions","organizations_url":"https://api.github.com/users/billsacks/orgs","repos_url":"https://api.github.com/users/billsacks/repos","events_url":"https://api.github.com/users/billsacks/events{/privacy}","received_events_url":"https://api.github.com/users/billsacks/received_events","type":"User","site_admin":false},"labels":[{"id":780653963,"url":"https://api.github.com/repos/ESCOMP/ctsm/labels/type:%20enhance%20-%20software","name":"type: enhance - software","color":"edc49a","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T23:50:33Z","updated_at":"2018-02-13T23:51:17Z","closed_at":null,"author_association":"OWNER","body":"Currently we do threading by breaking each individual array into \"clumps\" of indices. This implementation is fragile (for example, doing whole-array assignments breaks threading, and lower bounds of array arguments need to be carefully maintained, since often we pass just the section of the array for the given thread). This also leads to extra verbosity when passing arguments - both in the caller and callee (again, to maintain appropriate array bounds).\r\n\r\n@mvertens and I would like to rework threading to be done at a higher level: Rather than dividing each array into clumps, we would instead have one object (i.e., one instance of each derived type) per clump. That is, a given instance would hold the data for a single clump (which typically equates to a single thread), and there would be no need to subdivide individual arrays.\r\n\r\nSee https://github.com/billsacks/prototypes-clm-threading_at_high_level for a prototype and more detailed thoughts.\r\n\r\n### Implementation checklist\r\n\r\n- [ ] Rework processor-level bounds to start at 1 for each processor\r\n\r\n- [ ] Rework handling of clumps to be done at a higher level, as shown in Bill's prototype\r\n\r\n- [ ] Move all remaining module-level variables into derived types, with instances of those types. One example I see of this is harvest(:) in dynHarvestMod.\r\n\r\n### Testing checklist\r\n\r\n- [ ] Test performance for a case without i/o - should be no worse than before\r\n\r\n- [ ] Test performance of i/o\r\n\r\n- [ ] Test a case where nclumps_per_proc is greater than nthreads - compare with baseline. Point is: Make sure we haven't baked in any assumptions that nclumps = nthreads."},"comment":{"url":"https://api.github.com/repos/ESCOMP/ctsm/issues/comments/365445878","html_url":"https://github.com/ESCOMP/ctsm/issues/293#issuecomment-365445878","issue_url":"https://api.github.com/repos/ESCOMP/ctsm/issues/293","id":365445878,"user":{"login":"billsacks","id":6266741,"avatar_url":"https://avatars0.githubusercontent.com/u/6266741?v=4","gravatar_id":"","url":"https://api.github.com/users/billsacks","html_url":"https://github.com/billsacks","followers_url":"https://api.github.com/users/billsacks/followers","following_url":"https://api.github.com/users/billsacks/following{/other_user}","gists_url":"https://api.github.com/users/billsacks/gists{/gist_id}","starred_url":"https://api.github.com/users/billsacks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billsacks/subscriptions","organizations_url":"https://api.github.com/users/billsacks/orgs","repos_url":"https://api.github.com/users/billsacks/repos","events_url":"https://api.github.com/users/billsacks/events{/privacy}","received_events_url":"https://api.github.com/users/billsacks/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T23:51:17Z","updated_at":"2018-02-13T23:51:17Z","author_association":"OWNER","body":"**Comment from me 2016-08-25**\r\n\r\nYet another reason to do this: Currently, I'm at a loss as to how to write an infrastructure class that can handle arrays at any subgrid level (gridcell, landunit, column, or patch) in a way that works with our array-argument-passing conventions: Normally we declare the dummy argument as foo(bounds%begc : ). I can see a way to get the appropriate bounds at runtime, but can't see a way to replace this dummy argument declaration, short of passing bounds%begc (in this case) into the function, which feels messy."}}
{"actor":{"display_login":"billsacks"}}