![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Load sharing rules across worker threads. More...
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <arch/atomic.h>
#include <core/core.h>
#include <core/timer.h>
#include <datatypes/list.h>
#include <scheduler/binding.h>
#include <scheduler/process.h>
#include <scheduler/scheduler.h>
#include <statistics/statistics.h>
#include <gvt/gvt.h>
#include <arch/thread.h>
Go to the source code of this file.
Data Structures | |
struct | lp_cost_id |
Macros | |
#define | REBIND_INTERVAL 10.0 |
Functions | |
static void | LPs_block_binding (void) |
static int | compare_lp_cost (const void *a, const void *b) |
static void | LP_knapsack (void) |
static void | post_local_reduction (void) |
static void | install_binding (void) |
void | rebind_LPs (void) |
Variables | |
struct lp_cost_id * | lp_cost |
static __thread bool | first_lp_binding = true |
A guard to know whether this is the first invocation or not. | |
static unsigned int * | new_LPS_binding |
static timer | rebinding_timer |
static int | binding_acquire_phase = 0 |
static __thread int | local_binding_acquire_phase = 0 |
static int | binding_phase = 0 |
static __thread int | local_binding_phase = 0 |
static atomic_t | worker_thread_reduction |
Load sharing rules across worker threads.
Implements load sharing rules for LPs among worker threads
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file binding.c.
|
static |
Convenience function to compare two elements of struct lp_cost_id. This is used for sorting the LP vector in LP_knapsack()
a | Pointer to the first element |
b | Pointer to the second element |
Definition at line 124 of file binding.c.
|
inlinestatic |
Implements the knapsack load sharing policy in:
Roberto Vitali, Alessandro Pellegrini and Francesco Quaglia A Load Sharing Architecture for Optimistic Simulations on Multi-Core Machines In Proceedings of the 19th International Conference on High Performance Computing (HiPC) Pune, India, IEEE Computer Society, December 2012.
Definition at line 143 of file binding.c.
|
inlinestatic |
void rebind_LPs | ( | void | ) |
This function is used to create a temporary binding between LPs and KLT. The first time this function is called, each worker thread sets up its data structures, and the performs a (deterministic) block allocation. This is because no runtime data is available at the time, so we "share" the load as the number of LPs. Then, successive invocations, will use the knapsack load sharing policy
Definition at line 252 of file binding.c.