ABAQUS/Explicit: Executing multiple input files sequentially
ABAQUS/Explicit: Executing multiple input files sequentially
(OP)
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.
----------------------------------------------------------------------------------------------------
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.





RE: ABAQUS/Explicit: Executing multiple input files sequentially
I assume the wait command isn't working on windows. Try without that.
Use the python functionality instead. In the time module is a sleep command.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
RE: ABAQUS/Explicit: Executing multiple input files sequentially
Do I need to import some additional namespaces at the beginning of the script?
@Dave442, Python script is something I can save in my HDD and later use it again by minor revision. Command line is different than that.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
I don't know how to fix your Python error. But you can do what you want from the command line without using Python. You can also store the commands in a text file and save to your HDD for revision/reuse in the future. If you are planning to spend any significant amount of time working with Abaqus, chances are you will commit these commands to memory anyhow.
windows:
abaqus job=jobname1 cpus=20 interactive & abaqus job=jobname2 cpus=20 interactive & .....
unix:
abaqus job=jobname1 cpus=20 interactive; abaqus job=jobname2 cpus=20 interactive; .....
Alternatively you can create a batch file to schedule a series of analyses. You can also save that on your HDD for future revision/reuse.
Good Luck,
Dave
RE: ABAQUS/Explicit: Executing multiple input files sequentially
Probably the abaqusConstants.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
RE: ABAQUS/Explicit: Executing multiple input files sequentially
*********************************************************
Are you new to this forum? If so, please read these FAQs:
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083
RE: ABAQUS/Explicit: Executing multiple input files sequentially
If not, there are instructions on how to schedule jobs to run at a specific time using command prompt & batch files in the link i posted previously (http://imechanica.org/node/18290).
Dave
RE: ABAQUS/Explicit: Executing multiple input files sequentially
Does the interactive command takes care of those calculations??
RE: ABAQUS/Explicit: Executing multiple input files sequentially
*********************************************************
Are you new to this forum? If so, please read these FAQs:
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083
RE: ABAQUS/Explicit: Executing multiple input files sequentially
Does this make sense? Or have I misunderstood your intentions?
Dave
RE: ABAQUS/Explicit: Executing multiple input files sequentially
THE ANALYSIS HAS COMPLETED SUCCESSFULLY
1/26/2016 5:29:36 AM
End Abaqus/Explicit Analysis
Begin State File Translator
1/26/2016 5:29:36 AM
Run state.exe
Any solution to this?
@IceBreakerSours - What I meant is all post-processing stages of analysis, as explained by Dave442. Now, If I use the command prompt with interactive, then I can see the progression of analysis. How can I see the same on screen with scripting (.py)??
RE: ABAQUS/Explicit: Executing multiple input files sequentially
abaqus job=01 cpus=20 interactive & abaqus job=02 cpus=20 interactive & abaqus job=03 cpus=20 interactive & ...
Minimize the command window and don't interfere with it. Navigate to the folder containing the input files and check the .log, .dat or .sta file if you want to check the progress of your analyses. If you interfere with the command window before your analyses have completed you will likely interrupt something. If you are still struggling, check the users manual or search "Abaqus sequential analyses". It comes up a lot.
I've used this method for all sorts of standard and explicit analyses and never had any problem. Hopefully you can get sorted. Not sure what you meant by "How can I see the same on screen with scripting (.py)". You don't need Python to do any of this.
EDIT
Just remembered something that might explain why your batch of runs did not complete. You need to alter the power saving settings on your machine. If your machine goes into hibernate due to inactivity your analyses will just stop progressing like you saw. Set your machine never to hibernate and when you leave in the evening just lock your screen.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
*********************************************************
Are you new to this forum? If so, please read these FAQs:
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083
RE: ABAQUS/Explicit: Executing multiple input files sequentially
abaqus job="Job_name" analysis input="C:\Temp\Mesh_convergence\study1\Job-1.inp" cpus=4 parallel=domain domains=4 interactive double=both output_precision=full
Now, I'm copy-pasting the above line for subsequent input files, but only the first analysis gets done and displays this message -
THE ANALYSIS HAS COMPLETED SUCCESSFULLY
1/26/2016 5:29:36 AM
End Abaqus/Explicit Analysis
Begin State File Translator
1/26/2016 5:29:36 AM
Run state.exe
What am I doing wrong??
Note that I have tried copy-pasting lines one below another or using "&" between two analysis lines, but both gives the same message.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
RE: ABAQUS/Explicit: Executing multiple input files sequentially
Below is a typical log file from CAE run -
The marked section is where it gets stuck in batch script run.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
abaqus job=jobname.inp cpus=20 interactive > jobname.txt
Is your machine going into hibernate/standby when you run your analyses? As I mentioned previously this will interrupt any analyses that are running interactively. I would take a small explicit analysis from the verification manual, copy it three times and then run the three analysis consecutively using your batch file. If they all run, you know your batch file is working fine. If they don't all run you know you have a problem. Also, post the contents of your batch file.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
interactive
This option will cause the job to run interactively. For Abaqus/Standard and Abaqus/CFD the log file will be output to the screen; for Abaqus/Explicit the status file and the log file will be output to the screen. The default run_mode can be set in the environment file (see “Using the Abaqus environment settings,” Section 3.3.1).
background
This option will submit the job to run in the background, which is the default. Log file output will be saved in the file job-name.log in the current directory. The default method for submitting the job can be set in the environment file by using the run_mode parameter (see “Using the Abaqus environment settings,” Section 3.3.1).
Contents of my batch file -
abaqus job="Job_name1" analysis input="C:\Temp\Mesh_convergence\study1\Job-1.inp" cpus=4 parallel=domain domains=4 interactive double=both output_precision=full
abaqus job="Job_name2" analysis input="C:\Temp\Mesh_convergence\study2\Job-2.inp" cpus=4 parallel=domain domains=4 interactive double=both output_precision=full
PAUSE
RE: ABAQUS/Explicit: Executing multiple input files sequentially
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?
RE: ABAQUS/Explicit: Executing multiple input files sequentially
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.
RE: ABAQUS/Explicit: Executing multiple input files sequentially
CODE -->
with this .py:
CODE --> 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.