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

The machine would wait 15min before this job would be executed.

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.
 
just curious - why not run your analyses sequentially from the command line?
 
The problem is actually something else, please see the image.

PrtScr_capture_tvaa5q.jpg

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.
 
Sorry,

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

 
@Dave442 - Can I add an additional argument for delaying next input file execution for 5 minutes?
 
@ShadowWarrior - the 'interactive' term in the commands I posted ensures that each consecutive analysis is submitted as soon as the previous analysis is completed. Is this not what your after?

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 (
Dave
 
@Dave442 - After analysis, Abaqus does some calculations to find out the values of secondary variables from primary variables. That is why I think it is a good idea to give the machine some buffer time to do those calculations before running another job.

Does the interactive command takes care of those calculations??
 
@ShadowWarrior - The commands I've shown earlier will run each analysis consecutively. This includes all standard pre- and post-processing stages of the analysis. This procedure is the same as submitting a job in CAE, waiting for the job to complete and then submitting another job immediately. A standard analysis does not "complete" until all calculations have been completed. You should not need to specify any buffer time.

Does this make sense? Or have I misunderstood your intentions?

Dave



 
Yes, makes sense. I have followed the instructions provided in your link. But I'm getting the following message after 1st job finishes and the next job does not start -

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)??
 
If you used the commands i listed previously the analyses should run one after another. Assuming your using WIndows: Put all your input files into one folder on your machine. Name them 01, 02, 03, 04 ... Go to start menu -> Programs -> Abaqus -> Abaqus Command Prompt and navigate to the folder containing the input files. Issue the following commands:

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.
 
Dave is right. There is no need for a Python script because a batch script with those commands will get the job done. Googling should reveal several links where this has been discussed.

*********************************************************
Are you new to this forum? If so, please read these FAQs:

 
I have researched Abaqus documentation thoroughly and put together a fully controllable batch script (.bat) and it works perfectly -

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.

 
Dig around in the .log, .dat, .sta and .msg files for the hung up analysis to look for an issue?
 
@Dave442 - There is nothing suspicious in .dat, .sta and .msg files. However, When Jobs are being run through CAE, .log files are created. But with my batch script, no log file is being created.

Below is a typical log file from CAE run -

PrtScr_capture_upp0ml.jpg


The marked section is where it gets stuck in batch script run.
 
The .log file isn't generated when you run your analysis using the command prompt as the output of the .log file is displayed directly on your screen. If you want to save this output to a text file you can use the following commands:

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.
 
From ABAQUS documentation -
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor