Inheritance diagram for ApplicationInterface:

Public Member Functions | |
| ApplicationInterface (const ProblemDescDB &problem_db) | |
| constructor | |
| ~ApplicationInterface () | |
| destructor | |
Protected Member Functions | |
| void | init_communicators (const IntArray &message_lengths, const int &max_iterator_concurrency) |
| iterator and concurrent multiprocessor analyses within an evaluation. | |
| void | set_communicators (const IntArray &message_lengths) |
| (the partitions are already allocated in ParallelLibrary). | |
| void | free_communicators () |
| iterator and concurrent multiprocessor analyses within an evaluation. | |
| void | init_serial () |
| int | asynch_local_evaluation_concurrency () const |
| return asynchLocalEvalConcurrency | |
| String | interface_synchronization () const |
| return interfaceSynchronization | |
| void | map (const Variables &vars, const ActiveSet &set, Response &response, const bool asynch_flag=false) |
| Protected due to Interface letter-envelope idiom. | |
| void | manage_failure (const Variables &vars, const ActiveSet &set, Response &response, int failed_eval_id) |
| manages a simulation failure using abort/retry/recover/continuation | |
| const ResponseArray & | synch () |
| the beforeSynchCorePRPList queue and returns all jobs | |
| const IntResponseMap & | synch_nowait () |
| beforeSynchCorePRPList queue and returns a partial list of completed jobs | |
| void | serve_evaluations () |
| run on evaluation servers to serve the iterator master | |
| void | stop_evaluation_servers () |
| used by the iterator master to terminate evaluation servers | |
| virtual void | derived_map (const Variables &vars, const ActiveSet &set, Response &response, int fn_eval_id) |
| that is specific to a derived class. | |
| virtual void | derived_map_asynch (const ParamResponsePair &pair) |
| asynchronous evaluation that is specific to a derived class. | |
| virtual void | derived_synch (PRPList &prp_list) |
| classes. This version waits for at least one completion. | |
| virtual void | derived_synch_nowait (PRPList &prp_list) |
| any completions if none are immediately available. | |
| void | self_schedule_analyses () |
| evaluation using message passing | |
| void | serve_analyses_synch () |
| analysis job at a time | |
| virtual int | derived_synchronous_local_analysis (const int &analysis_id) |
| ApplicationInterface::serve_analyses_synch(). | |
Protected Attributes | |
| ParallelLibrary & | parallelLib |
| the concurrent evaluations and concurrent analyses parallelism levels | |
| bool | suppressOutput |
| flag for suppressing output on slave processors | |
| int | evalCommSize |
| size of evalComm | |
| int | evalCommRank |
| processor rank within evalComm | |
| int | evalServerId |
| evaluation server identifier | |
| bool | eaDedMasterFlag |
| flag for dedicated master partitioning at ea level | |
| int | analysisCommSize |
| size of analysisComm | |
| int | analysisCommRank |
| processor rank within analysisComm | |
| int | analysisServerId |
| analysis server identifier | |
| int | numAnalysisServers |
| number of analysis servers | |
| bool | multiProcAnalysisFlag |
| flag for multiprocessor analysis partitions | |
| bool | asynchLocalAnalysisFlag |
| flag for asynchronous local parallelism of analyses | |
| int | asynchLocalAnalysisConcurrency |
| scheduling and specifies hybrid concurrency when message passing | |
| int | numAnalysisDrivers |
| (from the analysis_drivers interface specification) | |
| IntSet | completionSet |
| and derived_synch_nowait() | |
Private Member Functions | |
| bool | duplication_detect (const Variables &vars, Response &response, const bool asynch_flag) |
| evaluation request has already been performed or queued | |
| void | self_schedule_evaluations () |
| using message passing; executes on iteratorComm master | |
| void | static_schedule_evaluations () |
| using message passing; executes on iteratorComm master | |
| void | asynchronous_local_evaluations (PRPList &prp_list) |
| the local processor | |
| void | synchronous_local_evaluations (PRPList &prp_list) |
| the local processor | |
| void | asynchronous_local_evaluations_nowait (PRPList &prp_list) |
| process any completed jobs | |
| void | serve_evaluations_synch () |
| one synchronous evaluation at a time | |
| void | serve_evaluations_asynch () |
| multiple asynchronous evaluations | |
| void | serve_evaluations_peer () |
| one synchronous evaluation at a time as part of the 1st peer | |
| void | set_evaluation_communicators (const IntArray &message_lengths) |
| following ParallelLibrary::init_evaluation_communicators(). | |
| void | set_analysis_communicators () |
| following ParallelLibrary::init_analysis_communicators(). | |
| void | check_configuration (const int &max_iterator_concurrency) |
| perform some error checks on the parallel configuration | |
| const ParamResponsePair & | get_source_pair (const Variables &target_vars) |
| evaluation to the failed "target" | |
| void | continuation (const Variables &target_vars, const ActiveSet &set, Response &response, const ParamResponsePair &source_pair, int failed_eval_id) |
| Invoked by manage_failure() for failAction == "continuation". | |
| void | common_input_filtering (const Variables &vars) |
| common input filtering operations, e.g. mesh movement | |
| void | common_output_filtering (Response &response) |
| common output filtering operations, e.g. data filtering | |
Private Attributes | |
| int | worldSize |
| size of MPI_COMM_WORLD | |
| int | worldRank |
| processor rank within MPI_COMM_WORLD | |
| int | iteratorCommSize |
| size of iteratorComm | |
| int | iteratorCommRank |
| processor rank within iteratorComm | |
| bool | ieMessagePass |
| flag for message passing at ie scheduling level | |
| int | numEvalServers |
| number of evaluation servers | |
| bool | eaMessagePass |
| flag for message passing at ea scheduling level | |
| int | procsPerAnalysis |
| processors per analysis servers | |
| int | lenVarsMessage |
| computed in Model::init_communicators() | |
| int | lenVarsActSetMessage |
| ActiveSet object; computed in Model::init_communicators(). | |
| int | lenResponseMessage |
| computed in Model::init_communicators() | |
| int | lenPRPairMessage |
| computed in Model::init_communicators() | |
| String | evalScheduling |
| auto-configure logic in ParallelLibrary::resolve_inputs(). | |
| String | analysisScheduling |
| auto-configure logic in ParallelLibrary::resolve_inputs(). | |
| int | asynchLocalEvalConcurrency |
| scheduling and specifies hybrid concurrency when message passing | |
| String | interfaceSynchronization |
| or asynchronous | |
| bool | headerFlag |
| function may be called many times prior to any completions) | |
| bool | asvControlFlag |
| on each evaluation. | |
| bool | evalCacheFlag |
| cache (i.e., queries and insertions using the data_pairs list). | |
| bool | restartFileFlag |
| insertions into write_restart). | |
| ShortArray | defaultASV |
| the static ASV values used when the user has selected asvControl = off | |
| String | failAction |
| retry, recover, or continuation | |
| int | failRetryLimit |
| limit on the number of retries for the retry failAction | |
| RealVector | failRecoveryFnVals |
| the dummy function values used for the recover failAction | |
| IntList | beforeSynchIdList |
| bookkeeps fnEvalId's of _all_ asynchronous evaluations (new & duplicate) | |
| IntResponseMap | historyDuplicateMap |
| evaluations. Map key is fnEvalId, mad data is corresponding response. | |
|
std::map< int, std::pair< PRPLIter, Response > > | beforeSynchDuplicateMap |
| beforeSynchCorePRPList evaluations | |
| PRPList | beforeSynchCorePRPList |
| that is later scheduled in synch() or synch_nowait(). | |
| PRPList | beforeSynchAlgPRPList |
| that is later evaluated in synch() or synch_nowait(). | |
| ResponseList | beforeSynchTotalRespList |
| asynchronous map() and later used in synch() or synch_nowait(). | |
| IntSet | runningSet |
| used by asynchronous_local_nowait to bookkeep which jobs are running | |
ApplicationInterface provides an interface class for performing parameter to response mappings using simulation code(s). It provides common functionality for a number of derived classes and contains the majority of all of the scheduling algorithms in DAKOTA. The derived classes provide the specifics for managing code invocations using system calls, forks, direct procedure calls, or distributed resource facilities.
| void init_serial | ( | ) | [inline, protected, virtual] |
DataInterface.C defaults of 0 servers are needed to distinguish an explicit user request for 1 server (serialization of a parallelism level) from no user request (use parallel auto-config). This default causes problems when init_communicators() is not called for an interface object (e.g., static scheduling fails in DirectApplicInterface::derived_map() for NestedModel::optionalInterface). This is the reason for this function: to reset certain defaults for interface objects that are used serially.
Reimplemented from Interface.
| void map | ( | const Variables & | vars, | |
| const ActiveSet & | set, | |||
| Response & | response, | |||
| const bool | asynch_flag = false | |||
| ) | [protected, virtual] |
Protected due to Interface letter-envelope idiom.
The function evaluator for application interfaces. Called from derived_compute_response() and derived_asynch_compute_response() in derived Model classes. If asynch_flag is not set, perform a blocking evaluation (using derived_map()). If asynch_flag is set, add the job to the beforeSynchCorePRPList queue for execution by one of the scheduler routines in synch() or synch_nowait(). Duplicate function evaluations are detected with duplication_detect().
Reimplemented from Interface.
| const ResponseArray & synch | ( | ) | [protected, virtual] |
the beforeSynchCorePRPList queue and returns all jobs
This function provides blocking synchronization for all cases of asynchronous evaluations, including the local asynchronous case (background system call, nonblocking fork, & multithreads), the message passing case, and the hybrid case. Called from derived_synchronize() in derived Model classes.
Reimplemented from Interface.
| const IntResponseMap & synch_nowait | ( | ) | [protected, virtual] |
beforeSynchCorePRPList queue and returns a partial list of completed jobs
This function will eventually provide nonblocking synchronization for all cases of asynchronous evaluations, however it currently supports only the local asynchronous case since nonblocking message passing schedulers have not yet been implemented. Called from derived_synchronize_nowait() in derived Model classes.
Reimplemented from Interface.
| void serve_evaluations | ( | ) | [protected, virtual] |
run on evaluation servers to serve the iterator master
Invoked by the serve() function in derived Model classes. Passes control to serve_evaluations_asynch(), serve_evaluations_peer(), or serve_evaluations_synch() according to specified concurrency and self/static scheduler configuration.
Reimplemented from Interface.
| void stop_evaluation_servers | ( | ) | [protected, virtual] |
used by the iterator master to terminate evaluation servers
This code is executed on the iteratorComm rank 0 processor when iteration on a particular model is complete. It sends a termination signal (tag = 0 instead of a valid fn_eval_id) to each of the slave analysis servers. NOTE: This function is called from the Strategy layer even when in serial mode. Therefore, use iteratorCommSize to provide appropriate fall through behavior.
Reimplemented from Interface.
| void self_schedule_analyses | ( | ) | [protected] |
evaluation using message passing
This code is called from derived classes to provide the master portion of a master-slave algorithm for the dynamic self-scheduling of analyses among slave servers. It is patterned after self_schedule_evaluations(). It performs no analyses locally and matches either serve_analyses_synch() or serve_analyses_asynch() on the slave servers, depending on the value of asynchLocalAnalysisConcurrency. Self-scheduling approach assigns jobs in 2 passes. The 1st pass gives each server the same number of jobs (equal to asynchLocalAnalysisConcurrency). The 2nd pass assigns the remaining jobs to slave servers as previous jobs are completed. Single- and multilevel parallel use intra- and inter-communicators, respectively, for send/receive. Specific syntax is encapsulated within ParallelLibrary.
| void serve_analyses_synch | ( | ) | [protected] |
analysis job at a time
This code is called from derived classes to run synchronous analyses on slave processors. The slaves receive requests (blocking receive), do local derived_map_ac's, and return codes. This is done continuously until a termination signal is received from the master. It is patterned after serve_evaluations_synch().
| bool duplication_detect | ( | const Variables & | vars, | |
| Response & | response, | |||
| const bool | asynch_flag | |||
| ) | [private] |
evaluation request has already been performed or queued
Called from map() to check incoming evaluation request for duplication with content of data_pairs and beforeSynchCorePRPList. If duplication is detected, return true, else return false. Manage bookkeeping with historyDuplicateMap and beforeSynchDuplicateMap. Note that the list searches can get very expensive if a long list is searched on every new function evaluation (either from a large number of previous jobs, a large number of pending jobs, or both). For this reason, a user request for deactivation of the evaluation cache results in a complete bypass of duplication_detect(), even though a beforeSynchCorePRPList search would still be meaningful. Since the intent of this request is to streamline operations, both list searches are bypassed.
| void self_schedule_evaluations | ( | ) | [private] |
using message passing; executes on iteratorComm master
This code is called from synch() to provide the master portion of a master-slave algorithm for the dynamic self-scheduling of evaluations among slave servers. It performs no evaluations locally and matches either serve_evaluations_synch() or serve_evaluations_asynch() on the slave servers, depending on the value of asynchLocalEvalConcurrency. Self-scheduling approach assigns jobs in 2 passes. The 1st pass gives each server the same number of jobs (equal to asynchLocalEvalConcurrency). The 2nd pass assigns the remaining jobs to slave servers as previous jobs are completed. Single- and multilevel parallel use intra- and inter-communicators, respectively, for send/receive. Specific syntax is encapsulated within ParallelLibrary.
| void static_schedule_evaluations | ( | ) | [private] |
using message passing; executes on iteratorComm master
This code runs on the iteratorCommRank 0 processor (the iterator) and is called from synch() in order to assign a static schedule. It matches serve_evaluations_peer() for any other processors within the 1st evaluation partition and serve_evaluations_synch()/serve_evaluations_asynch() for all other evaluation partitions (depending on asynchLocalEvalConcurrency). It performs function evaluations locally for its portion of the static schedule using either asynchronous_local_evaluations() or synchronous_local_evaluations(). Single-level and multilevel parallel use intra- and inter-communicators, respectively, for send/receive. Specific syntax is encapsulated within ParallelLibrary. The iteratorCommRank 0 processor assigns the static schedule since it is the only processor with access to beforeSynchCorePRPList (it runs the iterator and calls synchronize). The alternate design of each peer selecting its own jobs using the modulus operator would be applicable if execution of this function (and therefore the job list) were distributed.
| void asynchronous_local_evaluations | ( | PRPList & | prp_list | ) | [private] |
the local processor
This function provides blocking synchronization for the local asynch case (background system call, nonblocking fork, or threads). It can be called from synch() for a complete local scheduling of all asynchronous jobs or from static_schedule_evaluations() to perform a local portion of the total job set. It uses the derived_map_asynch() to initiate asynchronous evaluations and derived_synch() to capture completed jobs, and mirrors the self_schedule_evaluations() message passing scheduler as much as possible (derived_synch() is modeled after MPI_Waitsome()).
| void synchronous_local_evaluations | ( | PRPList & | prp_list | ) | [private] |
the local processor
This function provides blocking synchronization for the local synchronous case (foreground system call, blocking fork, or procedure call from derived_map()). It is called from static_schedule_evaluations() to perform a local portion of the total job set.
| void asynchronous_local_evaluations_nowait | ( | PRPList & | prp_list | ) | [private] |
process any completed jobs
This function provides nonblocking synchronization for the local asynch case (background system call, nonblocking fork, or threads). It is called from synch_nowait() and passed the complete set of all asynchronous jobs (beforeSynchCorePRPList). It uses derived_map_asynch() to initiate asynchronous evaluations and derived_synch_nowait() to capture completed jobs in nonblocking mode. It mirrors a nonblocking message passing scheduler as much as possible (derived_synch_nowait() modeled after MPI_Testsome()). The result of this function is rawResponseMap, which uses fn_eval_id as a key. It is assumed that the incoming prp_list contains only active and new jobs - i.e., all completed jobs are cleared by synch_nowait().
| void serve_evaluations_synch | ( | ) | [private] |
one synchronous evaluation at a time
This code is invoked by serve_evaluations() to perform one synchronous job at a time on each slave/peer server. The servers receive requests (blocking receive), do local synchronous maps, and return results. This is done continuously until a termination signal is received from the master (sent via stop_evaluation_servers()).
| void serve_evaluations_asynch | ( | ) | [private] |
multiple asynchronous evaluations
This code is invoked by serve_evaluations() to perform multiple asynchronous jobs on each slave/peer server. The servers test for any incoming jobs, launch any new jobs, process any completed jobs, and return any results. Each of these components is nonblocking, although the server loop continues until a termination signal is received from the master (sent via stop_evaluation_servers()). In the master-slave case, the master maintains the correct number of jobs on each slave. In the static scheduling case, each server is responsible for limiting concurrency (since the entire static schedule is sent to the peers at start up).
| void serve_evaluations_peer | ( | ) | [private] |
one synchronous evaluation at a time as part of the 1st peer
This code is invoked by serve_evaluations() to perform a synchronous evaluation in coordination with the iteratorCommRank 0 processor (the iterator) for static schedules. The bcast() matches either the bcast() in synchronous_local_evaluations(), which is invoked by static_schedule_evaluations()), or the bcast() in map().
1.5.1