ForkAnalysisCode Class Reference

simulations using forks. More...

Inheritance diagram for ForkAnalysisCode:

AnalysisCode List of all members.

Public Member Functions

 ForkAnalysisCode (const ProblemDescDB &problem_db)
 constructor
 ~ForkAnalysisCode ()
 destructor
pid_t fork_program (const bool block_flag)
 for completion using waitpid() if block_flag is true
void check_status (const int status)
 error code was returned
void ifilter_argument_list ()
 set argList for execution of the input filter
void ofilter_argument_list ()
 set argList for execution of the output filter
void driver_argument_list (const int analysis_id)
 set argList for execution of the specified analysis driver

Private Attributes

StringArray argList
 These are converted to an array of const char*'s in fork_program().

Detailed Description

simulations using forks.

ForkAnalysisCode creates a copy of the parent DAKOTA process using fork()/vfork() and then replaces the copy with a simulation process using execvp(). The parent process can then use waitpid() to wait on completion of the simulation process.


Member Function Documentation

void check_status ( const int  status  ) 

error code was returned

Check to see if the process terminated abnormally (WIFEXITED(status)==0) or if either execvp or the application returned a status code of -1 (WIFEXITED(status)!=0 && (signed char)WEXITSTATUS(status)==-1). If one of these conditions is detected, output a failure message and abort. Note: the application code should not return a status code of -1 unless an immediate abort of dakota is wanted. If for instance, failure capturing is to be used, the application code should write the word "FAIL" to the appropriate results file and return a status code of 0 through exit().


The documentation for this class was generated from the following files:
Generated on Wed Nov 5 19:54:06 2008 for DAKOTA by  doxygen 1.5.1