<s> __author__ = '<STR_LIT>' <EOL> import multiprocessing as mp <EOL> import numpy as np <EOL> import os <EOL> from pypet import Environment , cartesian_product <EOL> def multiply ( traj , result_list ) : <EOL> """<STR_LIT>""" <EOL> z = traj . x * traj . y <EOL> result_list [ traj . v_idx ] = z <EOL> def main ( ) : <EOL> filename = os . path . join ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> env = Environment ( trajectory = '<STR_LIT>' , <EOL> filename = filename , <EOL> file_title = '<STR_LIT>' , <EOL> overwrite_file = True , <EOL> comment = '<STR_LIT>' , <EOL> continuable = False , <EOL> multiproc = True , <EOL> ncores = <NUM_LIT:2> ) <EOL> traj = env . trajectory <EOL> traj . f_add_parameter ( '<STR_LIT:x>' , <NUM_LIT:1> , comment = '<STR_LIT>' ) <EOL> traj . f_add_parameter ( '<STR_LIT:y>' , <NUM_LIT:1> , comment = '<STR_LIT>' ) <EOL> traj . f_explore ( cartesian_product ( { '<STR_LIT:x>' : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] , '<STR_LIT:y>' : [ <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> ] } ) ) <EOL> result_list = mp . Manager ( ) . list ( ) <EOL> result_list [ : ] = [ <NUM_LIT:0> for _dummy in range ( len ( traj ) ) ] <EOL> env . run ( multiply , result_list ) <EOL> traj . f_add_result ( '<STR_LIT:z>' , np . array ( result_list ) ) <EOL> print ( traj . z ) <EOL> env . disable_logging ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
