{"action":"created","issue":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/1520","repository_url":"https://api.github.com/repos/flux-framework/flux-core","labels_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1520/labels{/name}","comments_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1520/comments","events_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1520/events","html_url":"https://github.com/flux-framework/flux-core/issues/1520","id":323705478,"number":1520,"title":"wrexecd should set default cpu affinity for all tasks to CPU list in R_lite","user":{"login":"grondo","id":741970,"avatar_url":"https://avatars3.githubusercontent.com/u/741970?v=4","gravatar_id":"","url":"https://api.github.com/users/grondo","html_url":"https://github.com/grondo","followers_url":"https://api.github.com/users/grondo/followers","following_url":"https://api.github.com/users/grondo/following{/other_user}","gists_url":"https://api.github.com/users/grondo/gists{/gist_id}","starred_url":"https://api.github.com/users/grondo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grondo/subscriptions","organizations_url":"https://api.github.com/users/grondo/orgs","repos_url":"https://api.github.com/users/grondo/repos","events_url":"https://api.github.com/users/grondo/events{/privacy}","received_events_url":"https://api.github.com/users/grondo/received_events","type":"User","site_admin":false},"labels":[{"id":132876207,"url":"https://api.github.com/repos/flux-framework/flux-core/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"grondo","id":741970,"avatar_url":"https://avatars3.githubusercontent.com/u/741970?v=4","gravatar_id":"","url":"https://api.github.com/users/grondo","html_url":"https://github.com/grondo","followers_url":"https://api.github.com/users/grondo/followers","following_url":"https://api.github.com/users/grondo/following{/other_user}","gists_url":"https://api.github.com/users/grondo/gists{/gist_id}","starred_url":"https://api.github.com/users/grondo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grondo/subscriptions","organizations_url":"https://api.github.com/users/grondo/orgs","repos_url":"https://api.github.com/users/grondo/repos","events_url":"https://api.github.com/users/grondo/events{/privacy}","received_events_url":"https://api.github.com/users/grondo/received_events","type":"User","site_admin":false},"assignees":[{"login":"grondo","id":741970,"avatar_url":"https://avatars3.githubusercontent.com/u/741970?v=4","gravatar_id":"","url":"https://api.github.com/users/grondo","html_url":"https://github.com/grondo","followers_url":"https://api.github.com/users/grondo/followers","following_url":"https://api.github.com/users/grondo/following{/other_user}","gists_url":"https://api.github.com/users/grondo/gists{/gist_id}","starred_url":"https://api.github.com/users/grondo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grondo/subscriptions","organizations_url":"https://api.github.com/users/grondo/orgs","repos_url":"https://api.github.com/users/grondo/repos","events_url":"https://api.github.com/users/grondo/events{/privacy}","received_events_url":"https://api.github.com/users/grondo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-05-16T16:56:10Z","updated_at":"2018-05-17T03:56:03Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Since `R_lite` now encodes the specific list of CPUs granted to the job being launched by `wrexecd`, the `wrexecd` should at least set its CPU affinity mask to this cpus list. All tasks launched will then inherit this mask, and while not strict containment, this may help partition jobs from each other on shared nodes.\r\n\r\nThis may be possible by just adding another lua plugin to `lua.d`, I will work on it later today.\r\n"},"comment":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/comments/389736899","html_url":"https://github.com/flux-framework/flux-core/issues/1520#issuecomment-389736899","issue_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1520","id":389736899,"user":{"login":"grondo","id":741970,"avatar_url":"https://avatars3.githubusercontent.com/u/741970?v=4","gravatar_id":"","url":"https://api.github.com/users/grondo","html_url":"https://github.com/grondo","followers_url":"https://api.github.com/users/grondo/followers","following_url":"https://api.github.com/users/grondo/following{/other_user}","gists_url":"https://api.github.com/users/grondo/gists{/gist_id}","starred_url":"https://api.github.com/users/grondo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grondo/subscriptions","organizations_url":"https://api.github.com/users/grondo/orgs","repos_url":"https://api.github.com/users/grondo/repos","events_url":"https://api.github.com/users/grondo/events{/privacy}","received_events_url":"https://api.github.com/users/grondo/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T03:56:03Z","updated_at":"2018-05-17T03:56:03Z","author_association":"CONTRIBUTOR","body":"@dongahn, if you replace the existing `02-affinity.lua` script in `wreck/lua.d` with something like this, a default cpu affinity per rank should be applied to all tasks, using the assigned core list in `R_lite`:\r\n\r\n```lua\r\nfunction fetch_rank_corelist (wreck)\r\n    local R_lite = wreck.kvsdir.R_lite\r\n    if not R_lite then return nil, \"No R_lite found\" end\r\n\r\n    -- Get index into R_lite (Lua array indexed from 1)\r\n    local R = R_lite [wreck.nodeid + 1]\r\n    if not R then\r\n        return nil, \"Unable to find rank data for node\"..wreck.nodeid\r\n    end\r\n\r\n    return R.children.core\r\nend\r\n\r\n--\r\n-- Set cpu affinity to R_lite[rank]\r\n--\r\nfunction rexecd_init ()\r\n    local setaffinity = require 'flux.affinity'.setaffinity\r\n    local cores, err = fetch_rank_corelist (wreck)\r\n    if not cores then\r\n        wreck:log_msg (\"setaffinity: %s\", err)\r\n        return\r\n    end\r\n    assert (setaffinity (cores))\r\nend\r\n\r\n-- vi: ts=4 sw=4 expandtab\r\n```\r\n\r\nThis is just a proof of concept. I'll propose something later with better integration (that doesn't require fetching `R_lite` a second time from kvs)"}}
{"actor":{"display_login":"grondo"}}