diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 8824256..9763745 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v3 - name: Test Vine Serverless Mode run: ./test-vine-serverless.sh - + parrot-cvmfs-job: runs-on: ubuntu-20.04 timeout-minutes: 10 @@ -96,6 +96,23 @@ jobs: - name: Test TopEFT + Work Queue run: ./test-topeft.sh + vine-task-throughput: + runs-on: ubuntu-20.04 + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Test Vine Throughput + run: ./test-vine-task-throughput.sh + + vine-throughput-capi-job: + runs-on: ubuntu-20.04 + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Test Vine Throughput Test C API + run: ./test-vine-task-throughput-capi.sh # Removed plain coffea test 7/24/2023 to replace with coffea-dask-taskvine when ready. # coffea-job: # runs-on: ubuntu-20.04 diff --git a/test-vine-task-throughput-capi.sh b/test-vine-task-throughput-capi.sh new file mode 100755 index 0000000..4c27acf --- /dev/null +++ b/test-vine-task-throughput-capi.sh @@ -0,0 +1,12 @@ + +#!/bin/sh + +# Build the sources from github +. ./install-github.sh + +# Compile C API test using environment +gcc test-vine-task-throughput.c -o test-vine-task-throughput -I $PREFIX/include/cctools/ -L $PREFIX/lib -ltaskvine -ldttools -lm -lcrypto -lssl -lz + +./test-vine-task-throughput & + +vine_worker localhost 9123 --single-shot \ No newline at end of file diff --git a/test-vine-task-throughput.c b/test-vine-task-throughput.c new file mode 100644 index 0000000..34bd1fc --- /dev/null +++ b/test-vine-task-throughput.c @@ -0,0 +1,78 @@ +#include "taskvine.h" + +#include +#include +#include +#include +#include +#include +#include +int main(int argc, char *argv[]) +{ + struct vine_manager *m; + int i; + int tasksC = 5000; + + m = vine_create(VINE_DEFAULT_PORT); + + if(!m) { + printf("couldn't create manager: %s\n", strerror(errno)); + return 1; + } + printf("TaskVine listening on %d\n", vine_port(m)); + + for(i=0;i 900); + + printf("Chaining was %f tasks per second\n", chaining); + printf("all tasks complete!\n"); + assert(chaining > 1500); + vine_delete(m); + + return 0; +} diff --git a/test-vine-task-throughput.py b/test-vine-task-throughput.py index fb2f5df..68df026 100644 --- a/test-vine-task-throughput.py +++ b/test-vine-task-throughput.py @@ -2,15 +2,22 @@ import ndcctools.taskvine as vine import time +import sys -if __name__ == "__main__": +def func(): + return + +def main(): q = vine.Manager() + print("Creating Library from functions...") + function_lib = q.create_library_from_functions('test-library', func, add_env=False) + q.install_library(function_lib) + print("listening on port", q.port) factory = vine.Factory("local",manager_host_port="localhost:{}".format(q.port)) factory.max_workers=1 factory.min_workers=1 - factory.disk = 100 num_tasks = 1000 @@ -29,11 +36,61 @@ start = time.time() start_timer = False - end = time.time() - e = end-start - print(f"It took {e} seconds\n") - print(f"Throughput was {num_tasks/e} tasks per second") - print("all tasks complete!") + end = time.time() + many = end - start + + start = time.time() + for i in range(num_tasks): + while not q.empty(): + result = q.wait(5) + t = vine.Task(command=":") + task_id = q.submit(t) + + print("waiting for tasks to complete...") + end = time.time() + one = end - start + throughput = num_tasks/many + chaining = num_tasks/one + #serverless tasks + for i in range (num_tasks): + t = vine.FunctionCall('test-library', 'func') + task_id = q.submit(t) + + print("Waiting for tasks to complete...") + start_timer = True + while not q.empty(): + t = q.wait(5) + if start_timer: + start = time.time() + start_timer = False + end = time.time() + serverless_many = end - start + + start = time.time() + for i in range(num_tasks): + while not q.empty(): + result = q.wait(5) + t = vine.FunctionCall('test-library', 'func') + task_id = q.submit(t) + end = time.time() + serverless_one = end-start + serverless_throughput = num_tasks/serverless_many + serverless_chaining = num_tasks/serverless_one + + + print(f"\nThroughput was {throughput} tasks per second") + print(f"Chaining was {chaining} tasks per second") + print(f"\nServerless Throughput was {serverless_throughput} tasks per second") + print(f"Serverless Chaining was {serverless_chaining} tasks per second") + print("all tasks complete!") + assert throughput >= 570, "Throughput in python api is less than required 190" + assert chaining >= 510, "Throughput for chaining in python api is less than required 155" + assert serverless_throughput >= 220, "Throughput using serverless is less than required 190" + assert serverless_chaining >= 200, "Throughput for chaining using serverless is less than required 155" + +if __name__ == '__main__': + main() + # vim: set sts=4 sw=4 ts=4 expandtab ft=python: diff --git a/test-vine-task-throughput.sh b/test-vine-task-throughput.sh index f26cc10..cf0f576 100755 --- a/test-vine-task-throughput.sh +++ b/test-vine-task-throughput.sh @@ -6,5 +6,5 @@ # Install conda development environment . ./install-github.sh -# Run the serverless test case. -python3 test-vine-task-throughput.py +# Run the test case. +python test-vine-task-throughput.py \ No newline at end of file