<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html
  SYSTEM "about:legacy-compat">
<html xmlns:mml = "http://www.w3.org/1998/Math/MathML" lang = "en"><head><meta charset = "UTF-8"/><meta name = "copyright" content = "(C) Copyright 2020"/><meta name = "DC.rights.owner" content = "(C) Copyright 2020"/><meta name = "DC.type" content = "concept"/><meta name = "abstract" content = "An optimization is an iterative process that can run several hours or days depending on the size of the model. Different problems can arise during this process that can lead to a termination of the optimization task. Tosca Structure has a built-in restart functionality that can be used to avoid starting the complete optimization task again after a stop because of external factors. Optimization starts at the iteration where the interruption occurred. Tosca Structure's resume feature allows the user to continue a converged optimization with new convergence or stop criteria."/><meta name = "description" content = "An optimization is an iterative process that can run several hours or days depending on the size of the model. Different problems can arise during this process that can lead to a termination of the optimization task. Tosca Structure has a built-in restart functionality that can be used to avoid starting the complete optimization task again after a stop because of external factors. Optimization starts at the iteration where the interruption occurred. Tosca Structure's resume feature allows the user to continue a converged optimization with new convergence or stop criteria."/><meta name = "DC.date.modified" content = "2022-08-18"/><meta name = "DC.format" content = "HTML5"/><meta name = "DC.identifier" content = "tso-c-usr-control-restart"/><meta name = "DC.language" content = "en"/><link rel = "stylesheet" type = "text/css" href = "../DSDocUI_XML34.css"/><title>Restart and Resume Modes</title>
<script type = "text/javascript" src = "../DSDocUI_Highlight34.js">
  	/* */
  	</script></head><body onLoad = "highlightSearchTerms();" id = "tso-c-usr-control-restart">
<a name = "hj-top"> </a><table class = "table1" id = "table11"><tr><td><table class = "DocHeader"><tr><td class = "DocHeader1" colspan = "2"><h1>Restart and Resume Modes</h1></td></tr><tr><td class = "DocHeader4" colspan = "2"/></tr><tr><td class = "DocHeader3" colspan = "2"><table class = "DocThemeIntro" id = "table12"><tr><td class = "Intro1Only"><p class = "header"><p class = "abstract">
<span class = "shortdesc"> An optimization is an iterative process that can run several hours or days depending on
            the size of the model. Different problems can arise during this process that can lead to
            a termination of the optimization task.
			<span class = "ph">Tosca Structure</span>
	        has a built-in restart functionality that can be used to avoid starting the complete
            optimization task again after a stop because of external factors. Optimization starts at
            the iteration where the interruption occurred.
			<span class = "ph">Tosca Structure</span>'s
			resume feature allows the user to continue a converged optimization with new convergence or
			stop criteria.
		</span>

</p>
<p>This page discusses: </p><ul><li><a href = "#tso-c-usr-control-restart__tso-c-usr-control-restart-reqs" id = "toc_rg" title = "">Requirements for a Restart </a></li><li><a href = "#tso-c-usr-control-restart__tso-c-usr-control-restart-process" id = "toc_rg" title = "">Restart Process</a></li><li><a href = "#tso-c-usr-control-restart__tso-c-usr-control-resume-reqs" id = "toc_rg" title = "">Requirements for a Resume </a></li><li><a href = "#tso-c-usr-control-restart__tso-c-usr-control-resume-process" id = "toc_rg" title = "">Resume Process</a></li></ul>
</p></td></tr></table></td></tr></table>




  

<div class = "body conbody">

<div class = "note"><span class = "run-in.note">Note:
			</span><span class = "notecontent">Restart of an interrupted optimization should not be confounded with starting the
      (sensitivity-based topology) optimization newly with an already existing material
      distribution. In general, this initial material distribution is derived from a previous
      optimization run and defined using the parameter <code class = "ph codeph">INITIAL_DV_FIELD</code> in the
      command <code class = "ph codeph">DV_TOPO</code>. </span></div>


<div class = "section" id = "tso-c-usr-control-restart__tso-c-usr-control-restart-reqs"><h2 class = "title sectiontitle">Requirements for a Restart </h2>

<p>It is not always possible to restart the optimization after an interruption. Certain
requirements must be fulfilled to be able to restart a
<span class = "ph">Tosca Structure</span>
optimization.
A restart of an externally interrupted <span class = "ph">Tosca Structure</span>
job can be carried out when the following problems occur:
</p>

