Optistruct automation

Rachit Semalty
Rachit Semalty Altair Community Member
edited June 2022 in Community Q&A

Hi all. I am working on an automation project. I want to kill an optistruct run. May I know what is the command to kill an optistruct run from python or tcl, or both if possible? Also, please note that there might be more than one optistruct run running simultaneously. So I want to kill just one of them and not all. 

Please help ASAP.

Regards,

Rachit

Best Answer

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022 Answer ✓

    Ah, ok, I see what is happening here, you are running the old NLGEOM subcase type, in this subcase the job is running Radioss, and OS is kind of suspended while this happens, to kill the subcase, in your case you can create a file Trial_Analysis_01_rad_s1_0001.ctl with the contents /KILL, then the osquit file Trial_Analysis_01.osquit will terminate the OS bit. In more recent versions of OS, I would suggest using a LGDISP subcase in place of NLGEOM.

     

Answers

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    I'm not sure if there is a specific way to kill a job like this, if you can write to the run directory though, you can create the file in the run folder with name <JOBNAME>.osquit (e.g. if the output file is my_run.out then this file should be my_run.osquit). Content of the file is irrelevant, it may be empty. That should stop the job.

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    I'm not sure if there is a specific way to kill a job like this, if you can write to the run directory though, you can create the file in the run folder with name <JOBNAME>.osquit (e.g. if the output file is my_run.out then this file should be my_run.osquit). Content of the file is irrelevant, it may be empty. That should stop the job.

    Hi Paul. Thanks for your reply. I did create a .osquit file with name of current run but it did not kill the run. First I made a text file with name <my_current_job_name>.osquit. That did not work. Then I made a .osquit file with name <my_current_job_name>.osquit. But that too didn't work. May you please tell me if I am wrong anywhere?

     

    Regards,

    Rachit

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    Hi Paul. Thanks for your reply. I did create a .osquit file with name of current run but it did not kill the run. First I made a text file with name <my_current_job_name>.osquit. That did not work. Then I made a .osquit file with name <my_current_job_name>.osquit. But that too didn't work. May you please tell me if I am wrong anywhere?

     

    Regards,

    Rachit

    Not sure what is happening for you, I just tested again in latest version as I have not used it in a long while, and it worked fine, the file needs to be in the running directory of the job, i.e. below I created optimisationrun.osquit (empty file) and the model run stopped within a few seconds.

    image

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    Not sure what is happening for you, I just tested again in latest version as I have not used it in a long while, and it worked fine, the file needs to be in the running directory of the job, i.e. below I created optimisationrun.osquit (empty file) and the model run stopped within a few seconds.

    image

    Hi Paul. I made a file like this:

    image

    And also like this:

     

    image

    But none of them worked. I am using 2017 optistruct solver and not compute console. Also, my analysis is NLGEOM. Are you able to identity any mistake I may be making?

     

    Regards,

    Rachit

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    Ah, I think maybe you have file extensions hidden in windows? It looks like what you may have done is create a file called FileName.osquit.txt and a file called FileName.osquit.osquit neither of those will work

    It should just be FileName.osquit

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    Ah, I think maybe you have file extensions hidden in windows? It looks like what you may have done is create a file called FileName.osquit.txt and a file called FileName.osquit.osquit neither of those will work

    It should just be FileName.osquit

    Hi Paul. Thanks for your quick reply. Yes I had file extensions hidden. Now I checked show file extension option and have created the following file:

    image

    But it still does not work. Is any other error possible?

     

    Regards,

    Rachit

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    Can you share a sample model? Maybe there is something specific in your case, I have run a couple of test cases and osquit works for me each time.

     

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    Can you share a sample model? Maybe there is something specific in your case, I have run a couple of test cases and osquit works for me each time.

     

    Yes sure.

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022 Answer ✓

    Ah, ok, I see what is happening here, you are running the old NLGEOM subcase type, in this subcase the job is running Radioss, and OS is kind of suspended while this happens, to kill the subcase, in your case you can create a file Trial_Analysis_01_rad_s1_0001.ctl with the contents /KILL, then the osquit file Trial_Analysis_01.osquit will terminate the OS bit. In more recent versions of OS, I would suggest using a LGDISP subcase in place of NLGEOM.

     

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    Ah, ok, I see what is happening here, you are running the old NLGEOM subcase type, in this subcase the job is running Radioss, and OS is kind of suspended while this happens, to kill the subcase, in your case you can create a file Trial_Analysis_01_rad_s1_0001.ctl with the contents /KILL, then the osquit file Trial_Analysis_01.osquit will terminate the OS bit. In more recent versions of OS, I would suggest using a LGDISP subcase in place of NLGEOM.

     

    Thanks for your reply. Yes it worked for my case. We will consider using LGDISP subcase in place of NLGEOM subcase.

     

    Regards,

    Rachit

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    Ah, ok, I see what is happening here, you are running the old NLGEOM subcase type, in this subcase the job is running Radioss, and OS is kind of suspended while this happens, to kill the subcase, in your case you can create a file Trial_Analysis_01_rad_s1_0001.ctl with the contents /KILL, then the osquit file Trial_Analysis_01.osquit will terminate the OS bit. In more recent versions of OS, I would suggest using a LGDISP subcase in place of NLGEOM.

     

    Hi. I want to ask one more question. After killing the run, steps files are converted to .rst file and then to .h3d files. Is there any way I may stop this conversion as this causes memory issues sometimes?

     

    Regards,

    Rachit

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    the rst files and the h3d creation by hvtrans are both as a result of the NLGEOM (radioss) subcase, there is nothing you can do to stop them, the rst are not turned into h3d, it is the Annn files that are converted

  • PaulAltair
    PaulAltair
    Altair Employee
    edited June 2022

    attached is a running example for LGDISP (Non linear geometry in Optistruct, natively), I was able to run it in v2022

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited June 2022

    attached is a running example for LGDISP (Non linear geometry in Optistruct, natively), I was able to run it in v2022

    Thanks for your help. It was helpful.

     

    Regards,

    Rachit