code: def run_matrix_in_parallel(self, process_data):
          
          worker_data = [{'matrix': entry, 'pipeline': process_data.pipeline,
                          'model': process_data.model, 'options': process_data.options,
                          'hooks': process_data.hooks} for entry in self.matrix
                         if Matrix.can_process_matrix(entry, process_data.options.matrix_tags)]
          output = []
          success = True
          with closing(multiprocessing.Pool(multiprocessing.cpu_count())) as pool:
              for result in pool.map(matrix_worker, worker_data):
                  output += result['output']
                  if not result['success']:
                      success = False
          return {'success': success, 'output': output}
docs: Running pipelines in parallel.