It also takes care multicore/multiprocessor parallelism when possible. Objects of the same rank will be synchronized simultaneously, resources permitting.
The main processing loop calls each object passing to it a TIMESTAMP indicating the desired synchronization time. The sync() call attempts to advance the object's internal clock to the time indicated, and if successful it returns the time of the next expected change in the object's state. An object state change is one which requires the equilibrium equations of the object to be updated. When an object's state changes, all the other objects in the simulator are given an opportunity to consider the change and possibly alter the time of their next state change. The core continues calling objects, advancing the global clock when necessary, and continuing in this way until all objects indicate that no further state changes are expected. This is the equilibrium condition and the simulation consequently ends.
Classes | |
| struct | sync_data |
| struct | thread_data |
Defines | |
| #define | _MAX_PATH PATH_MAX |
| #define | PASSCMP(i, p) (p % 2 ? i <= ranks[p]->last_used : i >= ranks[p]->first_used) |
| #define | PASSINC(p) (p % 2 ? 1 : -1) |
| #define | PASSINIT(p) (p % 2 ? ranks[p]->first_used : ranks[p]->last_used) |
Functions | |
| int | exec_init () |
| The main system initialization sequence. | |
| STATUS | exec_start (void) |
| This is the main simulation loop. | |
| STATUS | exec_test (struct sync_data *data,int pass,OBJECT *obj) |
| Starts the executive test loop. | |
| char * | simtime (void) |
| STATUS | t_setup_ranks (void) |
| STATUS | t_sync_all (PASSCONFIG pass) |
Variables | |
| int | iteration_counter = 0 |
| int64 | lock_count = 0 |
| int64 | lock_spin = 0 |
| const PASSCONFIG | passtype [] = {PC_PRETOPDOWN, PC_BOTTOMUP, PC_POSTTOPDOWN} |
| int | stop_now |
| flag indicating the the debugger needs to be activated | |
| int exec_init | ( | void | ) |
The main system initialization sequence.
Definition at line 67 of file exec.c.
References FAILED, global_init(), random_init(), and timestamp_set_tz().
Referenced by main(), and mexFunction().
| STATUS exec_start | ( | void | ) |
This is the main simulation loop.
Definition at line 273 of file exec.c.
References convert_from_timestamp(), thread_data::count, s_listitem::data, thread_data::data, exec_debug(), exec_sigint(), FAILED, sync_data::hard_event, int64, iteration_counter, module_checkall(), s_listitem::next, output_debug(), output_error(), output_message(), output_verbose(), PASSCMP, PASSINC, PASSINIT, simtime(), sync_data::status, sync_data::step_to, stop_now, SUCCESS, THROW, TRY, and TS_NEVER.
Referenced by cmex_start(), and environment_start().
Starts the executive test loop.
< the current object
| data | the synchronization state data |
| pass | the pass number |
Definition at line 496 of file exec.c.
References FAILED, sync_data::hard_event, s_object_list::id, s_object_list::in_svc, iteration_counter, s_class_list::name, object_name(), object_sync(), s_object_list::oclass, output_error(), output_verbose(), simtime(), sync_data::status, sync_data::step_to, SUCCESS, and TS_NEVER.
Referenced by t_sync_all().