Skip to content

Commit 05fc0fa

Browse files
authored
Merge pull request #27 from cooperative-computing-lab/fix_thr
Fix throughput tests
2 parents 8d083d3 + 5f9ddcd commit 05fc0fa

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

install-tarball.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Install a binary from the tarball distribution into $PREFIX
22

33
# Get the common install setup
4-
.install-common.sh
4+
. ./install-common.sh
55

66
# Choose the Ubuntu distribution
7-
TARBALL="cctools-nightly-x86_64-ubuntu20.04.tar.gz"
7+
TARBALL="cctools--x86_64-ubuntu24.04.tar.gz"
88
PREFIX=`pwd`/cctools-install
99

1010
# Fetch the tarball
11-
wget --quiet "https://github.com/cooperative-computing-lab/cctools/releases/download/nightly/${TARBALL}"
11+
wget --quiet "https://github.com/cooperative-computing-lab/cctools/releases/download/devel/${TARBALL}"
1212

1313
# Unpack into prefix
1414
mkdir -p ${PREFIX}

test-parrot-cvmfs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ then
1515
echo "Could not access CVMFS!"
1616
exit 1
1717
fi
18-
echo
19-
echo "CVMFS driver is not enabled in Parrto!"
20-
exit 1
18+
else
19+
echo "CVMFS driver is not enabled in Parrot for ubuntu!"
20+
exit 0
2121
fi
2222
else
2323
echo "Parrot could not run /bin/true!"

test-vine-task-throughput.py

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,29 @@
22

33
import ndcctools.taskvine as vine
44
import time
5-
import sys
5+
66

77
def func():
8-
return
8+
return
9+
910

1011
def main():
1112

1213
q = vine.Manager()
1314
print("Creating Library from functions...")
14-
function_lib = q.create_library_from_functions('test-library', func, add_env=False)
15+
function_lib = q.create_library_from_functions("test-library", func, add_env=False)
1516
q.install_library(function_lib)
1617

1718
print("listening on port", q.port)
18-
factory = vine.Factory("local",manager_host_port="localhost:{}".format(q.port))
19-
factory.max_workers=1
20-
factory.min_workers=1
19+
factory = vine.Factory("local", manager_host_port="localhost:{}".format(q.port))
20+
factory.max_workers = 1
21+
factory.min_workers = 1
22+
factory.cores = 1
23+
factory.memory = 2000
24+
factory.disk = 2000
25+
factory.debug_file = "stderr"
26+
factory.debug = "all"
27+
factory.extra_options = "--transfer-port=9123:9199"
2128

2229
num_tasks = 1000
2330

@@ -27,20 +34,20 @@ def main():
2734
task_id = q.submit(t)
2835

2936
print("waiting for tasks to complete...")
30-
37+
3138
start_timer = True
3239
while not q.empty():
3340

3441
t = q.wait(5)
3542
if start_timer:
3643
start = time.time()
3744
start_timer = False
38-
45+
3946
end = time.time()
4047
many = end - start
4148

4249
start = time.time()
43-
50+
4451
for i in range(num_tasks):
4552
while not q.empty():
4653
result = q.wait(5)
@@ -50,11 +57,11 @@ def main():
5057
print("waiting for tasks to complete...")
5158
end = time.time()
5259
one = end - start
53-
throughput = num_tasks/many
54-
chaining = num_tasks/one
55-
#serverless tasks
56-
for i in range (num_tasks):
57-
t = vine.FunctionCall('test-library', 'func')
60+
throughput = num_tasks / many
61+
chaining = num_tasks / one
62+
# serverless tasks
63+
for i in range(num_tasks):
64+
t = vine.FunctionCall("test-library", "func")
5865
task_id = q.submit(t)
5966

6067
print("Waiting for tasks to complete...")
@@ -70,24 +77,20 @@ def main():
7077
start = time.time()
7178
for i in range(num_tasks):
7279
while not q.empty():
73-
result = q.wait(5)
74-
t = vine.FunctionCall('test-library', 'func')
75-
task_id = q.submit(t)
80+
q.wait(5)
81+
t = vine.FunctionCall("test-library", "func")
82+
q.submit(t)
7683
end = time.time()
77-
serverless_one = end-start
78-
serverless_throughput = num_tasks/serverless_many
79-
serverless_chaining = num_tasks/serverless_one
84+
serverless_one = end - start
85+
serverless_throughput = num_tasks / serverless_many
86+
serverless_chaining = num_tasks / serverless_one
8087

81-
8288
print(f"\nThroughput was {throughput} tasks per second")
8389
print(f"Chaining was {chaining} tasks per second")
8490
print(f"Serverless Throughput was {serverless_throughput} tasks per second")
8591
print(f"Serverless Chaining was {serverless_chaining} tasks per second")
8692
print("all tasks complete!")
8793

8894

89-
if __name__ == '__main__':
95+
if __name__ == "__main__":
9096
main()
91-
92-
# vim: set sts=4 sw=4 ts=4 expandtab ft=python:
93-

0 commit comments

Comments
 (0)