Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Remove fastrun #117

Merged
merged 3 commits into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/dsn/tool-api/aio_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class task_queue;
@{
*/
//
// !!! all threads must be started with task::set_tls_dsn_context(null, provider->node());
// !!! all threads must be started with task::set_tls_dsn_context(provider->node(), null);
//
class aio_provider
{
Expand All @@ -81,7 +81,7 @@ class aio_provider
virtual void aio(aio_task *aio) = 0;
virtual disk_aio *prepare_aio_context(aio_task *) = 0;

virtual void start(io_modifer &ctx) = 0;
virtual void start() = 0;

protected:
DSN_API void
Expand Down
33 changes: 2 additions & 31 deletions include/dsn/tool-api/global_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct service_app_spec
int delay_seconds;
bool run;
int count; // index = 1,2,...,count
int ports_gap; // when count > 1 or service_spec.io_mode != IOE_PER_NODE
int ports_gap; // when count > 1

network_client_configs network_client_confs;
network_server_configs network_server_confs;
Expand Down Expand Up @@ -173,11 +173,7 @@ struct service_spec
std::list<std::string> rwlock_nr_aspects;
std::list<std::string> semaphore_aspects;

ioe_mode disk_io_mode; // whether disk is per node or per queue
ioe_mode rpc_io_mode; // whether rpc is per node or per queue
ioe_mode nfs_io_mode; // whether nfs is per node or per queue
ioe_mode timer_io_mode; // whether timer is per node or per queue
int io_worker_count; // for disk and rpc when per node
int io_worker_count; // for disk and rpc

network_client_configs network_default_client_cfs; // default network configed by tools
network_server_configs network_default_server_cfs; // default network configed by tools
Expand All @@ -191,7 +187,6 @@ struct service_spec
service_spec() {}
DSN_API bool init();
DSN_API bool init_app_specs();
DSN_API int get_ports_delta(int app_id, dsn::threadpool_code pool, int queue_index) const;
};

CONFIG_BEGIN(service_spec)
Expand Down Expand Up @@ -230,30 +225,6 @@ CONFIG_FLD_STRING_LIST(rwlock_nr_aspects,
"non-recursive rwlock aspect providers, usually for tooling purpose")
CONFIG_FLD_STRING_LIST(semaphore_aspects, "semaphore aspect providers, usually for tooling purpose")

CONFIG_FLD_ENUM(ioe_mode,
disk_io_mode,
IOE_PER_NODE,
IOE_INVALID,
false,
"how many disk engines? IOE_PER_NODE, or IOE_PER_QUEUE")
CONFIG_FLD_ENUM(ioe_mode,
rpc_io_mode,
IOE_PER_NODE,
IOE_INVALID,
false,
"how many rpc engines? IOE_PER_NODE, or IOE_PER_QUEUE")
CONFIG_FLD_ENUM(ioe_mode,
nfs_io_mode,
IOE_PER_NODE,
IOE_INVALID,
false,
"how many nfs engines? IOE_PER_NODE, or IOE_PER_QUEUE")
CONFIG_FLD_ENUM(ioe_mode,
timer_io_mode,
IOE_PER_NODE,
IOE_INVALID,
false,
"how many disk timer services? IOE_PER_NODE, or IOE_PER_QUEUE")
CONFIG_FLD(int,
uint64,
io_worker_count,
Expand Down
4 changes: 2 additions & 2 deletions include/dsn/tool-api/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class task_queue;

/*!
network bound to a specific rpc_channel and port (see start)
!!! all threads must be started with task::set_tls_dsn_context(null, provider->node());
!!! all threads must be started with task::set_tls_dsn_context(provider->node(), null);
*/
class network
{
Expand Down Expand Up @@ -85,7 +85,7 @@ class network
//
// when client_only is true, port is faked (equal to app id for tracing purpose)
//
virtual error_code start(rpc_channel channel, int port, bool client_only, io_modifer &ctx) = 0;
virtual error_code start(rpc_channel channel, int port, bool client_only) = 0;

//
// the named address
Expand Down
2 changes: 1 addition & 1 deletion include/dsn/tool-api/nfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class nfs_node

virtual ~nfs_node() {}

virtual ::dsn::error_code start(io_modifer &ctx) = 0;
virtual ::dsn::error_code start() = 0;

virtual error_code stop() = 0;

Expand Down
13 changes: 2 additions & 11 deletions include/dsn/tool-api/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ struct __tls_dsn__
disk_engine *disk;
env_provider *env;
nfs_node *nfs;
timer_service *tsvc;

int last_worker_queue_size;
uint64_t node_pool_thread_ids; // 8,8,16 bits
Expand Down Expand Up @@ -260,12 +259,10 @@ class task : public ref_counter, public extensible_object<task, 4>, public trans
static disk_engine *get_current_disk();
static env_provider *get_current_env();
static nfs_node *get_current_nfs();
static timer_service *get_current_tsvc();

static void set_tls_dsn_context(
service_node *node, // cannot be null
task_worker *worker, // null for io or timer threads if they are not worker threads
task_queue *queue // owner queue if io_mode == IOE_PER_QUEUE
service_node *node, // cannot be null
task_worker *worker // null for io or timer threads if they are not worker threads
);

protected:
Expand Down Expand Up @@ -716,10 +713,4 @@ __inline /*static*/ nfs_node *task::get_current_nfs()
return tls_dsn.nfs;
}

__inline /*static*/ timer_service *task::get_current_tsvc()
{
check_tls_dsn();
return tls_dsn.tsvc;
}

} // end namespace
19 changes: 0 additions & 19 deletions include/dsn/tool-api/task_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,6 @@ ENUM_REG(TASK_STATE_FINISHED)
ENUM_REG(TASK_STATE_CANCELLED)
ENUM_END(task_state)

typedef enum ioe_mode {
IOE_PER_NODE, // each node has shared io engine (rpc/disk/nfs/timer)
IOE_PER_QUEUE, // each queue has shared io engine (rpc/disk/nfs/timer)
IOE_COUNT,
IOE_INVALID
} ioe_mode;

ENUM_BEGIN(ioe_mode, IOE_INVALID)
ENUM_REG(IOE_PER_NODE)
ENUM_REG(IOE_PER_QUEUE)
ENUM_END(ioe_mode)

typedef enum grpc_mode_t {
GRPC_TO_LEADER, // the rpc is sent to the leader (if exist)
GRPC_TO_ALL, // the rpc is sent to all
Expand Down Expand Up @@ -161,13 +149,6 @@ class message_ex;
class admission_controller;
typedef void (*task_rejection_handler)(task *, admission_controller *);

typedef struct __io_mode_modifier__
{
ioe_mode mode; // see ioe_mode for details
task_queue *queue; // when mode == IOE_PER_QUEUE
int port_shift_value; // port += port_shift_value
} io_modifer;

class task_spec : public extensible_object<task_spec, 4>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion include/dsn/tool-api/timer_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class timer_service
public:
timer_service(service_node *node, timer_service *inner_provider) { _node = node; }

virtual void start(io_modifer &ctx) = 0;
virtual void start() = 0;

// after milliseconds, the provider should call task->enqueue()
virtual void add_timer(task *task) = 0;
Expand Down
54 changes: 0 additions & 54 deletions include/dsn/tool/fastrun.h

This file was deleted.

4 changes: 2 additions & 2 deletions include/dsn/tool/nfs/nfs_node_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class nfs_node_simple : public nfs_node

virtual void call(std::shared_ptr<remote_copy_request> rci, aio_task *callback) override;

virtual ::dsn::error_code start(io_modifer &ctx) override;
virtual ::dsn::error_code start() override;

virtual error_code stop() override;

Expand All @@ -62,4 +62,4 @@ class nfs_node_simple : public nfs_node
nfs_client_impl *_client;
};
}
}
}
2 changes: 1 addition & 1 deletion include/dsn/tool/node_scoper.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class node_scoper
node_scoper(service_node *node)
{
_old = tls_dsn;
task::set_tls_dsn_context(node, nullptr, nullptr);
task::set_tls_dsn_context(node, nullptr);
}

