-
Notifications
You must be signed in to change notification settings - Fork 3
Initial publication of smp module for Python #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
setup.py
Outdated
| url ="https://software.intel.com/intel-distribution-for-python", | ||
| author ="Intel Corporation", | ||
| author_email="scripting@intel.com", | ||
| license ="Intel EULA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be BSD*?
| except: | ||
| ProcessPoolExecutor = None | ||
| ThreadPoolExecutor = None | ||
| from ctypes import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fair.. we'll fix that later though
fschlimb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks very nice. As noted, I might be able to give feedback on the content once I better understand what it's doing.
| threads_per_process = oversubscription_factor | ||
| if cpu_count >= process_count: | ||
| threads_per_process = threads_per_process*int(round(float(cpu_count) | ||
| /float(process_count))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand what this block is really doing.
Generally, the entire file has only 2 comments/hints. I have not been involved in any of the discussions about this topic so it's hard to follow what exactly is happening. The description in the other file does not help much either (as it does not go beyond re-phrasing the names of the arguments). There is no explanation what so ever of what this module is supposed to do, e.g. what the different input arguments really mean and how this works.
I suggest you add a high-level description of this file is really doing and add more specific comment to each function. Things like lines 223-225 could also use some comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| process_count=1, process_id=0): | ||
| from multiprocessing.pool import worker | ||
| set_proc_affinity(process_count, process_id) | ||
| worker(inqueue, outqueue, initializer, initargs, maxtasks, wrap_exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is almost identical with the 27 version. I see no reason for this code-duplication.
| w.name = w.name.replace('Process', 'PoolWorker') | ||
| w.daemon = True | ||
| w.start() | ||
| debug('added worker') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess generally all this code duplication should be avoided.
| global max_top_workers | ||
|
|
||
| if not sys.platform.startswith('linux'): | ||
| raise "Only linux is currently supported" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some platform specific is encoded right now, Anton G will rewrite it later
@avgorshk