You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. you don't know which worker will run this code, but you want the output to be different for each worker and
(for the first example) ideally the output would allow the coordinator (non-worker) process to be identifiable (e.g. myid() == 1), and (for the port example) for the values to be evenly spaced. We could use Libc.getpid, but it a pid doesn't have these extra properties like myid() does.
The text was updated successfully, but these errors were encountered:
that probably works for a script. If we're talking about putting this in a library, then it still shouldn't be too bad, because you create some kind of initworkers(n) function that basically does the above.
That's not to say we shouldn't change anything in ConcurrentUtilities; we could, for example, do something like eval const WORKER = true on each worker when we initialize the process or something, so you'd have a way to at least tell whether the current Julia evaluator is a worker or not. Or maybe a Ref{Bool} in ConcurrentUtilities w/ an accesor function like ConcurrentUtilities.isworker()? And we could set the Ref when we initialize the worker?
I'm open to ideas here. I think what I'd like to avoid though is the coordinator having to have a global pool where it keeps track of all the workers with all this global state around their IDs and such. I think I prefer leaving any more sophisticated worker coordination/management/pooling up to users in the calling context. I think the Distributed code that does all this just really overly complicates things.
suppose you want to know if you're coordinator or worker, e.g. you might want to write something like
or suppose you want to have workers only try to access "their" range of ports:
i.e. you don't know which worker will run this code, but you want the output to be different for each worker and
(for the first example) ideally the output would allow the coordinator (non-worker) process to be identifiable (e.g.
myid() == 1
), and (for the port example) for the values to be evenly spaced. We could useLibc.getpid
, but it a pid doesn't have these extra properties likemyid()
does.The text was updated successfully, but these errors were encountered: