Namespaces | Functions
library_mode.C File Reference

file containing a mock simulator main for testing DAKOTA in library mode More...

Namespaces

namespace  Dakota
 

The primary namespace for DAKOTA.


Functions

void nidr_set_input_string (const char *)
 Set input to NIDR via string argument instead of input file.
int nidr_save_exedir (const char *, int)
void run_dakota_parse (const char *dakota_input_file)
 Function to encapsulate the DAKOTA object instantiations for mode 1: parsing an input file.
void run_dakota_data ()
 Function to encapsulate the DAKOTA object instantiations for mode 2: direct Data class instantiation.
void run_dakota_mixed (const char *dakota_input_file)
 Function to encapsulate the DAKOTA object instantiations for mode 3: mixed parsing and direct updating.
void model_interface_plugins (Dakota::ProblemDescDB &problem_db)
int main (int argc, char *argv[])
 A mock simulator main for testing DAKOTA in library mode.
static void my_callback_function (void *ptr)

Detailed Description

file containing a mock simulator main for testing DAKOTA in library mode


Function Documentation

void run_dakota_parse ( const char *  dakota_input_file)

Function to encapsulate the DAKOTA object instantiations for mode 1: parsing an input file.

This function parses from an input file to define the ProblemDescDB data.

References ProblemDescDB::lock(), ProblemDescDB::manage_inputs(), model_interface_plugins(), Strategy::run_strategy(), and ParallelLibrary::world_rank().

Referenced by main().

void run_dakota_mixed ( const char *  dakota_input_file)

Function to encapsulate the DAKOTA object instantiations for mode 3: mixed parsing and direct updating.

This function showcases multiple features. For parsing, either an input file (dakota_input_file != NULL) or a default input string (dakota_input_file == NULL) are shown. This parsed input is then mixed with input from three sources: (1) input from a user-supplied callback function, (2) updates to the DB prior to Strategy instantiation, (3) updates directly to Iterators/Models following Strategy instantiation.

References ProblemDescDB::broadcast(), ProblemDescDB::get_dsa(), ProblemDescDB::lock(), model_interface_plugins(), ProblemDescDB::model_list(), ParallelLibrary::mpirun_flag(), my_callback_function(), nidr_set_input_string(), ProblemDescDB::parse_inputs(), ProblemDescDB::post_process(), ProblemDescDB::resolve_top_method(), Strategy::run_strategy(), ProblemDescDB::set(), and ParallelLibrary::world_rank().

Referenced by main().

Iterate over models and plugin appropriate interface: serial rosenbrock or parallel textbook.

References Dakota::abort_handler(), Interface::interface_type(), ProblemDescDB::model_list(), ParallelLevel::server_intra_communicator(), and ProblemDescDB::set_db_model_nodes().

Referenced by Dakota::run_dakota_data(), run_dakota_mixed(), and run_dakota_parse().

int main ( int  argc,
char *  argv[] 
)

A mock simulator main for testing DAKOTA in library mode.

Uses alternative instantiation syntax as described in the library mode documentation within the Developers Manual. Tests several problem specification modes: (1) run_dakota_parse: reads all problem specification data from an input file (2) run_dakota_data: creates all problem specification from direct Data instance instantiations. (3) run_dakota_mixed: a mixture of input parsing (by file or default string) and direct data updates, where the data updates occur: (a) via the DB prior to Strategy instantiation, and (b) via Iterators/Models following Strategy instantiation. Usage: dakota_library_mode [-m] [dakota.in]

References ParallelLibrary::detect_parallel_launch(), Dakota::run_dakota_data(), run_dakota_mixed(), and run_dakota_parse().

static void my_callback_function ( void *  ptr) [static]

Example of user-provided callback function to override input specified and managed by NIDR, e.g., from an input deck.

References ProblemDescDB::get_dsa(), ProblemDescDB::get_string(), ProblemDescDB::resolve_top_method(), and ProblemDescDB::set().

Referenced by run_dakota_mixed().