Compare commits

...

16 Commits

Author SHA1 Message Date
Xiaosu Lyu a79bd35f11 upload script
3 years ago
Xiaosu Lyu d3568884fe upload test_on_remote.sh
3 years ago
Xiaosu Lyu 7841162eee add a flag to exit while loop for each worker thread
3 years ago
Xiaosu Lyu acf7868430 upload debug.sh
3 years ago
Xiaosu Lyu 680879eca1 update scheduler.h
3 years ago
Xiaosu Lyu 1180fb68cd forgot to sumbit file sandbox_set_as_init.h
3 years ago
Xiaosu Lyu 99347aacd1 upload tests folder
3 years ago
Xiaosu Lyu c4f40cc5bf change sandbox init order: when generate a new sandbox, enqueue it to the local queue and init (allocate memory to) it when get the request from local queue
3 years ago
Xiaosu Lyu 9582ed445e remove all atomic variables
3 years ago
Xiaosu Lyu a9dd1f9710 1. change the start_t time to be receiving the first request time not the system boot time. 2. make the start worker core's ID can be configurable in the json file
3 years ago
Xiaosu Lyu 8a20ae7037 fix user code read NULL content bug
3 years ago
Xiaosu Lyu 48f9d44aea fix memory leak bug
3 years ago
Xiaosu Lyu da8dbc4032 1. add lock held time for each worker thread and listener thread. 2. print out total requests of each worker
3 years ago
Xiaosu Lyu 96f78698ce save the first http session object as a global session without releasing it, reuse it as the following requests' http sessions, this can improve the performance of self workload geneation.
3 years ago
Xiaosu Lyu b2754acc30 print out each worker's total requests
3 years ago
Xiaosu Lyu c07ebd310f remove listener thread and let worker thread generate requests to its local queue when the prior one finished
3 years ago

@ -10,7 +10,6 @@ if [[ $ARCH = "x86_64" ]]; then
elif [[ $ARCH = "aarch64" ]]; then
SHFMT_URL=https://github.com/patrickvane/shfmt/releases/download/master/shfmt_linux_arm
echo "ARM64 support is still a work in progress!"
exit 1
else
echo "This script only supports x86_64 and aarch64"
exit 1
@ -64,8 +63,6 @@ wget $SHFMT_URL -O shfmt && chmod +x shfmt && sudo mv shfmt /usr/local/bin/shfmt
sudo ./install_llvm.sh $LLVM_VERSION
curl -sS -L -O $WASI_SDK_URL && sudo dpkg -i wasi-sdk_12.0_amd64.deb && rm -f wasi-sdk_12.0_amd64.deb
if [ -z "${WASI_SDK_PATH}" ]; then
export WASI_SDK_PATH=/opt/wasi-sdk
echo "export WASI_SDK_PATH=/opt/wasi-sdk" >> ~/.bashrc

@ -94,7 +94,7 @@ BINARY_NAME=sledgert
# This flag tracks the total number of sandboxes in the various states
# It is useful to debug if sandboxes are "getting caught" in a particular state
# CFLAGS += -DSANDBOX_STATE_TOTALS
CFLAGS += -DSANDBOX_STATE_TOTALS
# This flag enables an per-worker atomic count of sandbox's local runqueue count in thread local storage
# Useful to debug if sandboxes are "getting caught" or "leaking" while in a local runqueue

@ -4,7 +4,6 @@
#include <assert.h>
#include "arch/common.h"
#include "current_sandbox.h"
#define ARCH_SIG_JMP_OFF 0x100 /* Based on code generated! */
@ -47,24 +46,20 @@ arch_context_switch(struct arch_context *a, struct arch_context *b)
* Assumption: In the case of a slow context switch, the caller
* set current_sandbox to the sandbox containing the target context
*/
if (b->variant == ARCH_CONTEXT_VARIANT_SLOW) {
/*if (b->variant == ARCH_CONTEXT_VARIANT_SLOW) {
struct sandbox *current = current_sandbox_get();
assert(current != NULL && b == &current->ctxt);
}
}*/
#endif
/* if both a and b are NULL, there is no state change */
assert(a != NULL || b != NULL);
assert(a != NULL && b != NULL);
/* Assumption: The caller does not switch to itself */
assert(a != b);
/* Set any NULLs to worker_thread_base_context to resume execution of main */
if (a == NULL) a = &worker_thread_base_context;
if (b == NULL) b = &worker_thread_base_context;
/* A Transition {Unused, Running} -> Fast */
assert(a->variant == ARCH_CONTEXT_VARIANT_UNUSED || a->variant == ARCH_CONTEXT_VARIANT_RUNNING);
assert(a->variant == ARCH_CONTEXT_VARIANT_RUNNING);
/* B Transition {Fast, Slow} -> Running */
assert(b->variant == ARCH_CONTEXT_VARIANT_FAST || b->variant == ARCH_CONTEXT_VARIANT_SLOW);
@ -87,6 +82,8 @@ arch_context_switch(struct arch_context *a, struct arch_context *b)
"ldr x1, [%[bv]]\n\t"
"sub x1, x1, #2\n\t"
"cbz x1, slow%=\n\t"
"mov x3, #3\n\t"
"str x3, [%[bv]]\n\t" /* b->variant = ARCH_CONTEXT_VARIANT_RUNNING; */
"ldr x0, [%[b]]\n\t"
"ldr x1, [%[b], 8]\n\t"
"mov sp, x0\n\t"
@ -95,8 +92,6 @@ arch_context_switch(struct arch_context *a, struct arch_context *b)
"br %[slowpath]\n\t"
".align 8\n\t"
"reset%=:\n\t"
"mov x1, #3\n\t"
"str x1, [%[bv]]\n\t"
".align 8\n\t"
"exit%=:\n\t"
:
@ -109,6 +104,37 @@ arch_context_switch(struct arch_context *a, struct arch_context *b)
return 0;
}
/**
* Load a new sandbox that preempted an existing sandbox, restoring only the
* instruction pointer and stack pointer registers.
* @param active_context - the context of the current worker thread
* @param sandbox_context - the context that we want to restore
*/
static inline void
arch_context_restore_fast(mcontext_t *active_context, struct arch_context *sandbox_context)
{
assert(active_context != NULL);
assert(sandbox_context != NULL);
/* Assumption: Base Context is only ever used by arch_context_switch */
assert(sandbox_context != &worker_thread_base_context);
assert(sandbox_context->regs[UREG_SP]);
assert(sandbox_context->regs[UREG_IP]);
/* Transitioning from Fast -> Running */
assert(sandbox_context->variant == ARCH_CONTEXT_VARIANT_FAST);
sandbox_context->variant = ARCH_CONTEXT_VARIANT_RUNNING;
//active_context->gregs[REG_RSP] = sandbox_context->regs[UREG_SP];
//active_context->gregs[REG_RIP] = sandbox_context->regs[UREG_IP];
active_context->sp = sandbox_context->regs[UREG_SP];
active_context->pc = sandbox_context->regs[UREG_IP];
}
#else
#warning "Neither AARCH64 nor aarch64 was defined, but aarch64/context.h was included!"
#endif

