Title / Description
Code #/////////////////////////////////////////////////////////////////////////////// def elapsed_time_fn (fn): def inner(*args, **kwargs): start_time = perf_counter() to_execute = fn(*args, **kwargs) end_time = perf_counter() execution_time = end_time - start_time print('{0} : elapsed {1:.8f}s '.format(fn.__name__, execution_time)) return to_execute return inner #/////////////////////////////////////////////////////////////////////////////// def setenv_openblas_num_thread (): cpu_core_cnt = "8" # !!! XXX os.environ["OPENBLAS_NUM_THREADS"] = cpu_core_cnt os.environ["OMP_NUM_THREADS"] = cpu_core_cnt os.environ["MKL_NUM_THREADS"] = cpu_core_cnt
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code