<s> __author__ = '<STR_LIT>' <EOL> from pypet import Environment , Trajectory <EOL> from pypet . tests . testutils . ioutils import make_temp_dir , get_log_config <EOL> import os <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> import time <EOL> def job ( traj ) : <EOL> traj . f_ares ( '<STR_LIT>' , <NUM_LIT> , comment = '<STR_LIT>' ) <EOL> def get_runtime ( length ) : <EOL> filename = os . path . join ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> with Environment ( filename = filename , <EOL> log_levels = <NUM_LIT:50> , report_progress = ( <NUM_LIT> , '<STR_LIT>' , <NUM_LIT:50> ) , <EOL> overwrite_file = True , purge_duplicate_comments = False , <EOL> log_stdout = False , <EOL> multiproc = False , ncores = <NUM_LIT:2> , use_pool = True , <EOL> wrap_mode = '<STR_LIT>' , <EOL> summary_tables = False , small_overview_tables = False ) as env : <EOL> traj = env . v_traj <EOL> traj . par . f_apar ( '<STR_LIT:x>' , <NUM_LIT:0> , '<STR_LIT>' ) <EOL> traj . f_explore ( { '<STR_LIT:x>' : range ( length ) } ) <EOL> max_run = <NUM_LIT:1000> <EOL> for idx in range ( len ( traj ) ) : <EOL> if idx > max_run : <EOL> traj . f_get_run_information ( idx , copy = False ) [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> start = time . time ( ) <EOL> env . f_run ( job ) <EOL> end = time . time ( ) <EOL> total = end - start <EOL> return total / float ( min ( len ( traj ) , max_run ) ) , total / float ( min ( len ( traj ) , max_run ) ) * len ( traj ) <EOL> def main ( ) : <EOL> lengths = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1000> , <NUM_LIT> , <NUM_LIT:100> , <NUM_LIT:50> , <NUM_LIT:10> , <NUM_LIT:5> , <NUM_LIT:1> ] <EOL> runtimes = [ get_runtime ( x ) for x in lengths ] <EOL> avg_runtimes = [ x [ <NUM_LIT:0> ] for x in runtimes ] <EOL> summed_runtime = [ x [ <NUM_LIT:1> ] for x in runtimes ] <EOL> plt . subplot ( <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> plt . semilogx ( list ( reversed ( lengths ) ) , list ( reversed ( avg_runtimes ) ) , linewidth = <NUM_LIT:2> ) <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> plt . title ( '<STR_LIT>' ) <EOL> plt . grid ( ) <EOL> plt . subplot ( <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> plt . loglog ( lengths , summed_runtime , linewidth = <NUM_LIT:2> ) <EOL> plt . grid ( ) <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> plt . title ( '<STR_LIT>' ) <EOL> plt . savefig ( '<STR_LIT>' ) <EOL> plt . show ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
