15 #ifndef INCLUDED_protocols_elscripts_Slave_hh
16 #define INCLUDED_protocols_elscripts_Slave_hh
26 void lregister_Slave( lua_State * lstate );
28 class Slave :
public BaseRole {
32 Slave(
int master = 1, boost::uint64_t mem_limit=2147483648, boost::uint64_t reserved_mem=104857600, boost::uint64_t reserved_mem_multiplier=10 );
36 boost::uint64_t available_mem() {
37 boost::uint64_t buff_mem =
38 master_comm_->current_mem() +
39 reserved_mem_ * reserved_mem_multiplier_ +
41 if( buff_mem >= mem_limit_ ) {
44 return mem_limit_ - buff_mem;
53 boost::uint64_t current_mem() {
54 return master_comm_->
current_mem() + mover_cache_mem();