$extrastylesheet
Dakota
Version 6.2
|
Derived application interface class which spawns simulation codes using system calls. More...
Public Member Functions | |
SysCallApplicInterface (const ProblemDescDB &problem_db) | |
constructor | |
~SysCallApplicInterface () | |
destructor | |
Protected Member Functions | |
void | wait_local_evaluations (PRPQueue &prp_queue) |
void | test_local_evaluations (PRPQueue &prp_queue) |
int | synchronous_local_analysis (int analysis_id) |
void | init_communicators_checks (int max_eval_concurrency) |
void | set_communicators_checks (int max_eval_concurrency) |
void | map_bookkeeping (pid_t pid, int fn_eval_id) |
bookkeeping of process and evaluation ids for asynchronous maps | |
pid_t | create_evaluation_process (bool block_flag) |
Spawn the evaluation by managing the input filter, analysis drivers, and output filter. Called from derived_map() & derived_map_asynch(). | |
Private Member Functions | |
bool | system_call_file_test (const bfs::path &root_file) |
detect completion of a function evaluation through existence of the necessary results file(s) | |
void | spawn_evaluation_to_shell (bool block_flag) |
spawn a complete function evaluation | |
void | spawn_input_filter_to_shell (bool block_flag) |
spawn the input filter portion of a function evaluation | |
void | spawn_analysis_to_shell (int analysis_id, bool block_flag) |
spawn a single analysis as part of a function evaluation | |
void | spawn_output_filter_to_shell (bool block_flag) |
spawn the output filter portion of a function evaluation | |
Private Attributes | |
IntSet | sysCallSet |
set of function evaluation id's for active asynchronous system call evaluations | |
IntShortMap | failCountMap |
map linking function evaluation id's to number of response read failures |
Derived application interface class which spawns simulation codes using system calls.
system() is part of the C API and can be used on both Windows and Unix systems.
void wait_local_evaluations | ( | PRPQueue & | prp_queue | ) | [inline, protected, virtual] |
Check for completion of active asynch jobs (tracked with sysCallSet). Wait for at least one completion and complete all jobs that have returned. This satisifies a "fairness" principle, in the sense that a completed job will _always_ be processed (whereas accepting only a single completion could always accept the same completion - the case of very inexpensive fn. evals. - and starve some servers).
Reimplemented from ApplicationInterface.
Reimplemented in GridApplicInterface.
References ApplicationInterface::completionSet, and SysCallApplicInterface::test_local_evaluations().
void test_local_evaluations | ( | PRPQueue & | prp_queue | ) | [protected, virtual] |
Check for completion of active asynch jobs (tracked with sysCallSet). Make one pass through sysCallSet & complete all jobs that have returned.
Reimplemented from ApplicationInterface.
Reimplemented in GridApplicInterface.
References Dakota::abort_handler(), Response::active_set(), ApplicationInterface::completionSet, SysCallApplicInterface::failCountMap, ProcessApplicInterface::fileNameMap, Interface::final_eval_id_tag(), Dakota::lookup_by_eval_id(), ApplicationInterface::manage_failure(), ProcessApplicInterface::read_results_files(), SysCallApplicInterface::sysCallSet, and SysCallApplicInterface::system_call_file_test().
Referenced by SysCallApplicInterface::wait_local_evaluations().
int synchronous_local_analysis | ( | int | analysis_id | ) | [inline, protected, virtual] |
This code provides the derived function used by ApplicationInterface::serve_analyses_synch().
Reimplemented from ApplicationInterface.
Reimplemented in GridApplicInterface.
References SysCallApplicInterface::spawn_analysis_to_shell().
void init_communicators_checks | ( | int | max_eval_concurrency | ) | [inline, protected, virtual] |
No derived interface plug-ins, so perform construct-time checks. However, process init issues as warnings since some contexts (e.g., HierarchSurrModel) initialize more configurations than will be used.
Reimplemented from ApplicationInterface.
References ApplicationInterface::check_multiprocessor_analysis().
void set_communicators_checks | ( | int | max_eval_concurrency | ) | [inline, protected, virtual] |
Process run-time issues as hard errors.
Reimplemented from ApplicationInterface.
References Dakota::abort_handler(), and ApplicationInterface::check_multiprocessor_analysis().
void spawn_evaluation_to_shell | ( | bool | block_flag | ) | [private] |
spawn a complete function evaluation
Put the SysCallApplicInterface to the shell. This function is used when all portions of the function evaluation (i.e., all analysis drivers) are executed on the local processor.
References CommandShell::asynch_flag(), ProcessApplicInterface::commandLineArgs, ProcessApplicInterface::curWorkdir, Dakota::flush(), ProcessApplicInterface::iFilterName, ProcessApplicInterface::multipleParamsFiles, ProcessApplicInterface::oFilterName, ProcessApplicInterface::paramsFileName, ProcessApplicInterface::prepare_process_environment(), ProcessApplicInterface::programNames, ProcessApplicInterface::reset_process_environment(), ProcessApplicInterface::resultsFileName, CommandShell::suppress_output_flag(), ApplicationInterface::suppressOutput, and ProcessApplicInterface::useWorkdir.
Referenced by SysCallApplicInterface::create_evaluation_process().
void spawn_input_filter_to_shell | ( | bool | block_flag | ) | [private] |
spawn the input filter portion of a function evaluation
Put the input filter to the shell. This function is used when multiple analysis drivers are spread between processors. No need to check for a Null input filter, as this is checked externally. Use of nonblocking shells is supported in this fn, although its use is currently prevented externally.
References CommandShell::asynch_flag(), ProcessApplicInterface::commandLineArgs, Dakota::flush(), ProcessApplicInterface::iFilterName, ProcessApplicInterface::paramsFileName, ProcessApplicInterface::prepare_process_environment(), ProcessApplicInterface::reset_process_environment(), ProcessApplicInterface::resultsFileName, CommandShell::suppress_output_flag(), and ApplicationInterface::suppressOutput.
Referenced by SysCallApplicInterface::create_evaluation_process().
void spawn_analysis_to_shell | ( | int | analysis_id, |
bool | block_flag | ||
) | [private] |
spawn a single analysis as part of a function evaluation
Put a single analysis to the shell. This function is used when multiple analysis drivers are spread between processors. Use of nonblocking shells is supported in this fn, although its use is currently prevented externally.
References CommandShell::asynch_flag(), ProcessApplicInterface::commandLineArgs, Dakota::flush(), ProcessApplicInterface::multipleParamsFiles, ProcessApplicInterface::paramsFileName, ProcessApplicInterface::prepare_process_environment(), ProcessApplicInterface::programNames, ProcessApplicInterface::reset_process_environment(), ProcessApplicInterface::resultsFileName, CommandShell::suppress_output_flag(), and ApplicationInterface::suppressOutput.
Referenced by SysCallApplicInterface::create_evaluation_process(), SysCallApplicInterface::synchronous_local_analysis(), and GridApplicInterface::synchronous_local_analysis().
void spawn_output_filter_to_shell | ( | bool | block_flag | ) | [private] |
spawn the output filter portion of a function evaluation
Put the output filter to the shell. This function is used when multiple analysis drivers are spread between processors. No need to check for a Null output filter, as this is checked externally. Use of nonblocking shells is supported in this fn, although its use is currently prevented externally.
References CommandShell::asynch_flag(), ProcessApplicInterface::commandLineArgs, Dakota::flush(), ProcessApplicInterface::oFilterName, ProcessApplicInterface::paramsFileName, ProcessApplicInterface::prepare_process_environment(), ProcessApplicInterface::reset_process_environment(), ProcessApplicInterface::resultsFileName, CommandShell::suppress_output_flag(), and ApplicationInterface::suppressOutput.
Referenced by SysCallApplicInterface::create_evaluation_process().