<s> import asp . jit . asp_module as asp_module <EOL> import numpy as np <EOL> from em import * <EOL> import pickle <EOL> import sys <EOL> param_type_map = { <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> } <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> ifile_name = sys . argv [ <NUM_LIT:1> ] <EOL> ofile_name = sys . argv [ <NUM_LIT:2> ] <EOL> func_name = sys . argv [ <NUM_LIT:3> ] <EOL> device_id = sys . argv [ <NUM_LIT:4> ] <EOL> gmm = GMM ( <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> mod = gmm . get_asp_mod ( ) <EOL> mod . restore_method_timings ( func_name , ifile_name ) <EOL> var_names = mod . compiled_methods [ func_name ] . v_id_list <EOL> param_names = mod . compiled_methods [ func_name ] . param_names <EOL> var_times = mod . compiled_methods [ func_name ] . database . variant_times <EOL> f = file ( ofile_name , '<STR_LIT:a>' ) <EOL> f . write ( "<STR_LIT>" + "<STR_LIT:U+002C>" * len ( param_names ) + "<STR_LIT>" ) <EOL> f . write ( "<STR_LIT>" % '<STR_LIT:U+002C>' . join ( param_names ) ) <EOL> f . write ( "<STR_LIT>" % <EOL> '<STR_LIT:U+002C>' . join ( [ param_type_map . get ( n , '<STR_LIT>' ) [ <NUM_LIT:0> ] for n in param_names ] ) ) <EOL> f . write ( "<STR_LIT>" % <EOL> '<STR_LIT:U+002C>' . join ( [ param_type_map . get ( n , '<STR_LIT>' ) [ <NUM_LIT:1> ] for n in param_names ] ) ) <EOL> for size , times in var_times . items ( ) : <EOL> for name in var_names : <EOL> time = times [ name ] <EOL> f . write ( "<STR_LIT>" % ( func_name , <EOL> device_id , <EOL> '<STR_LIT:U+002C>' . join ( [ str ( p ) for p in size [ <NUM_LIT:1> : ] ] ) , <EOL> '<STR_LIT:U+002C>' . join ( name . split ( '<STR_LIT:_>' ) [ <NUM_LIT:1> : ] ) , <EOL> time ) ) <EOL> f . close ( ) </s>
