Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
hwwang | 1ba27201a2 | 3 months ago |
hwwang | 696dcba524 | 3 months ago |
hwwang | 1b4dec9a5f | 3 months ago |
yanenshuo | 8db8516501 | 3 months ago |
hwwang | 364f474cb7 | 4 months ago |
hwwang | eb79a6d497 | 4 months ago |
hwwang | 73da853ad4 | 6 months ago |
@ -1,2 +1,3 @@
|
||||
LD_LIBRARY_PATH=/home/hai/sledge-serverless-framework/runtime/bin
|
||||
SLEDGE_SCHEDULER=EDF
|
||||
SLEDGE_SANDBOX_PERF_LOG=/home/hai/sledge-serverless-framework/debuglog.txt
|
||||
|
@ -1,85 +1,52 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Hyde",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/runtime/bin/sledgert",
|
||||
"args": [
|
||||
"${workspaceFolder}/runtime/experiments/applications/ocr/hyde/spec.json"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [
|
||||
{
|
||||
"name": "SLEDGE_SANDBOX_PERF_LOG",
|
||||
"value": "${workspaceFolder}/debug.log"
|
||||
}
|
||||
],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"sourceFileMap": {
|
||||
"/sledge/runtime": "${workspaceFolder}/runtime"
|
||||
},
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Preemption",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/runtime/bin/sledgert",
|
||||
"args": [
|
||||
"${workspaceFolder}/runtime/tests/test_multiple_image_processing4.json"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"sourceFileMap": {
|
||||
"/sledge/runtime": "${workspaceFolder}/runtime"
|
||||
},
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tree",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/runtime/bin/sledgert",
|
||||
"args": [
|
||||
"${workspaceFolder}/runtime/tests/tree.json"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"sourceFileMap": {
|
||||
"/sledge/runtime": "${workspaceFolder}/runtime"
|
||||
},
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Hyde",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/runtime/bin/sledgert",
|
||||
"args": [
|
||||
"${workspaceFolder}/runtime/experiments/applications/ocr/hyde/spec.json"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Preemption",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/runtime/bin/sledgert",
|
||||
"args": [
|
||||
"${workspaceFolder}/runtime/experiments/preemption/spec.json"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define TABLE_SIZE 100
|
||||
|
||||
typedef struct Node {
|
||||
int key;
|
||||
char value[256];
|
||||
struct Node* next;
|
||||
} Node;
|
||||
|
||||
typedef struct Edge {
|
||||
Node* from;
|
||||
Node* to;
|
||||
double cost;
|
||||
struct Edge* next;
|
||||
} Edge;
|
||||
|
||||
typedef struct Graph {
|
||||
Node* nodes[TABLE_SIZE];
|
||||
Edge* edges[TABLE_SIZE];
|
||||
} Graph;
|
||||
|
||||
unsigned int hash(int key) {
|
||||
return key % TABLE_SIZE;
|
||||
}
|
||||
|
||||
void insertNode(Graph* g, int key, const char* value) {
|
||||
unsigned int index = hash(key);
|
||||
Node* new_node = (Node*) malloc(sizeof(Node));
|
||||
if (new_node) {
|
||||
new_node->key = key;
|
||||
strcpy(new_node->value, value);
|
||||
new_node->next = g->nodes[index];
|
||||
g->nodes[index] = new_node;
|
||||
}
|
||||
}
|
||||
|
||||
Node* findNode(Graph* g, int key) {
|
||||
unsigned int index = hash(key);
|
||||
Node* node = g->nodes[index];
|
||||
while (node) {
|
||||
if (node->key == key)
|
||||
return node;
|
||||
node = node->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void insertEdge(Graph* g, int fromKey, int toKey, double cost) {
|
||||
Node* fromNode = findNode(g, fromKey);
|
||||
Node* toNode = findNode(g, toKey);
|
||||
if (fromNode && toNode) {
|
||||
unsigned int index = hash(fromKey);
|
||||
Edge* new_edge = (Edge*) malloc(sizeof(Edge));
|
||||
if (new_edge) {
|
||||
new_edge->from = fromNode;
|
||||
new_edge->to = toNode;
|
||||
new_edge->cost = cost;
|
||||
new_edge->next = g->edges[index];
|
||||
g->edges[index] = new_edge;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initGraph(Graph* g) {
|
||||
for (int i = 0; i < TABLE_SIZE; i++) {
|
||||
g->nodes[i] = NULL;
|
||||
g->edges[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
Graph g;
|
||||
initGraph(&g);
|
||||
|
||||
insertNode(&g, 1, "Node 1");
|
||||
insertNode(&g, 2, "Node 2");
|
||||
insertEdge(&g, 1, 2, 0.5);
|
||||
|
||||
Node* n = findNode(&g, 1);
|
||||
if (n) {
|
||||
printf("Found node: %s\n", n->value);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
import unittest,importlib,BeautifulReport
|
||||
import cffi
|
||||
|
||||
def load():
|
||||
with open("/home/hai/sledge-serverless-framework/runtime/include/hash.h", "r") as f:
|
||||
inc = ""
|
||||
for line in f:
|
||||
if not line.strip().startswith('#'):
|
||||
inc += line
|
||||
src = open("/home/hai/sledge-serverless-framework/runtime/Utest_py/hash.c").read()
|
||||
|
||||
builder = cffi.FFI()
|
||||
|
||||
builder.cdef(inc)
|
||||
builder.set_source("hashlib",src)
|
||||
builder.compile()
|
||||
|
||||
md = importlib.import_module("hashlib")
|
||||
|
||||
return md.lib
|
||||
|
||||
md = load()
|
||||
class HashTableTestCase(unittest.TestCase):
|
||||
|
||||
def test_case1(self):
|
||||
'''
|
||||
测试添加和查找功能
|
||||
'''
|
||||
table = md.create_table()
|
||||
md.add_item(table, b"key1", "Hello World")
|
||||
value = md.find_value(table, b"key1")
|
||||
self.assertEqual(value, "Hello World")
|
||||
print('Value for "key1":', value)
|
||||
|
||||
def test_case2(self):
|
||||
'''
|
||||
测试查找不存在的键
|
||||
'''
|
||||
table = md.create_table()
|
||||
value = md.find_value(table, b"nonexistent")
|
||||
self.assertIsNone(value)
|
||||
print('Value for "nonexistent":', value)
|
||||
|
||||
def test_case3(self):
|
||||
# 确保每个测试后表被释放
|
||||
md.free_table(self.table)
|
||||
|
||||
sut = unittest.TestSuite()
|
||||
sut.addTest(unittest.makeSuite(HashTableTestCase))
|
||||
run = BeautifulReport.BeautifulReport(sut)
|
||||
|
||||
run.report(filename="test.html",description="单元测试")
|
||||
|
Binary file not shown.
@ -1,49 +0,0 @@
|
||||
// hash_test.c
|
||||
#include "../include/hash.h"
|
||||
#include <stdio.h>
|
||||
typedef struct test
|
||||
{
|
||||
char *name;
|
||||
}test;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
test *test1 = malloc(sizeof(test));
|
||||
test *test2 = malloc(sizeof(test));
|
||||
test1->name = "test1";
|
||||
test2->name = "test2";
|
||||
HashTable *myTable = create_table();
|
||||
add_item(myTable, "key1", test1);
|
||||
add_item(myTable, "key2", test2);
|
||||
char *input = argv[1];
|
||||
test *value = find_value(myTable, input);
|
||||
if (value) {
|
||||
printf("Test Passed: %s\n", value->name);
|
||||
} else {
|
||||
printf("Test Failed: Key not found.\n");
|
||||
}
|
||||
remove_item(myTable, "key1");
|
||||
printf("remove key1.\n");
|
||||
test *value2 = find_value(myTable, input);
|
||||
if (value2) {
|
||||
printf("Test Passed: %s\n", value2->name);
|
||||
} else {
|
||||
printf("Test Failed: Key not found.\n");
|
||||
}
|
||||
add_item(myTable, "key1", test1);
|
||||
test *value4 = find_value(myTable, "key1");
|
||||
if (value4) {
|
||||
printf("Test Passed: %s\n", value4->name);
|
||||
} else {
|
||||
printf("Test Failed: Key not found.\n");
|
||||
}
|
||||
test *value3 = find_value(myTable, "key2");
|
||||
if (value3) {
|
||||
printf("Test Passed: %s\n", value3->name);
|
||||
} else {
|
||||
printf("Test Failed: Key not found.\n");
|
||||
}
|
||||
free(test1);
|
||||
free(test2);
|
||||
free_table(myTable);
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,144 +0,0 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
#define TABLE_SIZE 32 // the size of hash table
|
||||
#define MAX_KEY_LENGTH 32 // the maximum length of key
|
||||
typedef struct {
|
||||
char key[MAX_KEY_LENGTH];
|
||||
void *value;
|
||||
int is_deleted; // Flag to mark items as deleted
|
||||
} HashItem;
|
||||
|
||||
typedef struct {
|
||||
HashItem **items;
|
||||
pthread_mutex_t lock;
|
||||
} HashTable;
|
||||
|
||||
static inline unsigned long
|
||||
hash_function(const char *str) {
|
||||
unsigned long i = 0;
|
||||
for (int j = 0; str[j]; j++)
|
||||
i += str[j];
|
||||
return i % TABLE_SIZE;
|
||||
}
|
||||
|
||||
static inline HashTable
|
||||
*create_table() {
|
||||
HashTable *table = (HashTable *)malloc(sizeof(HashTable));
|
||||
if (!table) {
|
||||
fprintf(stderr, "Failed to allocate memory for hash table struct.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
table->items = (HashItem **)malloc(sizeof(HashItem*) * TABLE_SIZE);
|
||||
if (!table->items) {
|
||||
fprintf(stderr, "Failed to allocate memory for items.\n");
|
||||
free(table); // Free the table if item allocation fails
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pthread_mutex_init(&table->lock, NULL);
|
||||
|
||||
for (int i = 0; i < TABLE_SIZE; i++) {
|
||||
table->items[i] = NULL;
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
static inline void
|
||||
add_item(HashTable *table, const char *key, void *value) {
|
||||
assert(table != NULL);
|
||||
assert(key != NULL);
|
||||
assert(value != NULL);
|
||||
|
||||
pthread_mutex_lock(&table->lock);
|
||||
|
||||
unsigned long index = hash_function(key);
|
||||
HashItem *item = malloc(sizeof(HashItem));
|
||||
if (!item) {
|
||||
fprintf(stderr, "Failed to allocate memory for a new item.\n");
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
return;
|
||||
}
|
||||
strcpy(item->key, key);
|
||||
item->value = value;
|
||||
item->is_deleted = 0;
|
||||
|
||||
while (table->items[index] != NULL && !table->items[index]->is_deleted && strcmp(table->items[index]->key, key) != 0) {
|
||||
index = (index + 1) % TABLE_SIZE;
|
||||
}
|
||||
|
||||
free(table->items[index]); // Free the existing item if overwriting
|
||||
table->items[index] = item;
|
||||
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
}
|
||||
|
||||
static inline void
|
||||
remove_item(HashTable *table, const char *key) {
|
||||
assert(table != NULL);
|
||||
assert(key != NULL);
|
||||
|
||||
pthread_mutex_lock(&table->lock);
|
||||
|
||||
unsigned long index = hash_function(key);
|
||||
while (table->items[index] != NULL && strcmp(table->items[index]->key, key) != 0) {
|
||||
index = (index + 1) % TABLE_SIZE;
|
||||
}
|
||||
|
||||
if (table->items[index] != NULL) {
|
||||
table->items[index]->is_deleted = 1; // Mark as deleted
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
}
|
||||
|
||||
static inline void
|
||||
*find_value(HashTable *table, const char *key) {
|
||||
assert(table != NULL);
|
||||
assert(key != NULL);
|
||||
|
||||
pthread_mutex_lock(&table->lock);
|
||||
|
||||
unsigned long index = hash_function(key);
|
||||
int count = 0;
|
||||
while (table->items[index] != NULL && count < TABLE_SIZE && (table->items[index]->is_deleted || strcmp(table->items[index]->key, key) != 0)) {
|
||||
index = (index + 1) % TABLE_SIZE;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (table->items[index] == NULL || table->items[index]->is_deleted)
|
||||
{
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
return table->items[index]->value;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
free_table(HashTable *table) {
|
||||
assert(table != NULL);
|
||||
|
||||
pthread_mutex_lock(&table->lock);
|
||||
|
||||
for (int i = 0; i < TABLE_SIZE; i++) {
|
||||
if (table->items[i] != NULL) {
|
||||
free(table->items[i]); // Free each item
|
||||
}
|
||||
}
|
||||
free(table->items);
|
||||
free(table);
|
||||
|
||||
pthread_mutex_unlock(&table->lock);
|
||||
pthread_mutex_destroy(&table->lock);
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,22 @@
|
||||
import os
|
||||
|
||||
def calculate_average(filename):
|
||||
with open(filename, "r") as file:
|
||||
values = file.readlines()
|
||||
values = [int(value.strip()) for value in values]
|
||||
average = sum(values) / len(values) if values else 0
|
||||
return average
|
||||
|
||||
def main():
|
||||
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||
|
||||
for noop in noop_functions:
|
||||
filename = f"{noop}.txt"
|
||||
if os.path.exists(filename):
|
||||
average = calculate_average(filename)
|
||||
print(f"Average for {filename}: {average}")
|
||||
else:
|
||||
print(f"{filename} does not exist.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -0,0 +1,26 @@
|
||||
import sys
|
||||
|
||||
def process_file(input_file, noop_functions):
|
||||
data = {noop: [] for noop in noop_functions}
|
||||
|
||||
with open(input_file, "r") as infile:
|
||||
for line in infile:
|
||||
for noop in noop_functions:
|
||||
if noop in line:
|
||||
value = line.split(",")[6]
|
||||
data[noop].append(value)
|
||||
|
||||
for noop, values in data.items():
|
||||
with open(f"{noop}.txt", "w") as outfile:
|
||||
outfile.write("\n".join(values))
|
||||
|
||||
if __name__ == "__main__":
|
||||
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||
|
||||
argv = sys.argv[1:]
|
||||
if len(argv) < 1:
|
||||
print("usage:", sys.argv[0], "file_dir percentage")
|
||||
sys.exit()
|
||||
|
||||
input_file = argv[0]
|
||||
process_file(input_file, noop_functions)
|
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
// 定义一个完全无操作的noop函数
|
||||
void noop() {
|
||||
// 此函数完全不执行任何操作
|
||||
}
|
||||
|
||||
int main() {
|
||||
// 仅调用noop函数
|
||||
noop();
|
||||
|
||||
// main函数也不进行任何输出
|
||||
return 0;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
sudo chsh -s /bin/bash xiaosuGW
|
||||
sudo chsh -s /bin/bash hai
|
||||
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 1 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
|
||||
|
||||
declare project_path="$(
|
||||
cd "$(dirname "$0")/../.."
|
||||
pwd
|
||||
)"
|
||||
echo $project_path
|
||||
path=`pwd`
|
||||
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||
export SLEDGE_CPU_SPEED=2500
|
||||
export SLEDGE_SCHEDULER=FIFO
|
||||
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||
export SLEDGE_NWORKERS=16
|
||||
#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_noop1.json
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 1 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
|
||||
|
||||
declare project_path="$(
|
||||
cd "$(dirname "$0")/../.."
|
||||
pwd
|
||||
)"
|
||||
echo $project_path
|
||||
path=`pwd`
|
||||
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||
export SLEDGE_CPU_SPEED=2500
|
||||
export SLEDGE_SCHEDULER=FIFO
|
||||
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||
export SLEDGE_NWORKERS=16
|
||||
#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_noop3.json
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 1 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
|
||||
|
||||
declare project_path="$(
|
||||
cd "$(dirname "$0")/../.."
|
||||
pwd
|
||||
)"
|
||||
echo $project_path
|
||||
path=`pwd`
|
||||
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||
export SLEDGE_CPU_SPEED=2500
|
||||
export SLEDGE_SCHEDULER=FIFO
|
||||
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||
export SLEDGE_NWORKERS=16
|
||||
#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_noop5.json
|
@ -0,0 +1,130 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [cpu-log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
chmod 400 ./id_rsa
|
||||
path="/home/weihao/sledge/sledge_tree/runtime/tests"
|
||||
|
||||
#test single 5k c5 50% max RPS (500)
|
||||
f1="5k_single_50.txt"
|
||||
server_log_file="execution_single_5k_50.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 50 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
|
||||
#test single 5k c5 60% max RPS
|
||||
f1="5k_single_60.txt"
|
||||
server_log_file="execution_single_5k_60.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_rps.sh $f1 120 60 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 5k c5 70% max RPS
|
||||
f1="5k_single_70.txt"
|
||||
server_log_file="execution_single_5k_70.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_rps.sh $f1 120 70 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 5k c5 80% max RPS
|
||||
f1="5k_single_80.txt"
|
||||
server_log_file="execution_single_5k_80.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_rps.sh $f1 120 80 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 5k c5 90% max RPS
|
||||
f1="5k_single_90.txt"
|
||||
server_log_file="execution_single_5k_90.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_rps.sh $f1 120 90 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 5k c5 99% max RPS
|
||||
f1="5k_single_99.txt"
|
||||
server_log_file="execution_single_5k_99.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_rps.sh $f1 120 100 5k.jpg 10006 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 50% max RPS (135)
|
||||
f1="105k_single_50.txt"
|
||||
server_log_file="execution_single_105k_50.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 13 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 60% max RPS
|
||||
f1="105k_single_60.txt"
|
||||
server_log_file="execution_single_105k_60.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 16 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 70% max RPS
|
||||
f1="105k_single_70.txt"
|
||||
server_log_file="execution_single_105k_70.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 19 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 80% max RPS
|
||||
f1="105k_single_80.txt"
|
||||
server_log_file="execution_single_105k_80.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 22 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 90% max RPS
|
||||
f1="105k_single_90.txt"
|
||||
server_log_file="execution_single_105k_90.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 25 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test single 105k c5 99% max RPS
|
||||
f1="105k_single_99.txt"
|
||||
server_log_file="execution_single_105k_99.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./test_8c.sh $f1 120 27 5k.jpg 10000 2>&1 &
|
||||
pid2=$!
|
||||
wait -f $pid2
|
||||
$path/kill_sledge.sh
|
@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [aad step] [first_rps] [max_rps]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 3 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
step=$1
|
||||
current_rps=$2
|
||||
max_rps=$3
|
||||
|
||||
chmod 400 ./id_rsa
|
||||
path="/home/weihao/sledge/sledge_tree/runtime/tests"
|
||||
|
||||
last_actual_rps=0
|
||||
first_run=true
|
||||
|
||||
while [ $current_rps -le $max_rps ]
|
||||
do
|
||||
echo "Testing with RPS: $current_rps"
|
||||
server_log_file="test_max_rps.log"
|
||||
f1="105k_"$current_rps".txt"
|
||||
f2="305k_"$current_rps".txt"
|
||||
f3="5k_"$current_rps".txt"
|
||||
f4="40k_"$current_rps".txt"
|
||||
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
|
||||
./test_rps.sh $f1 30 $current_rps 5k.jpg 10000 2>&1 &
|
||||
pid1=$!
|
||||
wait -f $pid1
|
||||
|
||||
# read hey ouput max rps
|
||||
actual_rps=$(grep "Requests/sec" "$f1" | awk '{print $2}')
|
||||
# read loadtest max rps
|
||||
# actual_rps=$(grep "Requests per second" "$f1" | awk '{print $4}')
|
||||
echo "Actual RPS achieved: $actual_rps"
|
||||
|
||||
if [ "$first_run" = false ]; then
|
||||
if (( $(echo "$actual_rps <= $last_actual_rps" | bc -l) )); then
|
||||
echo "Actual RPS did not increase, stopping test."
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
last_actual_rps=$actual_rps
|
||||
|
||||
# ±ê¼ÇµÚÒ»´ÎÔËÐÐÒÑÍê³É
|
||||
first_run=false
|
||||
current_rps=$((current_rps + step))
|
||||
|
||||
$path/kill_sledge.sh
|
||||
echo "sledge has been stopped"
|
||||
|
||||
done
|
||||
|
||||
echo "Max RPS testing completed."
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop2",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop3",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop2",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop3",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop4",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10003,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop5",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10004,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount1" , "16777216" ] }
|
||||
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount2" , "16777216" ] }
|
||||
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math1" ] }
|
||||
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math2" ] }
|
||||
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees1", "16" ] }
|
||||
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees2", "16" ] }
|
||||
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc1", "crc/large.pcm" ] }
|
||||
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc2", "crc/large.pcm" ] }
|
||||
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra1", "dijkstra/input.dat" ] }
|
||||
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra2", "dijkstra/input.dat" ] }
|
||||
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever01" ] }
|
||||
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever02" ] }
|
||||
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever01", "10" ] }
|
||||
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever02", "20" ] }
|
||||
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever03", "30" ] }
|
||||
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever04", "40" ] }
|
||||
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft1" , "8", "32768" ] }
|
||||
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft2" , "8", "32768" ] }
|
||||
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers1" ] }
|
||||
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers2" ] }
|
||||
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm1" , "-fps" , "-c", "gsm/large.au" ] }
|
||||
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm2" , "-fps" , "-c", "gsm/large.au" ] }
|
||||
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg1" ] }
|
||||
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg2" ] }
|
||||
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot1", "5000" ] }
|
||||
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot2", "5000" ] }
|
||||
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply1" ] }
|
||||
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply2" ] }
|
||||
;127.0.0.1:10028${ "module" : "patricia", "args" : [ "patricia1" , "large.udp" ] }
|
||||
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite1" ] }
|
||||
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite2" ] }
|
||||
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch1" ] }
|
||||
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch2" ] }
|
||||
;127.0.0.1:10034${ "module" : "filesys", "args" : [ "filesys1", "fs_in.txt", "fs_out.txt" ] }
|
||||
;127.0.0.1:10036${ "module" : "sockserver", "args" : [ "sockserv1", "20000" ] }
|
||||
;127.0.0.1:10038${ "module" : "sockclient", "args" : [ "sockcli1", "localhost", "20000" ] }
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "tree",
|
||||
"path": "tree_wasm.so",
|
||||
"port": 10000,
|
||||
"expected-execution-us": 5000,
|
||||
"relative-deadline-us": 360000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1024,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1024,
|
||||
"http-resp-content-type": "text/plain"
|
||||
}
|
||||
|
Binary file not shown.
@ -1,22 +0,0 @@
|
||||
Runtime Environment:
|
||||
CPU Speed: 2400 MHz
|
||||
Processor Speed: 2400 MHz
|
||||
RLIMIT_DATA: Infinite
|
||||
RLIMIT_NOFILE: 1048576 (Increased from 8192)
|
||||
Core Count: 8
|
||||
Listener core ID: 1
|
||||
First Worker core ID: 2
|
||||
Worker core count: 6
|
||||
Scheduler Policy: EDF
|
||||
Sigalrm Policy: BROADCAST
|
||||
Preemption: Enabled
|
||||
Quantum: 5000 us
|
||||
Sandbox Performance Log: Disabled
|
||||
Starting listener thread
|
||||
Listener core thread: 7ffff7a006c0
|
||||
Starting 6 worker thread(s)
|
||||
C: 01, T: 0x7ffff7bfdd80, F: runtime_start_runtime_worker_threads>
|
||||
Sandboxing environment ready!
|
||||
|
||||
C: 01, T: 0x7ffff7bfdd80, F: module_new>
|
||||
Stack Size: 524288
|
Loading…
Reference in new issue