I wish to compare two parallel running of Abaqus simulations with umat coded in Fortran. It seems that I am able to select the correct standard.exe associated with each run, but it won't always be this lucky. This prompted me to ask if there is a way to call the abaqus job and change the name of standard.exe to maybe something like standard1.exe to differentiate between the runs. I checked abaqus help but it doesn't seem like there is an option through the command line.
There is a lot of room for improvement for jobs/analyses submission in Abaqus...
Anyways, feel free to have a look at my GitHub repo. I am trying to fill what's lacking in Abaqus when submitting jobs. Let me know if you have any question.
Or you can use this code to identify the right Process IDentifier (pid) of the job that you are running. You can then kill the process associated with this id.
import psutil
processesList = psutil.pids()
jobname=''
print('\n\nStart')
for proc in processesList:
try:
p = psutil.Process(proc)
if (p.name()=='standard.exe' or p.name()=='explicit.exe' or p.name()=='pre.exe' or p.name()=='explicit_dp.exe'):
i=0
jobCpus='1'
jobGpus='0'
sameJob = False
print('\nPID: %s'%proc)
for line in p.cmdline():
if line == '-job':
if jobname==p.cmdline()[i+1]:
sameJob = True
else:
sameJob=False
jobname=p.cmdline()[i+1]
print('Job Name: %s'%jobname)
elif line == '-indir':
jobdir=p.cmdline()[i+1]
print('Job Dir: %s'%jobdir)
elif line == '-cpus':
jobCpus=p.cmdline()[i+1]
print('Cpus number: %s'%jobCpus)
elif line == '-gpus':
jobGpus=p.cmdline()[i+1]
print('Gpus number: %s'%jobGpus)
i+=1
except:
pass
print('\nEnd\n\n')
In order to kill a process, you can use this command:
import os, signal
os.kill(int(pid), signal.SIGTERM)