@@ -1386,6 +1386,7 @@ def check_system_deps(check_ants=False,
13861386def check_config_resources (c ):
13871387 # Import packages
13881388 import psutil
1389+ import warnings
13891390 from multiprocessing import cpu_count
13901391
13911392 # Init variables
@@ -1433,39 +1434,29 @@ def check_config_resources(c):
14331434 'num_participants_at_once' ]
14341435
14351436 # Now check ANTS
1436- if 'ANTS' in c .registration_workflows ['anatomical_registration' ][
1437- 'registration' ]['using' ]:
1438- if c .pipeline_setup ['system_config' ]['num_ants_threads' ] is None :
1439- num_ants_cores = num_cores_per_sub
1440- elif c .pipeline_setup ['system_config' ]['num_ants_threads' ] > \
1441- c .pipeline_setup ['system_config' ][
1442- 'max_cores_per_participant' ]:
1443- err_msg = 'Number of threads for ANTS: %d is greater than the ' \
1444- 'number of threads per subject: %d. Change this and ' \
1445- 'try again.' % (
1446- c .pipeline_setup ['system_config' ]['num_ants_threads' ],
1447- c .pipeline_setup ['system_config' ][
1448- 'max_cores_per_participant' ])
1449- raise Exception (err_msg )
1450- else :
1451- num_ants_cores = c .pipeline_setup ['system_config' ][
1452- 'num_ants_threads' ]
1437+ if c .pipeline_setup ['system_config' ]['num_ants_threads' ] is None :
1438+ num_ants_cores = num_cores_per_sub
14531439 else :
1454- num_ants_cores = 1
1440+ if c .pipeline_setup ['system_config' ]['num_ants_threads' ] > \
1441+ c .pipeline_setup ['system_config' ]['max_cores_per_participant' ]:
1442+ warn_msg = 'Number of threads for ANTS: %d is greater than the ' \
1443+ 'number of threads per subject: %d.' % (
1444+ c .pipeline_setup ['system_config' ]['num_ants_threads' ],
1445+ c .pipeline_setup ['system_config' ]['max_cores_per_participant' ])
1446+ warnings .warn (warn_msg )
1447+ num_ants_cores = c .pipeline_setup ['system_config' ]['num_ants_threads' ]
14551448
14561449 # Now check OMP
14571450 if c .pipeline_setup ['system_config' ]['num_OMP_threads' ] is None :
14581451 num_omp_cores = 1
1459- elif c .pipeline_setup ['system_config' ]['num_OMP_threads' ] > \
1460- c .pipeline_setup ['system_config' ]['max_cores_per_participant' ]:
1461- err_msg = 'Number of threads for OMP: %d is greater than the ' \
1462- 'number of threads per subject: %d. Change this and ' \
1463- 'try again.' % (c .pipeline_setup ['system_config' ][
1464- 'num_OMP_threads' ],
1465- c .pipeline_setup ['system_config' ][
1466- 'max_cores_per_participant' ])
1467- raise Exception (err_msg )
14681452 else :
1453+ if c .pipeline_setup ['system_config' ]['num_OMP_threads' ] > \
1454+ c .pipeline_setup ['system_config' ]['max_cores_per_participant' ]:
1455+ warn_msg = 'Number of threads for OMP: %d is greater than the ' \
1456+ 'number of threads per subject: %d.' % (
1457+ c .pipeline_setup ['system_config' ]['num_OMP_threads' ],
1458+ c .pipeline_setup ['system_config' ]['max_cores_per_participant' ])
1459+ warnings .warn (warn_msg )
14691460 num_omp_cores = c .pipeline_setup ['system_config' ]['num_OMP_threads' ]
14701461
14711462 # Return memory and cores
0 commit comments