$extrastylesheet
Dakota  Version 6.2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ForkApplicInterface Class Reference

Derived application interface class which spawns simulation codes using fork/execvp/waitpid. More...

Inheritance diagram for ForkApplicInterface:
ProcessHandleApplicInterface ProcessApplicInterface ApplicationInterface Interface

List of all members.

Public Member Functions

 ForkApplicInterface (const ProblemDescDB &problem_db)
 constructor
 ~ForkApplicInterface ()
 destructor

Protected Member Functions

void wait_local_evaluations (PRPQueue &prp_queue)
 For asynchronous function evaluations, this method is used to detect completion of jobs and process their results. It provides the processing code that is specific to derived classes. This version waits for at least one completion.
void test_local_evaluations (PRPQueue &prp_queue)
 For asynchronous function evaluations, this method is used to detect completion of jobs and process their results. It provides the processing code that is specific to derived classes. This version is nonblocking and will return without any completions if none are immediately available.
pid_t create_analysis_process (bool block_flag, bool new_group)
 spawn a child process for an analysis component within an evaluation using fork()/execvp() and wait for completion using waitpid() if block_flag is true
size_t wait_local_analyses ()
 wait for asynchronous analyses on the local processor, completing at least one job
size_t test_local_analyses_send (int analysis_id)
 test for asynchronous analysis completions on the local processor and return results for any completions by sending messages
void join_evaluation_process_group (bool new_group)
 create (if new_group) and join the process group for asynch evaluations
void join_analysis_process_group (bool new_group)
 create (if new_group) and join the process group for asynch analyses
void evaluation_process_group_id (pid_t pgid)
 set evalProcGroupId
pid_t evaluation_process_group_id () const
 return evalProcGroupId
void analysis_process_group_id (pid_t pgid)
 set analysisProcGroupId
pid_t analysis_process_group_id () const
 return analysisProcGroupId
pid_t wait_evaluation (bool block_flag)
 process all available completions within the evaluation process group; if block_flag = true, wait for at least one completion
pid_t wait_analysis (bool block_flag)
 process all available completions within the analysis process group; if block_flag = true, wait for at least one completion
void check_group (int err, pid_t proc_group_id)
 check the exit status of setpgid and abort if an error code was returned

Private Member Functions

pid_t wait (pid_t proc_group_id, std::map< pid_t, int > &process_id_map, bool block_flag)
 core code used by wait_{evaluation,analysis}()
void join_process_group (pid_t &process_group_id, bool new_group)
 core code used by join_{evaluation,analysis}_process_group()

Private Attributes

pid_t evalProcGroupId
 the process group id used to identify a set of child evaluation processes used by this interface instance (to distinguish from other interface instances that could be running at the same time)
pid_t analysisProcGroupId
 the process group id used to identify a set of child analysis processes used by this interface instance (to distinguish from other interface instances that could be running at the same time)

Detailed Description

Derived application interface class which spawns simulation codes using fork/execvp/waitpid.

ForkApplicInterface is used on Unix systems and is a peer to SpawnApplicInterface for Windows systems.


The documentation for this class was generated from the following files: