From 82a75b3efd23a8dba1c8eea15c4fc450219a1f86 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 3 May 2021 21:53:20 +0300 Subject: add default no of cores --- gn3/computations/correlations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index e5a70da..0d15d9b 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -137,7 +137,7 @@ def compute_all_sample_correlation(this_trait, processed_values.append((trait_name, corr_method, *filter_shared_sample_keys( this_trait_samples, target_trait_data))) - with multiprocessing.Pool() as pool: + with multiprocessing.Pool(4) as pool: results = pool.starmap(compute_sample_r_correlation, processed_values) for sample_correlation in results: @@ -457,7 +457,7 @@ def compute_tissue_correlation(primary_tissue_dict: dict, processed_values.append( (primary_tissue_vals, target_tissue_vals, corr_method, trait_id)) - with multiprocessing.Pool() as pool: + with multiprocessing.Pool(4) as pool: results = pool.starmap( tissue_correlation_for_trait_list, processed_values) for result in results: -- cgit v1.2.3