Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

ABAQUS/Explicit: Executing multiple input files sequentially

Status
Not open for further replies.

ShadowWarrior

Civil/Environmental
Aug 21, 2006
171
I have put together a Python script (.py) to execute multiple input files sequentially, It will be run from CAE --> Run Script. But its not working, could anyone have a look and suggest some edits?


----------------------------------------------------------------------------------------------------
import abaqus
import abaqusConstants

myJob = mdb.JobFromInputFile(inputFileName="C:\Scratch\Job-1.inp", name="Firstjob", type=ANALYSIS, waitMinutes=15, numCpus=20, explicitPrecision=DOUBLE, nodalOutputPrecision=FULL, parallelizationMethodExplicit=DOMAIN, numDomains=20, multiprocessingMode=DEFAULT)
myJob.submit()
myJob.waitForCompletion()

-----------------------------------------------------------------------------------------------------

The machine will wait 15 minutes before executing next input file.

I will just copy-paste the above code under each block and change the directory.
 
Replies continue below

Recommended for you

What i said previously applies to analyses run with the interactive command and is correct. Not sure why you have copy/pasted instructions from the documentation that agree with what i said? Forget your batch file for a moment, open up a command window and issue the following:

abaqus job="C:\Temp\Mesh_convergence\study1\Job-1" cpus=4 interactive & abaqus job="C:\Temp\Mesh_convergence\study2\Job-2" cpus=4 interactive

Do the two analyses run consecutively?
 
@Dave442 - I mentioned the documentation for future reference. :)

I ran jobs using 'background' instead of 'interactive' and everything works well, there is no difference between CAE and 'background' run as per the documentation. Good thing is, consecutive run is also a success with 'background'.

call abaqus job="Job_name1" analysis input="C:\Temp\Mesh_convergence\study1\Job-1.inp" cpus=4 parallel=domain domains=4 background double=both output_precision=full
call abaqus job="Job_name2" analysis input="C:\Temp\Mesh_convergence\study2\Job-2.inp" cpus=4 parallel=domain domains=4 background double=both output_precision=full
PAUSE


But if I remove 'call' command, then analysis exits after first job run. Interesting...

I'll check what you suggested above shortly.


Edit: I'm also having a feeling that my ABAQUS installation needs a refresh.
 
I've been using this .bat:

Code:
path=c:\SIMULIA\Abaqus\Commands
abaqus python Ejecuta_Directorio.py

with this .py:

Python:
# Python script to execute all input decks
# within the directory from which this script is run
#
import sys
import os
#
i=0
run=[]
#
COMMAND = os.environ['ABA_COMMAND']
print
print 'NOTE all input files in this directory will be executed with ',COMMAND
files = os.listdir('.')
print
#
while i < len(files):
   nameall = files[i]
   ext = nameall[(len(nameall)-3):]
   if ext == 'inp':
     run.append(nameall[:(len(nameall)-4)])
   i=i+1
#
i=0
#
while i < len(run):
   name = run[i]
   cmd = COMMAND+' -j '+str(name)+' inter'+' cpus=48'
   print 'Executing '+cmd
   os.system(cmd)
   i=i+1
#
print
print '***'
print '**Completed all analysis runs**'

Ejecuting the file .bat all the .inp files will run in alphabetical order.
Maybe it will be useful for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor