How Xopt Interfaces with HyperStudy

The files hopt_lock and extopt_lock are opened alternately to switch between the operations of HyperOpt and Xopt. In addition, the files hopt_run and extopt_run identify if either process is still active.

Note: Since the HyperOpt process is fixed, the user-defined optimizer must be written to work with this process.
Figure 1. HyperOpt and Xopt Processes


HyperOpt Process

  1. HyperStudy invokes HyperOpt.

    Information is provided to HyperOpt on input variables, constraints, and the objective through the .opt file.

  2. HyperOpt creates the files hopt_run and hopt_lock.
    • hopt_run indicates that HyperOpt is running. This file is automatically deleted if HyperOpt terminates.
    • extopt_lock indicates that HyperOpt must wait for Xopt.
  3. HyperOpt creates the file extrnopt.dat.

    Xopt will read some key data (number of variables, variable bounds, constraints, etc.) from extrnopt.dat.

  4. Set ndes = 0.
  5. HyperOpt invokes Xopt.
  6. If ndes > 0, create extrnopt.rsp which contains the output response values.
  7. HyperOpt creates the file extopt_lock and deletes the file hopt_lock.
  8. HyperOpt checks for the existence of extopt_run; if extopt_run does not exist, go to step 14.
  9. HyperOpt checks for the existence of extopt_lock.

    If extopt_lock exists then HyperOpt waits, continually checking for the existence of extopt_lock. It continues on to step 10 when extopt_lock no longer exists.

  10. HyperOpt creates the file hopt_lock.
  11. HyperOpt reads the file extrnopt.des; if the keyword "stop" is found in the file, go to step 14.
  12. HyperOpt invokes the solver defined in the HyperStudy interface.
  13. ndes = ndes + 1.

    If ndes < MAXDES (maximum number of iterations), go to step 6.

  14. The process ends here.

Xopt Process

  1. Xopt creates the file extopt_run.

    extopt_run indicates that Xopt is running.

  2. Xopt checks for the existence of hopt_lock.

    If hopt_lock exists then Xopt sleeps for 0.1 seconds and repeats step 2.

  3. Xopt reads extrnopt.dat which is essential for optimization (number of variables, variable bounds, constraints, etc.).
  4. Xopt performs optimization iteration.
  5. Xopt writes out the next design point that needs to be analyzed to the file extrnopt.des.
  6. Xopt creates the file hopt_lock.

    hopt_lock indicates that Xopt must wait for HyperOpt (see step 9).

  7. Xopt deletes extopt_lock.

    This allows HyperOpt to continue.

  8. Xopt checks for the existence of hopt_run; if hopt_run does not exist, then Xopt terminates as HyperOpt has been terminated irregularly.
  9. Xopt checks for the existence of hopt_lock; if hopt_lock exists then Xopt sleeps for 0.1 seconds and repeats step 9.
  10. Xopt creates the file extopt_lock.

    extopt_lock indicates that HyperOpt must wait for Xopt.

    Xopt must remove the file extopt_lock in case of process termination. For example, if Xopt is written using Fortran, use of the statement 'dispose = "delete"' is required.

  11. Xopt reads in output responses from the file extrnopt.rsp.
  12. If the optimization process has not reached convergence, go to step 4.
  13. The process ends here.