<ul class = "ul">
<li class = "li">Stop of the FE analysis because of a licensing problem; </li>
<li class = "li">Stop of the FE analysis because of  insufficient hard disk space; </li>
<li class = "li">Stop of the optimization module because of a lack of licenses; </li>
<li class = "li">User stop of the task (for example, by pressing <span class = "ph uicontrol">Ctrl</span> + <span class = "ph uicontrol">C</span>
                    in a command line).</li>
</ul>

<table class = "Remark" id = "table132"><tr><td class = "Remark"><span class = "run-in.important">Important:
				</span><span class = "notecontent">When a task interruption occurs because of problems with the optimization
        task formulation or due to convergence problems, a restart will not help. For example, when
        the finite element analysis stops because of distorted elements during shape optimization,
        the same problem occurs when a restart is executed.</span></td></tr></table>


</div>


<div class = "section" id = "tso-c-usr-control-restart__tso-c-usr-control-restart-process"><p><map name = "FPMap1"><area href = "#hj-top" title = "Back to Top" shape = "rect" coords = "416, 0, 435, 10"/></map><span class = "itemsprite"/></p><h2 class = "title sectiontitle">Restart Process</h2>

<p>During a restart, all settings of the original task are used to start the optimization again.
There is no possibility of modifying the settings for a restart because
the parameter file cannot be loaded again. But you might change the <code class = "ph codeph">--loglevel</code> parameters in the command line.
The start directory of the optimization task can be moved to any location.
</p><table class = "Remark" id = "table132"><tr><td class = "Remark"><span class = "run-in.important">Important:
				</span><span class = "notecontent">It is important that the relative location of the files in the job directory
        remains unchanged. </span></td></tr></table>

<p>For example, if the task was interrupted because of insufficient hard disk space and there is no
   possibility to create more space on the hard disk, the complete job directory can be
   transferred to another hard disk and a restart can be made from there. After
   optimization has been stopped, the files that were created during the optimization
   can be found either in the directory <code class = "ph codeph">jobname/DB_ERROR</code> or (when the
   control job has been interrupted) in the working directory
   (<code class = "ph codeph">jobname</code>).</p><p>At the beginning of a restart, all data is copied into the working directory
   (jobname). Various methods are available for a restart:</p>

<table class = "table"><caption/><colgroup><col style = "width:50%"/><col style = "width:50%"/></colgroup><thead class = "thead">
<tr class = "row"><th class = "entry" id = "tso-c-usr-control-restart__tso-c-usr-control-restart-process__entry__1"> Mode </th>
<th class = "entry" id = "tso-c-usr-control-restart__tso-c-usr-control-restart-process__entry__2"> Comment </th>
</tr>
</thead><tbody class = "tbody">
<tr class = "row">
<td class = "entry" headers = "tso-c-usr-control-restart__tso-c-usr-control-restart-process__entry__1"> <code class = "ph codeph">restart</code> (recommended)</td>
<td class = "entry" headers = "tso-c-usr-control-restart__tso-c-usr-control-restart-process__entry__2">This is the standard restart mode. Program call:

<pre class = "codeblock">
<code class = "ph codeph">
ToscaStructure.[bat|sh] restart -j &lt;jobname&gt;
</code>
</pre>
The standard restart is always started with a finite element analysis. This
means, after the required data has been copied, the finite element analysis is
started using the analysis model that was modified last and the optimization
task is then carried out.
</td>
</tr>

</tbody></table>
</div>


<div class = "section" id = "tso-c-usr-control-restart__tso-c-usr-control-resume-reqs"><p><map name = "FPMap1"><area href = "#hj-top" title = "Back to Top" shape = "rect" coords = "416, 0, 435, 10"/></map><span class = "itemsprite"/></p><h2 class = "title sectiontitle">Requirements for a Resume </h2>

<p>When analysing optimization results, you might observe that the defined convergence or stop
        criteria were too strict. For example, the optimization proceeds into the right direction,
        but stops before an acceptable density distribution is visible in the result. In this case,
        resuming the same optimization setup with newly defined convergence or stop criteria, the
        result might improve in terms of structural performance or can be better postprocessed. If a
        Restart.py file exists within the original working directory, the solver and other settings
        are taken from this file. If no Restart.py file is present, default settings are taken and
        the structural, life and/or EMAG solver need to be specified via the command line.</p>
<p>For this, the original optimization has to have converged successfully and the following files are needed in the original
   working directory:</p>