~node_scoper() { tls_dsn = _old; }
Expand Down
2 changes: 1 addition & 1 deletion src/apps/echo/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ timer_factory_name =
timer_io_mode =

; use what tool to run this process, e.g., native or simulator
tool = fastrun
tool = nativerun

; use what toollets, e.g., tracer, profiler, fault_injector
toollets =
Expand Down
2 changes: 1 addition & 1 deletion src/apps/nfs/nfs_node_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void nfs_node_simple::call(std::shared_ptr<remote_copy_request> rci, aio_task *c
_client->begin_remote_copy(rci, callback); // copy file request entry
}

error_code nfs_node_simple::start(io_modifer &ctx)
error_code nfs_node_simple::start()
{
_server = new nfs_service_impl(*_opts);
_server->open_service();
Expand Down
1 change: 0 additions & 1 deletion src/apps/skv/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ start_nfs = true

tool = simulator
;tool = nativerun
;tool = fastrun
;toollets = tracer
;toollets = fault_injector
;toollets = tracer, fault_injector
Expand Down
2 changes: 0 additions & 2 deletions src/core/core/core_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

#include <dsn/tool/simulator.h>
#include <dsn/tool/nativerun.h>
#include <dsn/tool/fastrun.h>
#include <dsn/toollet/tracer.h>
#include <dsn/toollet/profiler.h>
#include <dsn/toollet/fault_injector.h>
Expand All @@ -65,7 +64,6 @@ void dsn_core_init()

// register all possible tools and toollets
dsn::tools::register_tool<dsn::tools::nativerun>("nativerun");
dsn::tools::register_tool<dsn::tools::fastrun>("fastrun");
dsn::tools::register_tool<dsn::tools::simulator>("simulator");
dsn::tools::register_toollet<dsn::tools::tracer>("tracer");
dsn::tools::register_toollet<dsn::tools::profiler>("profiler");
Expand Down
4 changes: 2 additions & 2 deletions src/core/core/disk_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ disk_engine::disk_engine(service_node *node)

disk_engine::~disk_engine() {}

void disk_engine::start(aio_provider *provider, io_modifer &ctx)
void disk_engine::start(aio_provider *provider)
{
if (_is_running)
return;

_provider = provider;
_provider->start(ctx);
_provider->start();
_is_running = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/core/disk_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class disk_engine
disk_engine(service_node *node);
~disk_engine();

void start(aio_provider *provider, io_modifer &ctx);
void start(aio_provider *provider);

// asynchonous file read/write
dsn_handle_t open(const char *file_name, int flag, int pmode);
Expand Down
40 changes: 0 additions & 40 deletions src/core/core/global_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,23 +351,6 @@ bool service_spec::init_app_specs()

// fix ports_gap when necessary
int ports_gap = app.ports_gap;
switch (rpc_io_mode) {
case IOE_PER_NODE:
ports_gap *= 1;
break;
case IOE_PER_QUEUE: {
int number_of_ioes = 0;
for (auto &pl : app.pools) {
number_of_ioes += (this->threadpool_specs[pl].partitioned
? this->threadpool_specs[pl].worker_count
: 1);
}
ports_gap *= number_of_ioes;
} break;
default:
dassert(false, "unsupport io mode");
break;
}

auto ports = app.ports;
auto nsc = app.network_server_confs;
Expand Down Expand Up @@ -400,27 +383,4 @@ bool service_spec::init_app_specs()

return true;
}

int service_spec::get_ports_delta(int app_id, dsn::threadpool_code pool, int queue_index) const
{
dassert(rpc_io_mode == IOE_PER_QUEUE, "only used for IOE_PER_QUEUE mode");

auto &aps = app_specs[app_id - 1];
int number_of_ioes = 0;
for (auto &pl : aps.pools) {
if (pl != pool) {
number_of_ioes +=
(this->threadpool_specs[pl].partitioned ? this->threadpool_specs[pl].worker_count
: 1);
} else {
number_of_ioes += (this->threadpool_specs[pl].partitioned ? (queue_index + 1) : 1);
break;
}
}

dassert(number_of_ioes >= 1, "given pool not started");

return aps.ports_gap * (number_of_ioes - 1);
}

} // end namespace dsn