<s> """<STR_LIT>""" <EOL> from pyproct . data . dataDriver import DataDriver <EOL> from pyproct . data . matrix . matrixHandler import MatrixHandler <EOL> from pyRMSD . condensedMatrix import CondensedMatrix <EOL> import os <EOL> class MPIDataDriver ( DataDriver ) : <EOL> def __init__ ( self ) : <EOL> super ( MPIDataDriver , self ) . __init__ ( ) <EOL> @ classmethod <EOL> def run ( cls , rank , mpi_comm , parameters , workspace_handler , timer , generated_files ) : <EOL> DataDriver . timer = timer <EOL> data_handler = cls . load_data ( parameters ) <EOL> mpi_comm . Barrier ( ) <EOL> if rank == <NUM_LIT:0> : <EOL> matrix_handler = cls . calc_matrix ( data_handler , <EOL> parameters [ "<STR_LIT>" ] ) <EOL> matrix_contents = matrix_handler . distance_matrix . get_data ( ) <EOL> else : <EOL> matrix_contents = None <EOL> matrix_handler = MatrixHandler ( None , parameters [ "<STR_LIT>" ] ) <EOL> mpi_comm . Barrier ( ) <EOL> matrix_contents = mpi_comm . bcast ( matrix_contents , root = <NUM_LIT:0> ) <EOL> if rank != <NUM_LIT:0> : <EOL> matrix_handler . distance_matrix = CondensedMatrix ( matrix_contents ) <EOL> if rank == <NUM_LIT:0> : <EOL> statistics_file_path = matrix_handler . save_statistics ( workspace_handler [ "<STR_LIT>" ] ) <EOL> generated_files . append ( { <EOL> "<STR_LIT:description>" : "<STR_LIT>" , <EOL> "<STR_LIT:path>" : os . path . abspath ( statistics_file_path ) , <EOL> "<STR_LIT:type>" : "<STR_LIT:text>" <EOL> } ) <EOL> if "<STR_LIT:filename>" in parameters [ "<STR_LIT>" ] : <EOL> cls . save_matrix ( matrix_handler , <EOL> workspace_handler , <EOL> parameters [ "<STR_LIT>" ] ) <EOL> if rank == <NUM_LIT:1> : <EOL> if "<STR_LIT:image>" in parameters [ "<STR_LIT>" ] : <EOL> cls . plot_matrix ( matrix_handler , <EOL> workspace_handler , <EOL> parameters [ "<STR_LIT>" ] , <EOL> generated_files ) <EOL> return data_handler , matrix_handler </s>