<ul class = "ul">
<li class = "li">New resume .par file (see example below) </li>
<li class = "li">Original .par file and all FE files </li>
<li class = "li">opt_res_database.idx and *.vtm</li>
<li class = "li">resume_database.idx and *.vtm</li>
<li class = "li">fe_mtx_database.idx and *.vtm (if generated during the original optimization run)</li>
</ul>

</div>


<div class = "section" id = "tso-c-usr-control-restart__tso-c-usr-control-resume-process"><p><map name = "FPMap1"><area href = "#hj-top" title = "Back to Top" shape = "rect" coords = "416, 0, 435, 10"/></map><span class = "itemsprite"/></p><h2 class = "title sectiontitle">Resume Process</h2>

<p>During a resume, all settings of the original task are used to resume the optimization except for convergence and stop criteria, which
can be newly defined. The new resume par file contains all new settings and a reference to the original optimization directory. For example:
<pre class = "codeblock">
<code class = "ph codeph">
RESUME
  ORG_FILE = &lt;name of original par file including extension&gt;
END_

STOP
  ID_NAME  = MY_STOP
  ITER_MAX = 75
END_

OPT_PARAM
  ID_NAME                = MY_PARAMETERS
  STOP_CRITERION_LEVEL   = BOTH
  STOP_CRITERION_OBJ     = 0.0001
  STOP_CRITERION_DV      = 0.0005
  STOP_CRITERION_ITER    = 4
END_
</code>
</pre>
</p>
<p>The following commands and command items are allowed in the resume .par file:</p>
<ul class = "ul">
<li class = "li">RESUME (required)<ul class = "ul">
	<li class = "li">ORG_FILE (required)</li></ul></li>
<li class = "li">STOP<ul class = "ul">
	<li class = "li">ID_NAME</li>
	<li class = "li">ITER_MAX</li></ul></li>
<li class = "li">OPT_PARAM<ul class = "ul">
	<li class = "li">ID_NAME</li>
    <li class = "li">STOP_CRITERION_CONVERGENCE</li>
	<li class = "li">STOP_CRITERION_LEVEL</li>
	<li class = "li">STOP_CRITERION_OBJ</li>
	<li class = "li">STOP_CRITERION_DV</li>
    <li class = "li">STOP_CRITERION_ITER</li></ul></li>
<li class = "li">DRIVER</li>
</ul>
<p>The necessary files as mentioned in the previous sections are copied into a new working directory in which the resume job is then executed.
   This way all original files and results are preserved.</p>
<p>The resume job is started using the resume run mode and the following command line:</p>
<table class = "table"><caption/><colgroup><col style = "width:50%"/><col style = "width:50%"/></colgroup><thead class = "thead">
<tr class = "row"><th class = "entry" id = "tso-c-usr-control-restart__tso-c-usr-control-resume-process__entry__1"> Mode </th>
<th class = "entry" id = "tso-c-usr-control-restart__tso-c-usr-control-resume-process__entry__2"> Comment </th>
</tr>
</thead><tbody class = "tbody">
<tr class = "row">
<td class = "entry" headers = "tso-c-usr-control-restart__tso-c-usr-control-resume-process__entry__1"> <code class = "ph codeph">resume</code> </td>
<td class = "entry" headers = "tso-c-usr-control-restart__tso-c-usr-control-resume-process__entry__2">This is the standard resume mode. Program call:

<pre class = "codeblock">
<code class = "ph codeph">
ToscaStructure.[bat|sh] resume -j &lt;resume_par&gt; --resume_data/-rdata &lt;path to orig_job_directory &gt;
</code>
</pre>
<p>Other allowed command line items are</p>
<pre class = "codeblock">
<code class = "ph codeph">
"-s":                 FE-solver name
"-o":                 Overwrite
"-report":            Report mode (VTFX, etc)
"-loglevel":          Loglevel (INFO, DEBUG, etc)
"-logfile":           Name of file containing logs (TOSCA.out)
"-sol_cpus":          Number of solver CPUs
"-sol_ques":          Number of solver queues
"-sol_args":          Additional arguments for solver
"-cpus":              Number of Tosca CPUs
"-fe_solver_version": Solver version
"-life":              Life solver name
</code>
</pre>


</td>
</tr>

</tbody></table>
</div>

</div>

</td></tr></table><script type = "text/javascript" src = "../DSDocUI_Bottom34.js">/* */</script></body>
</html>
