@@ -143,6 +143,30 @@ class ModelsToRelax(enum.Enum):
143
143
'Relax on GPU can be much faster than CPU, so it is '
144
144
'recommended to enable if possible. GPUs must be available'
145
145
' if this setting is enabled.' )
146
+ flags .DEFINE_integer (
147
+ 'jackhmmer_n_cpu' ,
148
+ # Unfortunately, os.process_cpu_count() is only available in Python 3.13+.
149
+ min (len (os .sched_getaffinity (0 )), 8 ),
150
+ 'Number of CPUs to use for Jackhmmer. Defaults to min(cpu_count, 8). Going'
151
+ ' above 8 CPUs provides very little additional speedup.' ,
152
+ lower_bound = 0 ,
153
+ )
154
+ flags .DEFINE_integer (
155
+ 'hmmsearch_n_cpu' ,
156
+ # Unfortunately, os.process_cpu_count() is only available in Python 3.13+.
157
+ min (len (os .sched_getaffinity (0 )), 8 ),
158
+ 'Number of CPUs to use for HMMsearch. Defaults to min(cpu_count, 8). Going'
159
+ ' above 8 CPUs provides very little additional speedup.' ,
160
+ lower_bound = 0 ,
161
+ )
162
+ flags .DEFINE_integer (
163
+ 'hhsearch_n_cpu' ,
164
+ # Unfortunately, os.process_cpu_count() is only available in Python 3.13+.
165
+ min (len (os .sched_getaffinity (0 )), 8 ),
166
+ 'Number of CPUs to use for HHsearch. Defaults to min(cpu_count, 8). Going'
167
+ ' above 8 CPUs provides very little additional speedup.' ,
168
+ lower_bound = 0 ,
169
+ )
146
170
147
171
FLAGS = flags .FLAGS
148
172
@@ -464,7 +488,8 @@ def main(argv):
464
488
template_searcher = hmmsearch .Hmmsearch (
465
489
binary_path = FLAGS .hmmsearch_binary_path ,
466
490
hmmbuild_binary_path = FLAGS .hmmbuild_binary_path ,
467
- database_path = FLAGS .pdb_seqres_database_path )
491
+ database_path = FLAGS .pdb_seqres_database_path ,
492
+ cpu = FLAGS .hmmsearch_n_cpu )
468
493
template_featurizer = templates .HmmsearchHitFeaturizer (
469
494
mmcif_dir = FLAGS .template_mmcif_dir ,
470
495
max_template_date = FLAGS .max_template_date ,
@@ -475,7 +500,8 @@ def main(argv):
475
500
else :
476
501
template_searcher = hhsearch .HHSearch (
477
502
binary_path = FLAGS .hhsearch_binary_path ,
478
- databases = [FLAGS .pdb70_database_path ])
503
+ databases = [FLAGS .pdb70_database_path ],
504
+ cpu = FLAGS .hhsearch_n_cpu )
479
505
template_featurizer = templates .HhsearchHitFeaturizer (
480
506
mmcif_dir = FLAGS .template_mmcif_dir ,
481
507
max_template_date = FLAGS .max_template_date ,
@@ -495,15 +521,17 @@ def main(argv):
495
521
template_searcher = template_searcher ,
496
522
template_featurizer = template_featurizer ,
497
523
use_small_bfd = use_small_bfd ,
498
- use_precomputed_msas = FLAGS .use_precomputed_msas )
524
+ use_precomputed_msas = FLAGS .use_precomputed_msas ,
525
+ msa_tools_n_cpu = FLAGS .jackhmmer_n_cpu )
499
526
500
527
if run_multimer_system :
501
528
num_predictions_per_model = FLAGS .num_multimer_predictions_per_model
502
529
data_pipeline = pipeline_multimer .DataPipeline (
503
530
monomer_data_pipeline = monomer_data_pipeline ,
504
531
jackhmmer_binary_path = FLAGS .jackhmmer_binary_path ,
505
532
uniprot_database_path = FLAGS .uniprot_database_path ,
506
- use_precomputed_msas = FLAGS .use_precomputed_msas )
533
+ use_precomputed_msas = FLAGS .use_precomputed_msas ,
534
+ jackhmmer_n_cpu = FLAGS .jackhmmer_n_cpu )
507
535
else :
508
536
num_predictions_per_model = 1
509
537
data_pipeline = monomer_data_pipeline
0 commit comments