Skip to content

Commit

Permalink
Minor updates to tests, updating docs for exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
yadudoc committed Nov 27, 2017
1 parent 4b5f9d4 commit 36b70fd
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
*.pyc
build/*
dist/*
parsl.egg-info/*
parsl.egg-info/*
.scripts
.*out
.*err
*log
.ipynb_checkpoints
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Parsl is a Python-based parallel scripting library that supports development and
userguide/overview
userguide/apps
userguide/futures
userguide/exceptions
userguide/configuring

.. _dev_docs:
Expand Down
16 changes: 16 additions & 0 deletions parsl/tests/test_ipp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

def setup_package():
import subprocess
import time
proc = subprocess.Popen("ipcluster start -n 4")
time.sleep(2)
print("Started ipcluster with pid:{0}".format(proc))
return proc

def teardown_package():
import subprocess
import time
proc = subprocess.Popen("ipcluster stop")
print("Stopping ipcluster")
time.sleep(2)
return proc
55 changes: 55 additions & 0 deletions parsl/tests/test_ipp/test_python_worker_fail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
''' Testing bash apps
'''
import parsl
from parsl import *

import os
import time
import shutil
import argparse
from nose.tools import nottest

#parsl.set_stream_logger()
workers = IPyParallelExecutor()
dfk = DataFlowKernel(executors=[workers])


@App('python', dfk)
def import_echo(x, string, sleep=0, stdout=None):
import time
time.sleep(sleep)
print(string)
return x*5


def test_parallel_for (n=10):

d = {}
start = time.time()
for i in range(0,n):
d[i] = import_echo(2, "hello", sleep=20)
#time.sleep(0.01)

assert len(d.keys()) == n , "Only {0}/{1} keys in dict".format(len(d.keys()), n)

[d[i].result() for i in d]
print("Duration : {0}s".format(time.time() - start))
print("[TEST STATUS] test_parallel_for [SUCCESS]")
return d


if __name__ == '__main__' :

parser = argparse.ArgumentParser()
parser.add_argument("-c", "--count", default="10", help="Count of apps to launch")
parser.add_argument("-d", "--debug", action='store_true', help="Count of apps to launch")
args = parser.parse_args()

if args.debug:
parsl.set_stream_logger()

x = test_parallel_for()
#x = test_parallel_for(int(args.count))

#x = test_stdout()
#raise_error(0)

0 comments on commit 36b70fd

Please sign in to comment.