Skip to content

Commit 7a7b99e

Browse files
committed
limit cpu usage
1 parent bcf3474 commit 7a7b99e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

greedyFAS/annoFAS/annoFAS.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def runAnnoFas(args):
5858
annoOut = []
5959
if annoModules.checkFileEmpty(outFile) == True or force:
6060
if extract == '':
61-
print('Doing annotation for %s...' % seqFile)
61+
print(f'Doing annotation for {seqFile} using {cpus} CPUs...' % )
6262
annoJobs = annoModules.createAnnoJobs([outName, outPath, seqFile, toolPath,
6363
annoModules.getAnnoTools(annoToolFile, toolPath), eFlps, signalpOrg,
6464
eFeature, eInstance, hmmCores, pid])
@@ -207,6 +207,8 @@ def main():
207207
cpus = args.cpus
208208
if cpus == 0:
209209
cpus = mp.cpu_count()-1
210+
if cpus > mp.cpu_count():
211+
cpus = mp.cpu_count() - 1
210212

211213
# option for saving json file
212214
outPath = os.path.abspath(args.outPath)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
setup(
3030
name='greedyFAS',
31-
version='1.18.19',
31+
version='1.18.20',
3232
python_requires='>=3.12.0',
3333
description='A tool to compare protein feature architectures',
3434
long_description=long_description,

0 commit comments

Comments
 (0)