The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
binding.c File Reference

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>
+ Include dependency graph for binding.c:

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_idlp_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
 

Detailed Description

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

Author
Alessandro Pellegrini

Definition in file binding.c.

Function Documentation

static int compare_lp_cost ( const void *  a,
const void *  b 
)
static

Convenience function to compare two elements of struct lp_cost_id. This is used for sorting the LP vector in LP_knapsack()

Author
Alessandro Pellegrini
Parameters
aPointer to the first element
bPointer to the second element
Returns
The comparison between a and b

Definition at line 124 of file binding.c.

+ Here is the caller graph for this function:

static void LP_knapsack ( void  )
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.

Author
Alessandro Pellegrini

Definition at line 143 of file binding.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void LPs_block_binding ( void  )
inlinestatic

Performs a (deterministic) block allocation between LPs and WTs

Author
Alessandro Pellegrini

Definition at line 75 of file binding.c.

+ Here is the caller graph for this function:

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

Author
Alessandro Pellegrini

Definition at line 252 of file binding.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: