Stop AcuSolve job in Altair Access web
Hi,
I have access to Altair Access Web version where I can submit jobs and download the result files once completed.
My question is that when I submit an Acusolve job, I run it and I want to send it a signal to stop it but I don´t know how can I do it.
Is it possible to even do it?
Thank you.
Answers
-
Hi Sebastian,
In the Access interface, on the Jobs tab there will be two buttons active in the upper right of the window when a job is running. These are Terminate and Custom Actions.
Terminate:
- Stops a job immediately (similar to a qdel command)
- Only output that has already been written will be available after the job ends.
Custom Actions/acuSigStop:
- Signals AcuSolve to stop cleanly meaning that it will write out data at the end of the current step and then end the job.
- The Log file will contain messages similar to what is shown below indicating what is being written out prior to stopping:
0 -
Bill Calver_22424 said:
Hi Sebastian,
In the Access interface, on the Jobs tab there will be two buttons active in the upper right of the window when a job is running. These are Terminate and Custom Actions.
Terminate:
- Stops a job immediately (similar to a qdel command)
- Only output that has already been written will be available after the job ends.
Custom Actions/acuSigStop:
- Signals AcuSolve to stop cleanly meaning that it will write out data at the end of the current step and then end the job.
- The Log file will contain messages similar to what is shown below indicating what is being written out prior to stopping:
Hi Bill,
I actually tried clicking on that bottom, but the options in the dropdown menu are quite different than yours...
These are the options
As you can see, there is no stop option.
Shoud I contact my administrator?
0 -
Sebastian Yang said:
Hi Bill,
I actually tried clicking on that bottom, but the options in the dropdown menu are quite different than yours...
These are the options
As you can see, there is no stop option.
Shoud I contact my administrator?
Hi Sebastian,
Yes, that would be the best next step as those custom actions were most likely created by your local systems team.
0 -
Implementation details for reference:
Please refer this guide:
https://2023.help.altair.com/2023.2.0/accessweb/pdfs/DivingIntoApplicationDefinitions2023.2.0.pdf
- Check Application Actions
Two files responsible for Application actions:
- Actions xml (app-actions-AcuSolve.xml)
- action script acuSigStop.py ( this should be placed in runtime folder of AcuSolve)AcuSolve (app-def structure)
app-inp-AcuSolve.xml
app-conv-AcuSolve.xml
app-actions-AcuSolve.xml
runtime/start.py acuSigStop.py
submittime/presubmit.py
Sample actions xml and script
app-actions-AcuSolve.xml
#############################################################################
<?xml version="1.0" encoding="UTF-8"?>
<ApplicationActions xmlns="http://schemas.altair.com/pbs/2009/01/app-actions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:schemaLocation="http://schemas.altair.com/pbs/2009/01/app-actions ../../app-actions.xsd">
<ApplicationId>AcuSolve</ApplicationId>
<CustomAction>
<JobStates>
<JobState>RUNNING</JobState>
</JobStates>
<Name>acuSigStop</Name>
<DisplayName>acuSigStop</DisplayName>
<Description>Stop AcuSolveJob with AcuSig command</Description>
<Executable>
<Language>PYTHON</Language>
<Name>acuSigStop.py</Name>
</Executable>
</CustomAction>
</ApplicationActions>
acuSigStop.py
#########################################################
import sys,os,subprocess
if os.environ['PAS_HST_RUN'] == "true" or os.environ['PAS_HST_RUN'] == "true;false" or ( os.environ['PAS_INPUTFILE'] == os.environ['PAS_JOBFILES'] ):
dir=os.path.dirname(str(os.environ['PAS_INPUTFILE']).replace('pbscp://admin',''))
else:
dir=str(os.environ['PBS_JOBDIR'])
print 'Directory to execute acuSig is: ' + dir
cmd='cd ' + dir + '&&' + '/altair/hw/' + str(os.environ['PAS_VERSION']) + '/altair/acusolve/linux64/script/.acusim-sh&&/altair/hw/' + str(os.environ['PAS_VERSION']) + '/altair/acusolve/linux64/bin/acuSig -out -res -rst -stop'
print 'cmd to execute is: ' + cmd
res = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
#rc = res.returncode
#print 'cmd invocation Exit Status: ' + str(rc)
out = res.stdout.readlines()
print 'stdout = ' + str(out)
err = res.stderr.readlines()
print 'stderr = ' + str(err)
res.communicate()
sys.stdout.flush()
sys.stderr.flush()
rc = res.returncode
#print rc
print 'cmd invocation Exit Status: ' + str(rc)0