|
44 | 44 |
|
45 | 45 | import cgatcore.experiment as E |
46 | 46 | import cgatcore.iotools as iotools |
47 | | -from cgatcore.pipeline.parameters import input_validation, get_params, get_parameters |
| 47 | +from cgatcore.pipeline.parameters import ( |
| 48 | + input_validation, get_params, get_parameters, write_params_init_file) |
48 | 49 | from cgatcore.experiment import get_header, MultiLineFormatter |
49 | 50 | from cgatcore.pipeline.utils import get_caller, get_caller_locals, is_test |
50 | 51 | from cgatcore.pipeline.execution import execute, start_session, \ |
@@ -1251,6 +1252,9 @@ def initialize(argv=None, caller=None, defaults=None, optparse=True, **kwargs): |
1251 | 1252 | logger.info("changing directory to {}".format(work_dir)) |
1252 | 1253 | os.chdir(work_dir) |
1253 | 1254 |
|
| 1255 | + # Write params snapshot for spawned worker processes (multiprocess with spawn) |
| 1256 | + write_params_init_file(work_dir) |
| 1257 | + |
1254 | 1258 | logger.info("pipeline has been initialized") |
1255 | 1259 |
|
1256 | 1260 | return args |
@@ -1302,7 +1306,8 @@ def run_workflow(args, argv=None, pipeline=None): |
1302 | 1306 | logger=logger, verbose=args.loglevel, log_exceptions=args.log_exceptions, |
1303 | 1307 | exceptions_terminate_immediately=args.exceptions_terminate_immediately, |
1304 | 1308 | checksum_level=args.ruffus_checksums_level, pipeline=pipeline, |
1305 | | - one_second_per_job=False |
| 1309 | + one_second_per_job=False, |
| 1310 | + multiprocess=args.multiprocess |
1306 | 1311 | ) |
1307 | 1312 |
|
1308 | 1313 | except ruffus.ruffus_exceptions.RethrownJobError as ex: |
|
0 commit comments