eisenmp.utils package

Submodules

eisenmp.utils.eisenmp_constants module

eisenmp constants single location

  • default queues names from procenv

mp_info_q # performance data, or other
mp_tools_q # data too big to send with every list to worker
mp_print_q # formatted screen output with multiprocessor lock(), use sparse
mp_input_q # default input
mp_output_q # default, results and stop msg
mp_process_q # proc shutdown msg’s to …worker_loader module
  • reserved names

START_METHOD default spawn, fork, forkserver
START_SEQUENCE_NUM process start number, use it to assign queues to CPU cores
NEXT_LIST next list from your generator -> iterator creates list
RESULTS_STORE keep in dictionary, will crash the system if store GB network chunks in mem
RESULTS_PRINT result rows of output are collected in a list, display if processes are stopped
RESULTS_DICT_PRINT shows content of results dict with ticket ID num _TID_
RESULT_LABEL revised.csv, Average calculation pretty print header for RESULTS_PRINT
WORKER_ID Process-1 -> 1
WORKER_PID process pid
WORKER_NAME process name
MULTI_TOOL tools_q, can be any prerequisite object for a module (made for huge wordlists for bruteforce)
STOP_MSG not in mp_print_q, …worker_loader module in one process informs other processes about stop
STOP_CONFIRM output_q_box collect thread gets worker messages, send exit messages to now idle processes
OUTPUT_HEADER ident proc result output_q_box (not stop msg) and copy result to result[INPUT_HEADER]
INPUT_HEADER should be the input queue name, ident queue result if multiple queues are used on one output
PERF_HEADER_ETA str PERF_HEADER_ETA
PERF_CURRENT_ETA header of list rows done for info_thread

eisenmp.utils.eisenmp_info module

class eisenmp.utils.eisenmp_info.ProcInfo(name, print_q, info_q_box, **kwargs)

Bases: Thread

Thread 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: object

Finest 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 numbers

Tuple 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

Module contents