Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simultaneous Jobs with Python Script

Status
Not open for further replies.

catrueeb

Mechanical
Joined
Nov 21, 2018
Messages
13
Location
CH
I am trying to run a big number of Jobs simultaneously, on a lot of different CPUs. In my Python Script I am runnning a loop which submits all the jobs WITHOUT calling waitforcompletion(). Still, if I run my script over 'abaqus cae noGUI=...' it is processing the jobs sequentially. Why is this? Î have thousands of jobs and would like to distribute them over my cores.
 
I have just tried it and could reproduce your behavior. I don't know the reason for that, maybe a bug.

As a workaround you could write out the .inp and directly submit it via python to the OS (so not through A/CAE). Make sure you have enough tokens.

Code:
from abaqus import *
from abaqusConstants import *
from caeModules import *
import os
#
#
openMdb(pathName='testjobs.cae')

my_jobs = mdb.jobs.keys()

for x in my_jobs:
	mdb.jobs[x].writeInput(consistencyChecking=OFF)
	os.system('abaqus job='+x)
 
Thank you! It is quite weird, especially because when you call the same script inside CAE (instead of cmd line), the jobs execute in parallel. What you have posted, works for me.
I have got one question about this: When is it actually necessary to run a script over the cae command? I have always done it, because cae manages the abaqus imports into python and I didn't have to find the modules by myself. But instead of this, why would you actually call abaqus cae noGUI instead of the python script?
And finally, I am running my jobs on a cluster and I do not have full control over the number of tokens. If I have too little tokens for my jobs, they just get queued until the licenses are available, right? Thanks!
 
There is usually no need to execute analysis from within A/CAE. During installation Abaqus registers commands to the OS. Write out the input file and then you can execute that through a command line, a batch file, a script, a queuing system, etc.
Im my example Python sends the command to the OS to start a run with the .inp that was written out before.

And yes, I think Abaqus reties to submit a job for a certain time when not enough tokens were available before. You can set that option in the environment file. Search for 'lmlicensequeuing' in the installation manual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top