@ -10,6 +10,12 @@ struct auto_buf {
size_t size;
};
static inline void auto_buf_copy(struct auto_buf *dest, struct auto_buf *source) {
if (dest == NULL || source == NULL) return;
fwrite(source->data, 1, source->size, dest->handle);
fflush(dest->handle);
}
static inline int
auto_buf_init(struct auto_buf *buf)
{

@ -12,11 +12,28 @@ struct http_header {
int value_length;
};
static inline void http_header_copy(struct http_header *dest, struct http_header *source) {
if (source == NULL || dest == NULL) return;
dest->key = (char*) malloc (source->key_length);
memcpy(dest->key, source->key, source->key_length);
dest->key_length = source->key_length;
dest->value = (char*) malloc (source->value_length);
memcpy(dest->value, source->value, source->value_length);
dest->value_length = source->value_length;
}
struct http_query_param {
char value[HTTP_MAX_QUERY_PARAM_LENGTH];
int value_length;
};
static inline void http_query_param_copy(struct http_query_param *dest, struct http_query_param *source) {
if (source == NULL || dest == NULL) return;
memcpy(dest->value, source->value, HTTP_MAX_QUERY_PARAM_LENGTH);
dest->value_length = source->value_length;
}
struct http_request {
char full_url[HTTP_MAX_FULL_URL_LENGTH];
struct http_header headers[HTTP_MAX_HEADER_COUNT];
@ -40,4 +57,29 @@ struct http_request {
int cursor; /* Sandbox cursor (offset from body pointer) */
};
static inline void http_request_copy(struct http_request *dest, struct http_request *source) {
if (dest == NULL || source == NULL) return;
memcpy(dest->full_url, source->full_url, HTTP_MAX_FULL_URL_LENGTH);
for (int i = 0; i < HTTP_MAX_HEADER_COUNT; i++) {
http_header_copy(&(dest->headers[i]), &(source->headers[i]));
}
dest->header_count = source->header_count;
dest->method = source->method;
for (int i = 0; i < HTTP_MAX_QUERY_PARAM_COUNT; i++) {
http_query_param_copy(&(dest->query_params[i]), &(source->query_params[i]));
}
dest->query_params_count = source->query_params_count;
dest->body = (char*) malloc (source->body_length);
memcpy(dest->body, source->body, source->body_length);
dest->body_length = source->body_length;
dest->body_length_read = source->body_length_read;
dest->length_parsed = source->length_parsed;
dest->last_was_value = source->last_was_value;
dest->header_end = source->header_end;
dest->message_begin = source->message_begin;
dest->message_end = source->message_end;
}
void http_request_print(struct http_request *http_request);

@ -29,7 +29,7 @@ static inline void
http_route_total_increment_request(struct http_route_total *rm)
{
#ifdef HTTP_ROUTE_TOTAL_COUNTERS
atomic_fetch_add(&rm->total_requests, 1);
//atomic_fetch_add(&rm->total_requests, 1);
#endif
}
@ -37,12 +37,12 @@ static inline void
http_route_total_increment(struct http_route_total *rm, int status_code)
{
#ifdef HTTP_ROUTE_TOTAL_COUNTERS
if (status_code >= 200 && status_code <= 299) {
/*if (status_code >= 200 && status_code <= 299) {
atomic_fetch_add(&rm->total_2XX, 1);
} else if (status_code >= 400 && status_code <= 499) {
atomic_fetch_add(&rm->total_4XX, 1);
} else if (status_code >= 500 && status_code <= 599) {
atomic_fetch_add(&rm->total_5XX, 1);
}
}*/
#endif
}

@ -22,6 +22,7 @@
#include "tcp_session.h"
#include "tenant.h"
enum http_session_state
{
HTTP_SESSION_UNINITIALIZED = 0,
@ -59,8 +60,22 @@ struct http_session {
uint64_t response_sent_timestamp;
};
static inline void http_session_copy(struct http_session *dest, struct http_session *source) {
if (dest == NULL || source == NULL) return;
dest->tag = source->tag;
http_request_copy(&dest->http_request, &source->http_request);
auto_buf_copy(&dest->request_buffer, &source->request_buffer);
auto_buf_copy(&dest->response_header, &source->response_header);
dest->response_header_written = source->response_header_written;
auto_buf_copy(&dest->response_body, &source->response_body);
dest->response_body_written = source->response_body_written;
dest->route = source->route;
}
extern void http_session_perf_log_print_entry(struct http_session *http_session);
/**
* Initalize state associated with an http parser
* Because the http_parser structure uses pointers to the request buffer, if realloc moves the request
@ -102,6 +117,7 @@ http_session_init(struct http_session *session, int socket_descriptor, const str
/* Defer initializing response_body until we've matched a route */
auto_buf_init(&session->response_header);
session->state = HTTP_SESSION_INITIALIZED;
@ -112,16 +128,19 @@ static inline int
http_session_init_response_body(struct http_session *session)
{
assert(session != NULL);
assert(session->response_body.data == NULL);
assert(session->response_body.size == 0);
assert(session->response_body_written == 0);
int rc = auto_buf_init(&session->response_body);
if (rc < 0) {
auto_buf_deinit(&session->request_buffer);
return -1;
//assert(session->response_body.data == NULL);
//assert(session->response_body.size == 0);
//assert(session->response_body_written == 0);
session->response_body.size = 0;
session->response_body_written = 0;
if (session->response_body.data == NULL) {
int rc = auto_buf_init(&session->response_body);
if (rc < 0) {
auto_buf_deinit(&session->request_buffer);
return -1;
}
}
return 0;
}
@ -153,9 +172,9 @@ http_session_deinit(struct http_session *session)
{
assert(session);
auto_buf_deinit(&session->request_buffer);
auto_buf_deinit(&session->response_header);
auto_buf_deinit(&session->response_body);
//auto_buf_deinit(&session->request_buffer);
//auto_buf_deinit(&session->response_header);
//auto_buf_deinit(&session->response_body);
}
static inline void
@ -163,8 +182,8 @@ http_session_free(struct http_session *session)
{
assert(session);
http_session_deinit(session);
free(session);
//http_session_deinit(session);
//free(session);
}
/**
@ -177,7 +196,7 @@ http_session_set_response_header(struct http_session *session, int status_code)
{
assert(session != NULL);
assert(status_code >= 200 && status_code <= 599);
http_total_increment_response(status_code);
//http_total_increment_response(status_code);
/* We might not have actually matched a route */
if (likely(session->route != NULL)) { http_route_total_increment(&session->route->metrics, status_code); }
@ -265,7 +284,7 @@ http_session_send_response_body(struct http_session *session, void_star_cb on_ea
/* Assumption: Already flushed in order to write content-length to header */
// TODO: Test if body is empty
printf("body is %s\n", session->response_body.data);
while (session->response_body_written < session->response_body.size) {
ssize_t sent =
tcp_session_send(session->socket,
@ -384,7 +403,6 @@ http_session_receive_request(struct http_session *session, void_star_cb on_eagai
if (old_buffer != session->request_buffer.data) {
http_request->body = header_length ? session->request_buffer.data + header_length : NULL;
}
if (http_session_parse(session, bytes_received) == -1) goto err;
}

@ -8,6 +8,10 @@
#include "runtime.h"
extern uint64_t total_held[1024];
extern uint64_t longest_held[1024];
extern thread_local int thread_id;
/* A linked list of nodes */
struct lock_wrapper {
uint64_t longest_held;
@ -73,9 +77,14 @@ lock_unlock(lock_t *self, lock_node_t *node)
ck_spinlock_mcs_unlock(&self->lock, &node->node);
uint64_t now = __getcycles();
assert(node->time_locked < now);
assert(node->time_locked <= now);
uint64_t duration = now - node->time_locked;
node->time_locked = 0;
if (unlikely(duration > self->longest_held)) { self->longest_held = duration; }
self->total_held += duration;
if (unlikely(duration > longest_held[thread_id])) {
longest_held[thread_id] = duration;
}
total_held[thread_id] += duration;
}

@ -60,7 +60,7 @@ static inline void
module_acquire(struct module *module)
{
assert(module->reference_count < UINT32_MAX);
atomic_fetch_add(&module->reference_count, 1);
//atomic_fetch_add(&module->reference_count, 1);
return;
}
@ -158,8 +158,8 @@ module_entrypoint(struct module *module)
static inline void
module_release(struct module *module)
{
assert(module->reference_count > 0);
atomic_fetch_sub(&module->reference_count, 1);
//assert(module->reference_count > 0);
//atomic_fetch_sub(&module->reference_count, 1);
return;
}

@ -26,7 +26,7 @@
#define RUNTIME_MAX_EPOLL_EVENTS 128
#define RUNTIME_MAX_TENANT_COUNT 32
#define RUNTIME_RELATIVE_DEADLINE_US_MAX 3600000000 /* One Hour. Fits in uint32_t */
#define RUNTIME_RUNQUEUE_SIZE 256 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_RUNQUEUE_SIZE 1024 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_TENANT_QUEUE_SIZE 4096
enum RUNTIME_SIGALRM_HANDLER

@ -55,6 +55,6 @@ static inline void
sandbox_process_scheduler_updates(struct sandbox *sandbox)
{
if (tenant_is_paid(sandbox->tenant)) {
atomic_fetch_sub(&sandbox->tenant->remaining_budget, sandbox->last_state_duration);
//atomic_fetch_sub(&sandbox->tenant->remaining_budget, sandbox->last_state_duration);
}
}

@ -48,6 +48,7 @@ sandbox_perf_log_print_entry(struct sandbox *sandbox)
runtime_processor_speed_MHz);
}
static inline void
sandbox_perf_log_init()
{

@ -60,7 +60,7 @@ sandbox_set_as_error(struct sandbox *sandbox, sandbox_state_t last_state)
/* Return HTTP session to listener core to be written back to client */
http_session_set_response_header(sandbox->http, 500);
sandbox->http->state = HTTP_SESSION_EXECUTION_COMPLETE;
http_session_send_response(sandbox->http, (void_star_cb)listener_thread_register_http_session);
//http_session_send_response(sandbox->http, (void_star_cb)listener_thread_register_http_session);
sandbox->http = NULL;
/* Terminal State Logging */

@ -0,0 +1,55 @@
#pragma once
#include <assert.h>
#include <stdint.h>
#include "arch/getcycles.h"
#include "local_runqueue.h"
#include "panic.h"
#include "sandbox_state_history.h"
#include "sandbox_state_transition.h"
#include "sandbox_types.h"
/**
* Transitions a sandbox to the SANDBOX_RUNNABLE state.
*
* This occurs in the following scenarios:
* - A sandbox in the SANDBOX_INITIALIZED state completes initialization and is ready to be run
* - A sandbox in the SANDBOX_ASLEEP state completes what was blocking it and is ready to be run
*
* @param sandbox
* @param last_state the state the sandbox is transitioning from. This is expressed as a constant to
* enable the compiler to perform constant propagation optimizations.
*/
static inline void
sandbox_set_as_init(struct sandbox *sandbox, sandbox_state_t last_state)
{
assert(sandbox);
sandbox->state = SANDBOX_RUNNABLE;
uint64_t now = __getcycles();
switch (last_state) {
case SANDBOX_INITIALIZED: {
sandbox->timestamp_of.dispatched = now;
break;
}
default: {
panic("Sandbox %lu | Illegal transition from %s to Runnable\n", sandbox->id,
sandbox_state_stringify(last_state));
}
}
/* State Change Bookkeeping */
assert(now > sandbox->timestamp_of.last_state_change);
sandbox->last_state_duration = now - sandbox->timestamp_of.last_state_change;
sandbox->duration_of_state[last_state] += sandbox->last_state_duration;
sandbox->timestamp_of.last_state_change = now;
sandbox_state_history_append(&sandbox->state_history, SANDBOX_RUNNABLE);
sandbox_state_totals_increment(SANDBOX_RUNNABLE);
sandbox_state_totals_decrement(last_state);
/* State Change Hooks */
sandbox_state_transition_from_hook(sandbox, last_state);
sandbox_state_transition_to_hook(sandbox, SANDBOX_RUNNABLE);
}

@ -34,7 +34,7 @@ sandbox_set_as_initialized(struct sandbox *sandbox, sandbox_state_t last_state)
}
/* State Change Bookkeeping */
assert(now > sandbox->timestamp_of.last_state_change);
assert(now >= sandbox->timestamp_of.last_state_change);
sandbox->last_state_duration = now - sandbox->timestamp_of.last_state_change;
sandbox->duration_of_state[last_state] += sandbox->last_state_duration;
sandbox->timestamp_of.last_state_change = now;

@ -43,7 +43,7 @@ sandbox_set_as_returned(struct sandbox *sandbox, sandbox_state_t last_state)
}
/* State Change Bookkeeping */
assert(now > sandbox->timestamp_of.last_state_change);
assert(now >= sandbox->timestamp_of.last_state_change);
sandbox->last_state_duration = now - sandbox->timestamp_of.last_state_change;
sandbox->duration_of_state[last_state] += sandbox->last_state_duration;
sandbox->timestamp_of.last_state_change = now;
@ -51,9 +51,9 @@ sandbox_set_as_returned(struct sandbox *sandbox, sandbox_state_t last_state)
sandbox_state_totals_increment(SANDBOX_RETURNED);
sandbox_state_totals_decrement(last_state);
http_session_set_response_header(sandbox->http, 200);
//http_session_set_response_header(sandbox->http, 200);
sandbox->http->state = HTTP_SESSION_EXECUTION_COMPLETE;
http_session_send_response(sandbox->http, (void_star_cb)listener_thread_register_http_session);
//http_session_send_response(sandbox->http, (void_star_cb)listener_thread_register_http_session);
sandbox->http = NULL;
/* State Change Hooks */

@ -39,7 +39,7 @@ sandbox_set_as_running_sys(struct sandbox *sandbox, sandbox_state_t last_state)
}
/* State Change Bookkeeping */
assert(now > sandbox->timestamp_of.last_state_change);
assert(now >= sandbox->timestamp_of.last_state_change);
sandbox->last_state_duration = now - sandbox->timestamp_of.last_state_change;
sandbox->duration_of_state[last_state] += sandbox->last_state_duration;
sandbox->timestamp_of.last_state_change = now;

@ -35,7 +35,7 @@ sandbox_set_as_running_user(struct sandbox *sandbox, sandbox_state_t last_state)
/* State Change Bookkeeping */
assert(now > sandbox->timestamp_of.last_state_change);
assert(now >= sandbox->timestamp_of.last_state_change);
sandbox->last_state_duration = now - sandbox->timestamp_of.last_state_change;
sandbox->duration_of_state[last_state] += sandbox->last_state_duration;
sandbox->timestamp_of.last_state_change = now;

@ -48,7 +48,7 @@ static inline void
sandbox_state_totals_increment(sandbox_state_t state)
{
#ifdef SANDBOX_STATE_TOTALS
atomic_fetch_add(&sandbox_state_totals[state], 1);
//atomic_fetch_add(&sandbox_state_totals[state], 1);
#endif
}
@ -56,7 +56,7 @@ static inline void
sandbox_state_totals_decrement(sandbox_state_t state)
{
#ifdef SANDBOX_STATE_TOTALS
if (atomic_load(&sandbox_state_totals[state]) == 0) panic("Underflow of %s\n", sandbox_state_stringify(state));
atomic_fetch_sub(&sandbox_state_totals[state], 1);
//if (atomic_load(&sandbox_state_totals[state]) == 0) panic("Underflow of %s\n", sandbox_state_stringify(state));
//atomic_fetch_sub(&sandbox_state_totals[state], 1);
#endif
}

@ -15,5 +15,6 @@ sandbox_total_initialize()
static inline uint64_t
sandbox_total_postfix_increment()
{
return atomic_fetch_add(&sandbox_total, 1) + 1;
//return atomic_fetch_add(&sandbox_total, 1) + 1;
return 1;
}

@ -46,6 +46,8 @@ struct sandbox {
/* HTTP State */
struct http_session *http;
struct auto_buf response_body;
struct auto_buf response_header;
/* WebAssembly Module State */
struct module *module; /* the module this is an instance of */
@ -66,6 +68,7 @@ struct sandbox {
deadline (cycles) */
uint64_t total_time; /* Total time from Request to Response */
int cursor;
/* System Interface State */
int32_t return_value;
wasi_context_t *wasi_context;

@ -23,8 +23,10 @@
#include "sandbox_set_as_interrupted.h"
#include "sandbox_set_as_running_user.h"
#include "scheduler_options.h"
#include "sandbox_set_as_init.h"
extern thread_local bool pthread_stop;
extern thread_local bool get_first_request;
/**
* This scheduler provides for cooperative and preemptive multitasking in a OS process's userspace.
*
@ -109,27 +111,36 @@ done:
static inline struct sandbox *
scheduler_edf_get_next()
{
/* Get the deadline of the sandbox at the head of the local queue */
struct sandbox *local = local_runqueue_get_next();
uint64_t local_deadline = local == NULL ? UINT64_MAX : local->absolute_deadline;
struct sandbox *global = NULL;
uint64_t global_deadline = global_request_scheduler_peek();
/* Try to pull and allocate from the global queue if earlier
* This will be placed at the head of the local runqueue */
if (global_deadline < local_deadline) {
if (global_request_scheduler_remove_if_earlier(&global, local_deadline) == 0) {
assert(global != NULL);
assert(global->absolute_deadline < local_deadline);
sandbox_prepare_execution_environment(global);
assert(global->state == SANDBOX_INITIALIZED);
sandbox_set_as_runnable(global, SANDBOX_INITIALIZED);
if (get_first_request == false) {
/* Get the deadline of the sandbox at the head of the local queue */
struct sandbox *local = local_runqueue_get_next();
uint64_t local_deadline = local == NULL ? UINT64_MAX : local->absolute_deadline;
struct sandbox *global = NULL;
uint64_t global_deadline = global_request_scheduler_peek();
/* Try to pull and allocate from the global queue if earlier
* This will be placed at the head of the local runqueue */
if (global_deadline < local_deadline) {
if (global_request_scheduler_remove_if_earlier(&global, local_deadline) == 0) {
assert(global != NULL);
assert(global->absolute_deadline < local_deadline);
sandbox_prepare_execution_environment(global);
assert(global->state == SANDBOX_INITIALIZED);
sandbox_set_as_runnable(global, SANDBOX_INITIALIZED);
get_first_request = true;
}
}
}
/* Return what is at the head of the local runqueue or NULL if empty */
return local_runqueue_get_next();
return local_runqueue_get_next();
} else {
struct sandbox *local = local_runqueue_get_next();
if (local->state == SANDBOX_INITIALIZED) {
sandbox_prepare_execution_environment(local);
sandbox_set_as_init(local, SANDBOX_INITIALIZED);
}
return local;
}
}
static inline struct sandbox *
@ -392,7 +403,7 @@ scheduler_switch_to_base_context(struct arch_context *current_context)
static inline void
scheduler_idle_loop()
{
while (true) {
while (!pthread_stop) {
/* Assumption: only called by the "base context" */
assert(current_sandbox_get() == NULL);

@ -31,7 +31,7 @@ software_interrupt_mask_signal(int signal)
sigset_t set;
int return_code;
assert(signal == SIGALRM || signal == SIGUSR1 || signal == SIGFPE || signal == SIGSEGV);
assert(signal == SIGALRM || signal == SIGUSR1 || signal == SIGFPE || signal == SIGSEGV || signal == SIGINT);
/* all threads created by the calling thread will have signal blocked */
sigemptyset(&set);
sigaddset(&set, signal);
@ -55,7 +55,7 @@ software_interrupt_unmask_signal(int signal)
sigset_t set;
int return_code;
assert(signal == SIGALRM || signal == SIGUSR1 || signal == SIGFPE || signal == SIGSEGV);
assert(signal == SIGALRM || signal == SIGUSR1 || signal == SIGFPE || signal == SIGSEGV || signal == SIGINT);
/* all threads created by the calling thread will have signal unblocked */
sigemptyset(&set);
sigaddset(&set, signal);

@ -56,7 +56,7 @@ static inline void
software_interrupt_counts_deferred_sigalrm_replay_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_deferred_sigalrm_replay[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_deferred_sigalrm_replay[worker_thread_idx], 1);
#endif
}
@ -64,7 +64,7 @@ static inline void
software_interrupt_counts_sigalrm_kernel_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_sigalrm_kernel[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_sigalrm_kernel[worker_thread_idx], 1);
#endif
}
@ -72,7 +72,7 @@ static inline void
software_interrupt_counts_sigalrm_thread_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_sigalrm_thread[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_sigalrm_thread[worker_thread_idx], 1);
#endif
}
@ -80,7 +80,7 @@ static inline void
software_interrupt_counts_sigfpe_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_sigfpe[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_sigfpe[worker_thread_idx], 1);
#endif
}
@ -88,7 +88,7 @@ static inline void
software_interrupt_counts_sigsegv_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_sigsegv[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_sigsegv[worker_thread_idx], 1);
#endif
}
@ -96,7 +96,7 @@ static inline void
software_interrupt_counts_sigusr_increment()
{
#ifdef LOG_SOFTWARE_INTERRUPT_COUNTS
atomic_fetch_add(&software_interrupt_counts_sigusr[worker_thread_idx], 1);
//atomic_fetch_add(&software_interrupt_counts_sigusr[worker_thread_idx], 1);
#endif
}

@ -40,7 +40,7 @@ admissions_control_add(uint64_t admissions_estimate)
{
#ifdef ADMISSIONS_CONTROL
assert(admissions_estimate > 0);
atomic_fetch_add(&admissions_control_admitted, admissions_estimate);
//atomic_fetch_add(&admissions_control_admitted, admissions_estimate);
#ifdef LOG_ADMISSIONS_CONTROL
debuglog("Runtime Admitted: %lu / %lu\n", admissions_control_admitted, admissions_control_capacity);

@ -11,9 +11,16 @@
#include "sandbox_set_as_running_user.h"
#include "sandbox_set_as_running_sys.h"
#include "scheduler.h"
#include "http_session.h"
#include "software_interrupt.h"
#include "wasi.h"
extern struct http_session *g_session;
extern struct tenant *g_tenant;
extern int g_client_socket;
extern struct sockaddr *g_client_address;
extern thread_local uint32_t total_local_requests;
thread_local struct sandbox *worker_thread_current_sandbox = NULL;
/**
@ -63,6 +70,35 @@ current_sandbox_exit()
sandbox_state_stringify(exiting_sandbox->state));
}
/* generate a new request and enqueue it to the global queue */
assert(g_tenant != NULL);
struct tenant *tenant = g_tenant;
uint64_t request_arrival_timestamp = __getcycles();
//http_total_increment_request();
/* Allocate http session */
//struct http_session *session = http_session_alloc(g_client_socket, (const struct sockaddr *)&g_client_address, tenant, request_arrival_timestamp);
struct http_session *session = g_session;
//printf("received http data is %s\n", session->request_buffer.data);
//assert(session != NULL);
//http_session_copy(session, g_session);
assert(session->route != NULL);
struct sandbox *sandbox = sandbox_alloc(session->route->module, session, session->route, session->tenant, 1);
if (unlikely(sandbox == NULL)) {
printf("Failed to allocate sandbox\n");
exit(-1);
}
/* If the global request scheduler is full, return a 429 to the client */
//if (unlikely(global_request_scheduler_add(sandbox) == NULL)) {
// printf("Failed to add sandbox to global queue\n");
// exit(-1);
//}
local_runqueue_add(sandbox);
/****************************end**************************/
scheduler_cooperative_sched(true);
/* The scheduler should never switch back to completed sandboxes */

@ -3,6 +3,7 @@
#include "global_request_scheduler.h"
#include "panic.h"
uint32_t total_global_requests = 0;
/* Default uninitialized implementations of the polymorphic interface */
noreturn static struct sandbox *
uninitialized_add(struct sandbox *arg)
@ -49,6 +50,7 @@ struct sandbox *
global_request_scheduler_add(struct sandbox *sandbox)
{
assert(sandbox != NULL);
total_global_requests++;
return global_request_scheduler.add_fn(sandbox);
}

@ -19,7 +19,7 @@ global_request_scheduler_minheap_add(struct sandbox *sandbox)
{
assert(sandbox);
assert(global_request_scheduler_minheap);
if (unlikely(!listener_thread_is_running())) panic("%s is only callable by the listener thread\n", __func__);
//if (unlikely(!listener_thread_is_running())) panic("%s is only callable by the listener thread\n", __func__);
int return_code = priority_queue_enqueue(global_request_scheduler_minheap, sandbox);

@ -660,7 +660,7 @@ wasi_snapshot_preview1_backing_fd_read(wasi_context_t *context, __wasi_fd_t fd,
if (fd == STDIN_FILENO) {
struct sandbox *current_sandbox = current_sandbox_get();
struct http_request *current_request = &current_sandbox->http->http_request;
int old_read = current_request->cursor;
int old_read = current_sandbox->cursor;
int bytes_to_read = current_request->body_length - old_read;
assert(current_request->body_length >= 0);
@ -669,13 +669,13 @@ wasi_snapshot_preview1_backing_fd_read(wasi_context_t *context, __wasi_fd_t fd,
if (bytes_to_read == 0) goto done;
int amount_to_copy = iovs[i].buf_len > bytes_to_read ? bytes_to_read : iovs[i].buf_len;
memcpy(iovs[i].buf, current_request->body + current_request->cursor, amount_to_copy);
current_request->cursor += amount_to_copy;
bytes_to_read = current_request->body_length - current_request->cursor;
memcpy(iovs[i].buf, current_request->body + current_sandbox->cursor, amount_to_copy);
current_sandbox->cursor += amount_to_copy;
bytes_to_read = current_request->body_length - current_sandbox->cursor;
}
done:
*nwritten_retptr = current_request->cursor - old_read;
*nwritten_retptr = current_sandbox->cursor - old_read;
return __WASI_ERRNO_SUCCESS;
}
@ -796,7 +796,8 @@ wasi_snapshot_preview1_backing_fd_write(wasi_context_t *context, __wasi_fd_t fd,
debuglog("STDERR from Sandbox: %.*s", iovs[i].buf_len, iovs[i].buf);
}
#endif
rc = fwrite(iovs[i].buf, 1, iovs[i].buf_len, s->http->response_body.handle);
//rc = fwrite(iovs[i].buf, 1, iovs[i].buf_len, s->http->response_body.handle);
rc = fwrite(iovs[i].buf, 1, iovs[i].buf_len, s->response_body.handle);
if (rc != iovs[i].buf_len) return __WASI_ERRNO_FBIG;
nwritten += rc;

@ -13,6 +13,17 @@
#include "tenant_functions.h"
#include "http_session_perf_log.h"
extern thread_local int thread_id;
extern bool first_request_comming;
time_t t_start;
extern void http_session_copy(struct http_session *dest, struct http_session *source);
/////////////////xiaosu for test//////////////////
struct http_session *g_session = NULL;
struct tenant *g_tenant = NULL;
int g_client_socket = -1;
struct sockaddr *g_client_address = NULL;
////////////////xiaosu end for test///////////////
static void listener_thread_unregister_http_session(struct http_session *http);
static void panic_on_epoll_error(struct epoll_event *evt);
@ -168,6 +179,14 @@ panic_on_epoll_error(struct epoll_event *evt)
static void
on_client_request_arrival(int client_socket, const struct sockaddr *client_address, struct tenant *tenant)
{
if (g_client_socket == -1) {
g_client_socket = client_socket;
}
if (g_client_address == NULL) {
g_client_address = client_address;
}
uint64_t request_arrival_timestamp = __getcycles();
http_total_increment_request();
@ -191,6 +210,11 @@ on_client_request_arrival(int client_socket, const struct sockaddr *client_addre
static void
on_client_request_receiving(struct http_session *session)
{
if (first_request_comming == false){
t_start = time(NULL);
first_request_comming = true;
}
/* Read HTTP request */
int rc = http_session_receive_request(session, (void_star_cb)listener_thread_register_http_session);
if (likely(rc == 0)) {
@ -242,6 +266,13 @@ on_client_request_received(struct http_session *session)
/* Allocate a Sandbox */
session->state = HTTP_SESSION_EXECUTING;
if (g_session == NULL) {
/* Allocate HTTP Session */
g_session = http_session_alloc(session->socket, (const struct sockaddr *)&(session->client_address),
session->tenant, session->request_arrival_timestamp);
http_session_copy(g_session, session);
}
struct sandbox *sandbox = sandbox_alloc(route->module, session, route, session->tenant, work_admitted);
if (unlikely(sandbox == NULL)) {
debuglog("Failed to allocate sandbox\n");
@ -317,6 +348,9 @@ on_tenant_socket_epoll_event(struct epoll_event *evt)
struct tenant *tenant = evt->data.ptr;
assert(tenant);
if (g_tenant == NULL) {
g_tenant = tenant;
}
/* Accept Client Request as a nonblocking socket, saving address information */
struct sockaddr_in client_address;
@ -401,6 +435,7 @@ on_client_socket_epoll_event(struct epoll_event *evt)
noreturn void *
listener_thread_main(void *dummy)
{
thread_id = 200;
struct epoll_event epoll_events[RUNTIME_MAX_EPOLL_EVENTS];
metrics_server_init();

@ -6,6 +6,7 @@
#include "local_runqueue.h"
thread_local uint32_t total_local_requests = 0;
static struct local_runqueue_config local_runqueue;
#ifdef LOG_LOCAL_RUNQUEUE
@ -27,6 +28,7 @@ void
local_runqueue_add(struct sandbox *sandbox)
{
assert(local_runqueue.add_fn != NULL);
total_local_requests++;
#ifdef LOG_LOCAL_RUNQUEUE
local_runqueue_count++;
#endif

@ -12,6 +12,10 @@
#include "sandbox_functions.h"
#include "runtime.h"
extern thread_local int thread_id;
uint64_t total_held[1024] = {0};
uint64_t longest_held[1024] = {0};
thread_local static struct priority_queue *local_runqueue_minheap;
/**

@ -35,6 +35,8 @@ uint32_t runtime_first_worker_processor = 1;
uint32_t runtime_processor_speed_MHz = 0;
uint32_t runtime_total_online_processors = 0;
uint32_t runtime_worker_threads_count = 0;
bool first_request_comming = false;
thread_local int thread_id = -1;
enum RUNTIME_SIGALRM_HANDLER runtime_sigalrm_handler = RUNTIME_SIGALRM_HANDLER_BROADCAST;
@ -67,18 +69,23 @@ runtime_allocate_available_cores()
pretty_print_key_value("Core Count (Online)", "%u\n", runtime_total_online_processors);
/* If more than two cores are available, leave core 0 free to run OS tasks */
if (runtime_total_online_processors > 2) {
runtime_first_worker_processor = 2;
max_possible_workers = runtime_total_online_processors - 2;
} else if (runtime_total_online_processors == 2) {
runtime_first_worker_processor = 1;
max_possible_workers = runtime_total_online_processors - 1;
char* first_core_id = getenv("SLEDGE_FIRST_COREID");
if (first_core_id != NULL) {
runtime_first_worker_processor = atoi(first_core_id);
} else {
panic("Runtime requires at least two cores!");
/* If more than two cores are available, leave core 0 free to run OS tasks */
if (runtime_total_online_processors > 2) {
runtime_first_worker_processor = 2;
max_possible_workers = runtime_total_online_processors - 2;
} else if (runtime_total_online_processors == 2) {
runtime_first_worker_processor = 1;
max_possible_workers = runtime_total_online_processors - 1;
} else {
panic("Runtime requires at least two cores!");
}
}
/* Number of Workers */
char *worker_count_raw = getenv("SLEDGE_NWORKERS");
if (worker_count_raw != NULL) {
@ -476,6 +483,8 @@ main(int argc, char **argv)
printf("Runtime Environment:\n");
runtime_processor_speed_MHz = 1500;
runtime_set_resource_limits_to_max();
runtime_allocate_available_cores();
runtime_configure();
@ -484,7 +493,7 @@ main(int argc, char **argv)
listener_thread_initialize();
runtime_start_runtime_worker_threads();
runtime_get_processor_speed_MHz();
//runtime_get_processor_speed_MHz();
runtime_configure_worker_spinloop_pause();
software_interrupt_arm_timer();
@ -516,6 +525,7 @@ main(int argc, char **argv)
}
runtime_boot_timestamp = __getcycles();
//t_start = time(NULL);
for (int tenant_idx = 0; tenant_idx < tenant_config_vec_len; tenant_idx++) {
tenant_config_deinit(&tenant_config_vec[tenant_idx]);
@ -530,6 +540,5 @@ main(int argc, char **argv)
exit(-1);
}
}
exit(-1);
}

@ -80,6 +80,20 @@ sandbox_free_stack(struct sandbox *sandbox)
return module_free_stack(sandbox->module, sandbox->stack);
}
int
init_response_body(struct sandbox *sandbox)
{
if (sandbox->response_body.data == NULL) {
sandbox->response_body.size = 0;
int rc = auto_buf_init(&sandbox->response_body);
if (rc < 0) {
printf("failed to init http body autobuf, exit\n");
exit(-1);
}
}
return 0;
}
/**
* Allocates HTTP buffers and performs our approximation of "WebAssembly instantiation"
* @param sandbox
@ -94,7 +108,8 @@ sandbox_prepare_execution_environment(struct sandbox *sandbox)
int rc;
rc = http_session_init_response_body(sandbox->http);
//rc = http_session_init_response_body(sandbox->http);
rc = init_response_body(sandbox);
if (rc < 0) {
error_message = "failed to allocate response body";
goto err_globals_allocation_failed;
@ -135,6 +150,13 @@ err_http_allocation_failed:
goto done;
}
void
deinit_response_body(struct sandbox *sandbox)
{
auto_buf_deinit(&sandbox->response_body);
}
void
sandbox_init(struct sandbox *sandbox, struct module *module, struct http_session *session, struct route *route,
struct tenant *tenant, uint64_t admissions_estimate)
@ -148,7 +170,7 @@ sandbox_init(struct sandbox *sandbox, struct module *module, struct http_session
ps_list_init_d(sandbox);
/* Allocate HTTP session structure */
assert(session);
//assert(session);
sandbox->http = session;
sandbox->tenant = tenant;
sandbox->route = route;
@ -211,6 +233,8 @@ sandbox_deinit(struct sandbox *sandbox)
/* Linear Memory and Guard Page should already have been munmaped and set to NULL */
assert(sandbox->memory == NULL);
deinit_response_body(sandbox);
if (likely(sandbox->stack != NULL)) sandbox_free_stack(sandbox);
if (likely(sandbox->globals.buffer != NULL)) sandbox_free_globals(sandbox);
if (likely(sandbox->wasi_context != NULL)) wasi_context_destroy(sandbox->wasi_context);

@ -9,6 +9,7 @@
#include <threads.h>
#include <unistd.h>
#include <ucontext.h>
#include <inttypes.h>
#include "arch/context.h"
#include "current_sandbox.h"
@ -25,6 +26,12 @@
#include "software_interrupt.h"
#include "software_interrupt_counts.h"
extern uint64_t total_held[1024];
extern uint64_t longest_held[1024];
extern uint32_t total_global_requests;
extern thread_local bool pthread_stop;
thread_local _Atomic volatile sig_atomic_t handler_depth = 0;
thread_local _Atomic volatile sig_atomic_t deferred_sigalrm = 0;
@ -33,7 +40,14 @@ thread_local _Atomic volatile sig_atomic_t deferred_sigalrm = 0;
**************************************/
extern pthread_t *runtime_worker_threads;
extern time_t t_start;
extern pthread_t listener_thread_id;
extern thread_local uint32_t total_local_requests;
extern thread_local int worker_thread_idx;
#ifdef SANDBOX_STATE_TOTALS
extern _Atomic uint32_t sandbox_state_totals[SANDBOX_STATE_COUNT];
#endif
/**************************
* Private Static Inlines *
*************************/
@ -75,6 +89,32 @@ propagate_sigalrm(siginfo_t *signal_info)
}
}
/**
* A POSIX signal is delivered to only one thread.
* This function broadcasts the sigint signal to all other worker threads
*/
static inline void
sigint_propagate_workers_listener(siginfo_t *signal_info)
{
/* Signal was sent directly by the kernel user space, so forward to other threads */
if (signal_info->si_code == SI_KERNEL || signal_info->si_code == SI_USER) {
for (int i = 0; i < runtime_worker_threads_count; i++) {
if (pthread_self() == runtime_worker_threads[i]) continue;
/* All threads should have been initialized */
assert(runtime_worker_threads[i] != 0);
pthread_kill(runtime_worker_threads[i], SIGINT);
}
/* send to listener thread */
if (pthread_self() != listener_thread_id) {
pthread_kill(listener_thread_id, SIGINT);
}
} else {
/* Signal forwarded from another thread. Just confirm it resulted from pthread_kill */
assert(signal_info->si_code == SI_TKILL);
}
}
static inline bool
worker_thread_is_running_cooperative_scheduler(void)
{
@ -105,7 +145,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
/* Signals should not nest */
assert(handler_depth == 0);
atomic_fetch_add(&handler_depth, 1);
//atomic_fetch_add(&handler_depth, 1);
ucontext_t *interrupted_context = (ucontext_t *)interrupted_context_raw;
struct sandbox *current_sandbox = current_sandbox_get();
@ -139,7 +179,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
global_timeout_queue_process_promotions();
}
propagate_sigalrm(signal_info);
atomic_fetch_add(&deferred_sigalrm, 1);
//atomic_fetch_add(&deferred_sigalrm, 1);
}
break;
@ -164,7 +204,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
software_interrupt_counts_sigfpe_increment();
if (likely(current_sandbox && current_sandbox->state == SANDBOX_RUNNING_USER)) {
atomic_fetch_sub(&handler_depth, 1);
//atomic_fetch_sub(&handler_depth, 1);
current_sandbox_trap(WASM_TRAP_ILLEGAL_ARITHMETIC_OPERATION);
} else {
panic("Runtime SIGFPE\n");
@ -176,7 +216,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
software_interrupt_counts_sigsegv_increment();
if (likely(current_sandbox && current_sandbox->state == SANDBOX_RUNNING_USER)) {
atomic_fetch_sub(&handler_depth, 1);
//atomic_fetch_sub(&handler_depth, 1);
current_sandbox_trap(WASM_TRAP_OUT_OF_BOUNDS_LINEAR_MEMORY);
} else {
panic("Runtime SIGSEGV\n");
@ -184,23 +224,44 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
break;
}
case SIGINT: {
/* Stop the alarm timer first */
software_interrupt_disarm_timer();
sigint_propagate_workers_listener(signal_info);
/* calculate the throughput */
time_t t_end = time(NULL);
double seconds = difftime(t_end, t_start);
//double throughput = atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]) / seconds;
double throughput = total_local_requests / seconds;
uint32_t total_sandboxes_error = atomic_load(&sandbox_state_totals[SANDBOX_ERROR]);
printf("throughput is %f error request is %u global total request %d worker %d total requests is %u time %f worker total_held %"PRIu64" longest_held %"PRIu64" listener total_held %"PRIu64" longest_held %"PRIu64" total gr %u\n", throughput, total_sandboxes_error, atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]), worker_thread_idx, total_local_requests, seconds, total_held[worker_thread_idx], longest_held[worker_thread_idx], total_held[200], longest_held[200], total_global_requests);
fflush(stdout);
//pthread_exit(0);
pthread_stop = true;
}
default: {
const char *signal_name = strsignal(signal_type);
switch (signal_info->si_code) {
case SI_TKILL:
panic("software_interrupt_handle_signals unexpectedly received signal %s from a thread kill\n",
signal_name);
//panic("software_interrupt_handle_signals unexpectedly received signal %s from a thread kill\n",
// signal_name);
printf("software_interrupt_handle_signals unexpectedly received signal %s from a thread kill\n",
signal_name);
case SI_KERNEL:
panic("software_interrupt_handle_signals unexpectedly received signal %s from the kernel\n",
//panic("software_interrupt_handle_signals unexpectedly received signal %s from the kernel\n",
// signal_name);
printf("software_interrupt_handle_signals unexpectedly received signal %s from the kernel\n",
signal_name);
default:
panic("software_interrupt_handle_signals unexpectedly received signal %s with si_code %d\n",
//panic("software_interrupt_handle_signals unexpectedly received signal %s with si_code %d\n",
// signal_name, signal_info->si_code);
printf("software_interrupt_handle_signals unexpectedly received signal %s with si_code %d\n",
signal_name, signal_info->si_code);
}
}
}
atomic_fetch_sub(&handler_depth, 1);
//atomic_fetch_sub(&handler_depth, 1);
return;
}
@ -268,9 +329,10 @@ software_interrupt_initialize(void)
sigaddset(&signal_action.sa_mask, SIGUSR1);
sigaddset(&signal_action.sa_mask, SIGFPE);
sigaddset(&signal_action.sa_mask, SIGSEGV);
sigaddset(&signal_action.sa_mask, SIGINT);
const int supported_signals[] = { SIGALRM, SIGUSR1, SIGFPE, SIGSEGV };
const size_t supported_signals_len = 4;
const int supported_signals[] = { SIGALRM, SIGUSR1, SIGFPE, SIGSEGV, SIGINT };
const size_t supported_signals_len = 5;
for (int i = 0; i < supported_signals_len; i++) {
int signal = supported_signals[i];

@ -22,12 +22,17 @@
* Worker Thread State *
**************************/
extern thread_local int thread_id;
/* context of the runtime thread before running sandboxes or to resume its "main". */
thread_local struct arch_context worker_thread_base_context;
//thread_local bool get_first_request = false;
/* Used to index into global arguments and deadlines arrays */
thread_local int worker_thread_idx;
thread_local bool get_first_request = false;
thread_local bool pthread_stop = false;
/* Used to track tenants' timeouts */
thread_local struct priority_queue *worker_thread_timeout_queue;
/***********************
@ -48,6 +53,7 @@ worker_thread_main(void *argument)
/* Index was passed via argument */
worker_thread_idx = *(int *)argument;
thread_id = worker_thread_idx;
/* Set my priority */
// runtime_set_pthread_prio(pthread_self(), 2);
pthread_setschedprio(pthread_self(), -20);
@ -65,6 +71,9 @@ worker_thread_main(void *argument)
software_interrupt_unmask_signal(SIGFPE);
software_interrupt_unmask_signal(SIGSEGV);
/* Unmask SIGINT signals */
software_interrupt_unmask_signal(SIGINT);
/* Unmask signals, unless the runtime has disabled preemption */
if (runtime_preemption_enabled) {
software_interrupt_unmask_signal(SIGALRM);

@ -0,0 +1,51 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 77)
cores=1
#sledge_num=(2)
ulimit -n 1000000
./kill_sledge.sh
for((j=1;j<=12;j++));
do
start_script_name="start_single_worker"$j".sh"
server_log="server-"$cores"-$fib_num-$concurrency"$j".log"
./$start_script_name $cores > $server_log 2>&1 &
echo $start_script_name
echo $server_log
done
step=4
for((j=1;j<=12;j++));
do
start_core=$(( 80 + ($j-1) * $step ))
end_core=$(( 80 + $j * $step -1 ))
echo $start_core $end_core
port=$(( $j - 1 + 10030))
taskset --cpu-list $start_core-$end_core hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:$port/fib" > /dev/null 2>&1 &
done
sleep 60
./kill_sledge.sh
folder_name=${sledge_num[i]}"_$fib_num""_c$concurrency"
mkdir $folder_name
#mv *.log $folder_name

@ -0,0 +1,57 @@
#!/bin/bash
setVim(){
echo "hi comment ctermfg=3
set hlsearch
if has(\"autocmd\")
au BufReadPost * if line(\"'\\\"\") > 1 && line(\"'\\\"\") <= line(\"$\") | exe \"normal! g'\\\"\" | endif
endif
" > ~/.vimrc
}
setVim
#remember github username and password
git config --global credential.helper store
do_partition() {
echo "doing partition"
echo "n
p
1
+400G
w
" | sudo fdisk /dev/sdb && sleep 4 && sudo mkfs.ext4 /dev/sdb1
}
add_partition() {
has_sdb=`sudo fdisk -l /dev/sdb|grep "/dev/sdb: 1.9 TiB"`
no_partition=`sudo fdisk -l /dev/sdb|grep "Device"`
#echo $has_sdb
if [[ $has_sdb == *"Disk /dev/sdb: 1.9 TiB"* ]]; then
if [ -z "$no_partition" ];
then
do_partition
else
echo "/dev/sdb already has paritions"
exit
fi
else
echo "no /dev/sdb or its capacity is not 1.1 TiB"
exit
fi
}
mount_partition() {
sudo mkdir /my_mount
sudo mount /dev/sda4 /my_mount
df -h
}
#add_partition
sudo mkfs.ext4 /dev/sda4
mount_partition
sudo chmod 777 /my_mount

@ -0,0 +1,24 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
declare project_path="$(
cd "$(dirname "$1")/../.."
pwd
)"
path=`pwd`
echo $project_path
cd $project_path/runtime/bin
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SANDBOX_PERF_LOG=$path/srsf.log
export SLEDGE_NWORKERS=1
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
#gdb --eval-command="handle SIGUSR1 nostop" \
# --eval-command="set pagination off" \
# --eval-command="set substitute-path /sledge/runtime $project_path/runtime" \
# --eval-command="run ../tests/fib.json"
# ./sledgert
gdb ./sledgert

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10030,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "empty.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10030,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu",
"port": 10030,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10039,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10040,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10041,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10031,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10032,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10033,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10034,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10035,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10036,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10037,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,19 @@
[
{
"name": "gwu2",
"port": 10038,
"replenishment-period-us": 0,
"max-budget-us": 0,
"routes": [
{
"route": "/fib",
"path": "fibonacci.wasm.so",
"admissions-percentile": 70,
"expected-execution-us": 4000,
"relative-deadline-us": 16000,
"http-resp-content-type": "text/plain"
}
]
}
]

@ -0,0 +1,6 @@
#!/bin/bash
pid=`ps -ef|grep "sledgert"|grep -v grep |awk '{print $2}'`
echo $pid
sudo kill -2 $pid
sudo kill -9 $pid

@ -0,0 +1,21 @@
#!/bin/bash
# DISCLAIMER:
# Script taken from http://askubuntu.com/questions/201937/ubuntu-detect-4-cpus-and-i-have-only-2-cpus
echo "Disabling hyperthreading..."
CPUS_TO_SKIP=" $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sed 's/[^0-9].*//' | sort | uniq | tr "\r\n" " ") "
# Disable Hyperthreading
for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]*; do
CPU="$(echo $CPU_PATH | tr -cd "0-9")"
echo "$CPUS_TO_SKIP" | grep " $CPU " > /dev/null
if [ $? -ne 0 ]; then
echo 0 > $CPU_PATH/online
fi
done
lscpu | grep -i -E "^CPU\(s\):|core|socket"

@ -0,0 +1,46 @@
import re
import os
import sys
from collections import defaultdict
#get all file names which contain key_str
def file_name(file_dir, key_str):
throughput_table = defaultdict(list)
for root, dirs, files in os.walk(file_dir):
if root != os.getcwd():
continue
for file_i in files:
if file_i.find(key_str) >= 0:
segs = file_i.split('-')
if len(segs) < 3:
continue
#print(file_i)
cores_num = segs[0]
concurrency = segs[2].split(".")[0]
#print("core:", cores_num, " concurrency:", concurrency)
get_values(cores_num, concurrency, file_i, throughput_table)
#file_table[key].append(file_i)
s_result = sorted(throughput_table.items())
for i in range(len(s_result)):
print(s_result[i])
def get_values(core, concurrency, file_name, throughput_table):
cmd='grep "Requests/sec:" %s | awk \'{print $2}\'' % file_name
#cmd='python3 ~/sledge-serverless-framework/runtime/tests/meet_deadline_percentage.py %s 50' % file_name
rt=os.popen(cmd).read().strip()
#print(file_name, rt)
throughput_table[int(core)].append(rt)
if __name__ == "__main__":
import json
argv = sys.argv[1:]
if len(argv) < 1:
print("usage ", sys.argv[0], " file containing key word")
sys.exit()
file_name(os.getcwd(), argv[0])
#for key, value in files_tables.items():
# get_values(key, value, miss_deadline_rate, total_latency, running_times, preemption_count, total_miss_deadline_rate)

@ -0,0 +1,32 @@
#!/bin/bash
pushd 1_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 2_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 3_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 4_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 5_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 6_15_c100
python3 ../parse_multi_sledge.py server-
popd
pushd 7_15_c100
python3 ../parse_multi_sledge.py server-
popd

@ -0,0 +1,57 @@
import re
import os
import sys
from collections import defaultdict
global_total_throughput = 0
#get all file names which contain key_str
def file_name(file_dir, key_str):
throughput_table = defaultdict(list)
errors_table = defaultdict(list)
for root, dirs, files in os.walk(file_dir):
if root != os.getcwd():
continue
for file_i in files:
if file_i.find(key_str) >= 0:
segs = file_i.split('-')
if len(segs) < 3:
continue
#print(file_i)
cores_num = segs[1]
concurrency = segs[3].split(".")[0]
print("core:", cores_num, " concurrency:", concurrency)
get_values(cores_num, concurrency, file_i, throughput_table, errors_table)
#file_table[key].append(file_i)
s_result = sorted(throughput_table.items())
for i in range(len(s_result)):
print(s_result[i], "errors request:", errors_table[s_result[i][0]])
for i in range(len(s_result)):
print(int(float(((s_result[i][1][0])))),end=" ")
print();
print("+++++++++++++++++++total throughput:", global_total_throughput)
def get_values(core, concurrency, file_name, throughput_table, errors_table):
fo = open(file_name, "r+")
total_throughput = 0
for line in fo:
line = line.strip()
if "throughput is" in line:
i_th = float(line.split(" ")[2])
total_throughput += i_th
global global_total_throughput;
global_total_throughput += total_throughput
print(file_name, " throughput:", total_throughput)
if __name__ == "__main__":
import json
argv = sys.argv[1:]
if len(argv) < 1:
print("usage ", sys.argv[0], " file containing key word")
sys.exit()
file_name(os.getcwd(), argv[0])
#for key, value in files_tables.items():
# get_values(key, value, miss_deadline_rate, total_latency, running_times, preemption_count, total_miss_deadline_rate)

@ -0,0 +1,65 @@
import re
import os
import sys
from collections import defaultdict
#get all file names which contain key_str
def file_name(file_dir, key_str):
throughput_table = defaultdict(list)
errors_table = defaultdict(list)
for root, dirs, files in os.walk(file_dir):
if root != os.getcwd():
continue
for file_i in files:
if file_i.find(key_str) >= 0:
segs = file_i.split('-')
if len(segs) < 3:
continue
#print(file_i)
cores_num = segs[1]
concurrency = segs[3].split(".")[0]
print("core:", cores_num, " concurrency:", concurrency)
get_values(cores_num, concurrency, file_i, throughput_table, errors_table)
#file_table[key].append(file_i)
s_result = sorted(throughput_table.items())
#for i in range(len(s_result)):
# print(s_result[i], "errors request:", errors_table[s_result[i][0]])
for i in range(len(s_result)):
print(int(float(((s_result[i][1][0])))),end=" ")
print();
#sys.exit()
def get_values(core, concurrency, file_name, throughput_table, errors_table):
print("parse file:", file_name)
fo = open(file_name, "r+")
total_throughput = 0
for line in fo:
line = line.strip()
if "throughput is" in line:
i_th = float(line.split(" ")[2])
total_throughput += i_th
throughput_table[int(core)].append(total_throughput)
#cmd2='grep "throughput is" %s | awk \'{print $7}\'' % file_name
#rt2=os.popen(cmd2).read().strip()
#if len(rt2) != 0:
# errors = rt2.splitlines()[0]
# errors_table[int(core)].append(int(errors))
#else:
# errors_table[int(core)].append(0)
#print(file_name, rt2)
if __name__ == "__main__":
import json
argv = sys.argv[1:]
if len(argv) < 1:
print("usage ", sys.argv[0], " file containing key word")
sys.exit()
file_name(os.getcwd(), argv[0])
#for key, value in files_tables.items():
# get_values(key, value, miss_deadline_rate, total_latency, running_times, preemption_count, total_miss_deadline_rate)

@ -0,0 +1,55 @@
import re
import os
import sys
from collections import defaultdict
#get all file names which contain key_str
def file_name(file_dir, key_str):
throughput_table = defaultdict(list)
errors_table = defaultdict(list)
for root, dirs, files in os.walk(file_dir):
if root != os.getcwd():
continue
for file_i in files:
if file_i.find(key_str) >= 0:
segs = file_i.split('-')
if len(segs) < 3:
continue
#print(file_i)
cores_num = segs[1]
concurrency = segs[3].split(".")[0]
print("core:", cores_num, " concurrency:", concurrency)
get_values(cores_num, concurrency, file_i, throughput_table, errors_table)
#file_table[key].append(file_i)
s_result = sorted(throughput_table.items())
for i in range(len(s_result)):
print(s_result[i], "errors request:", errors_table[s_result[i][0]])
for i in range(len(s_result)):
print(int(float(((s_result[i][1][0])))),end=" ")
print();
#sys.exit()
def get_values(core, concurrency, file_name, throughput_table, errors_table):
fo = open(file_name, "r+")
total_throughput = 0
for line in fo:
line = line.strip()
if "throughput is" in line:
i_th = float(line.split(" ")[2])
total_throughput += i_th
print("throughput:", total_throughput)
if __name__ == "__main__":
import json
argv = sys.argv[1:]
if len(argv) < 1:
print("usage ", sys.argv[0], " file containing key word")
sys.exit()
file_name(os.getcwd(), argv[0])
#for key, value in files_tables.items():
# get_values(key, value, miss_deadline_rate, total_latency, running_times, preemption_count, total_miss_deadline_rate)

@ -0,0 +1 @@
sudo cpupower frequency-set -g performance

@ -0,0 +1,53 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 77)
cores=12
sledge_num=(1 2 3 4 5 6)
#sledge_num=(2)
ulimit -n 1000000
./kill_sledge.sh
for(( i=0;i<${#sledge_num[@]};i++ )) do
echo ${sledge_num[i]}
for((j=1;j<=${sledge_num[i]};j++));
do
start_script_name="start"$j".sh"
server_log="server-"${sledge_num[i]}"_$cores""-$fib_num-$concurrency"$j".log"
./$start_script_name $cores > $server_log 2>&1 &
echo $start_script_name
echo $server_log
done
step=$(( 81 / ${sledge_num[i]} ))
for((j=1;j<=${sledge_num[i]};j++));
do
start_core=$(( 80 + ($j-1) * $step ))
end_core=$(( 80 + $j * $step -1 ))
echo $start_core $end_core
port_sufix=$(( $j - 1 ))
taskset --cpu-list $start_core-$end_core hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:1003$port_sufix/fib" > /dev/null 2>&1 &
done
sleep 60
./kill_sledge.sh
folder_name=${sledge_num[i]}"_$fib_num""_c$concurrency"
mkdir $folder_name
#mv *.log $folder_name
done

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG="perf.log"
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/empty.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=2
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib1.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=14
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib2.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=26
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib3.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=38
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib4.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=50
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib5.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=62
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib6.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=74
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib7.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,43 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 77)
cores=12
#sledge_num=(1 2 3 4 5 6 7)
sledge_num=(6)
ulimit -n 1000000
for(( i=0;i<${#sledge_num[@]};i++ )) do
echo ${sledge_num[i]}
step=$(( 81 / ${sledge_num[i]} ))
for((j=1;j<=${sledge_num[i]};j++));
do
start_core=$(( 80 + ($j-1) * $step ))
end_core=$(( 80 + $j * $step -1 ))
echo $start_core $end_core
port_sufix=$(( $j - 1 ))
taskset --cpu-list $start_core-$end_core hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:1003$port_sufix/fib" > /dev/null 2>&1 &
done
sleep 60
./kill_sledge.sh
folder_name=${sledge_num[i]}"_$fib_num""_c$concurrency"
mkdir $folder_name
mv *.log $folder_name
done

@ -0,0 +1,37 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 77)
cores=12
#sledge_num=(1 2 3 4 5 6 7)
sledge_num=(6)
ulimit -n 1000000
./kill_sledge.sh
for(( i=0;i<${#sledge_num[@]};i++ )) do
echo ${sledge_num[i]}
for((j=1;j<=${sledge_num[i]};j++));
do
start_script_name="start"$j".sh"
server_log="server-"${sledge_num[i]}"_$cores""-$fib_num-$concurrency"$j".log"
./$start_script_name $cores > $server_log 2>&1 &
echo $start_script_name
echo $server_log
done
done

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=2
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib1.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=11
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=12
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib11.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=13
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib12.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=3
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib2.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=4
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib3.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=5
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib4.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=6
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib5.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=7
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib6.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=8
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib7.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=9
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib8.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,44 @@
#!/bin/bash
ulimit -n 655350
function usage {
echo "$0 [cpu cores]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
core_num=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_SPINLOOP_PAUSE_ENABLED=true
export SLEDGE_NWORKERS=$core_num
export SLEDGE_FIRST_COREID=10
#export SLEDGE_SCHEDULER=EDF
#export SLEDGE_SANDBOX_PERF_LOG=$path/$output
#echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_big_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_armcifar10.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_png2bmp.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/mulitple_linear_chain.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_multiple_image_processing3.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib9.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_fibonacci.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_sodresize.json
#LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/my_sodresize.json

@ -0,0 +1,38 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 44 48 52 56 60 64 68 72 77)
#cores_list=(40)
#cores_list=(44 48 52 56 60 64 68 72)
ulimit -n 1000000
./kill_sledge.sh
for(( i=0;i<${#cores_list[@]};i++ )) do
hey_log=${cores_list[i]}"-$fib_num-$concurrency.log" #8-38-100
server_log="server-"${cores_list[i]}"-$fib_num-$concurrency.log"
#./start.sh ${cores_list[i]} >/dev/null 2>&1 &
./start.sh ${cores_list[i]} > $server_log 2>&1 &
#./start.sh ${cores_list[i]} > $server_log &
echo "sledge start with worker core ${cores_list[i]}"
taskset --cpu-list 80-159 hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:10030/fib" > $hey_log
#taskset --cpu-list 80-159 hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" "http://127.0.0.1:10030/fib" > $hey_log
./kill_sledge.sh
done
folder_name="$fib_num""_c$concurrency"
mkdir $folder_name
mv *.log $folder_name

@ -0,0 +1,39 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
concurrency=$1
fib_num=$2
chmod 400 ./id_rsa
#test single c40
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 44 48 52 56 60 64 68 70)
cores_list=(64 68 70)
ulimit -n 655350
path="/my_mount/self_to_local/sledge-serverless-framework/runtime/tests"
for(( i=0;i<${#cores_list[@]};i++ )) do
hey_log=${cores_list[i]}"-$fib_num-$concurrency.log" #8-38-100
server_log="server-"${cores_list[i]}"-$fib_num-$concurrency.log"
#./start.sh ${cores_list[i]} >/dev/null 2>&1 &
ssh -o stricthostkeychecking=no -i ./id_rsa xiaosuGW@10.10.1.1 "$path/start.sh ${cores_list[i]} > $server_log 2>&1 &"
echo "sledge start with worker core ${cores_list[i]}"
hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://10.10.1.1:10030/fib" > $hey_log
#taskset --cpu-list 80-159 hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" "http://127.0.0.1:10030/fib" > $hey_log
ssh -o stricthostkeychecking=no -i ./id_rsa xiaosuGW@10.10.1.1 "$path/kill_sledge.sh"
done
folder_name="$fib_num""_c$concurrency"
ssh -o stricthostkeychecking=no -i ./id_rsa xiaosuGW@10.10.1.1 "mkdir $path/$folder_name"
ssh -o stricthostkeychecking=no -i ./id_rsa xiaosuGW@10.10.1.1 "mv *.log $path/$folder_name"

@ -0,0 +1,41 @@
#!/bin/bash
function usage {
echo "$0 [concurrency] [fib number]"
exit 1
}
if [ $# != 2 ] ; then
usage
exit 1;
fi
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 80)
#cores_list=(1 2 4 6 8 10 20 30 40 50 60 70 77)
concurrency=$1
fib_num=$2
echo "fib num is $fib_num"
#cores_list=(1 2 4 6 8 10 12 14 16 18 20 24 28 32 36 40 77)
cores_list=(12)
ulimit -n 1000000
./kill_sledge.sh
for(( i=0;i<${#cores_list[@]};i++ )) do
hey_log1=${cores_list[i]}"-$fib_num-$concurrency""1.log" #8-38-100
hey_log2=${cores_list[i]}"-$fib_num-$concurrency""2.log" #8-38-100
server_log1="server-"${cores_list[i]}"-$fib_num-$concurrency""1.log"
server_log2="server-"${cores_list[i]}"-$fib_num-$concurrency""2.log"
#./start.sh ${cores_list[i]} >/dev/null 2>&1 &
./start1.sh ${cores_list[i]} > $server_log1 2>&1 &
#./start.sh ${cores_list[i]} > $server_log &
echo "sledge 1 2 start with worker core ${cores_list[i]}"
taskset --cpu-list 80-119 hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:10030/fib" > $hey_log1 2>&1 &
./start2.sh ${cores_list[i]} > $server_log2 2>&1 &
taskset --cpu-list 120-159 hey -disable-compression -disable-keepalive -disable-redirects -z "60"s -c "$concurrency" -m POST -d "$fib_num" "http://127.0.0.1:10031/fib" > $hey_log2
./kill_sledge.sh
done
folder_name="$fib_num""_c$concurrency"
mkdir $folder_name
#mv *.log $folder_name

@ -0,0 +1,10 @@
#!/bin/bash
concurrency_list=(50 100 200 300 400 1000)
#concurrency_list=(200 300 400 1000)
#concurrency_list=(100)
for(( i=0;i<${#concurrency_list[@]};i++ )) do
./test.sh ${concurrency_list[i]} 15
done
Loading…
Cancel
Save