Skip to content
Snippets Groups Projects
Commit 6bfb8962 authored by Andri Joos's avatar Andri Joos :blush:
Browse files

fix memory usage

parent 3b742078
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ from .file_type import FileType
from .json_maneuver_data import JsonManeuverData
DOUBLE_PATTERN = r'Double(\d+)'
MAX_DATASET_MEMORY_SIZE = 7408802660
MAX_DATASET_MEMORY_SIZE = 16602933278
MIN_JOBS = 2
VARIANCE_THRESHOLD = 0.01
CORRELATION_THRESHOLD = 0.9
......@@ -223,6 +223,7 @@ def transform_dataset(dataset_dir: Path, out_dir: Path, state_description_file:
print('Your system may run out of memory. In this case, don\'t use parallelization.')
n_jobs = max(MIN_JOBS, min(n_jobs_based_on_cpu, n_jobs_based_on_memory))
print(f'Using {n_jobs} jobs')
Parallel(n_jobs=n_jobs)(delayed(_transform_parquet_file_function_with_args)(parquet_file, json_file) for parquet_file, json_file in file_tuples)
else:
for parquet_file, json_file in file_tuples:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment