eisenmp.utils package
Submodules
eisenmp.utils.eisenmp_constants module
eisenmp constants single location
default queues names from procenv
reserved names
eisenmp.utils.eisenmp_info module
- class eisenmp.utils.eisenmp_info.ProcInfo(name, print_q, info_q_box, **kwargs)
Bases:
ThreadThread start() cancel() Brute Force uses factorial as target to calculate. Prime uses ‘range_num’ of num generator as target. List rows done are the current state estimated time of arrival, ETA. So far.
We sit on the QueueCollect and loop over the collected items in a list or dict (box). instantiated by GhettoGang
- arrival_eta()
Calc ETA and percent done.
- cancel()
- perf_count_eta(info_box)
- perf_count_print_eta()
- performance_coll()
Print time and percent. Loops forever if no search str or performance info.
- run()
feed init args instead of method args
eisenmp.utils.eisenmp_utils module
- class eisenmp.utils.eisenmp_utils.Result
Bases:
objectFinest results only here.
- result_dict = {}
- result_dict_update(key: str, id_result: tuple) None
Results are sorted through the TID number. Key in the dictionary. If something is wrong, you see one TID is not there.
Calculation: max generator / ROWS_MAX = num of tickets; 10_000 / 42 = 238.095 -> 238 lists with ticket numbersTuple for simple extraction: id, result = result_dict[‘PRIME_NUM’] {‘PRIME_NUM’: [(ticket_id, result_lst), (ticket_id, result_lst)]}
- Params:
key: str name of the queue feeder ‘header_msg’ argument
- Params:
result_value_t: tuple(_TID_0, result)
- eisenmp.utils.eisenmp_utils.consecutive_number()
Want a stamp on each list header. Used for Queue messages get() and put in box_dict[num] = msg Can rebuild original order if worker puts result in a list with same num as order list.
- eisenmp.utils.eisenmp_utils.thread_shutdown_wait(*threads)
We return if none of the thread names are listed anymore. Blocks!
- Params:
threads: arbitrary list of thread names