-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor updates to tests, updating docs for exceptions.
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,9 @@ | |
*.pyc | ||
build/* | ||
dist/* | ||
parsl.egg-info/* | ||
parsl.egg-info/* | ||
.scripts | ||
.*out | ||
.*err | ||
*log | ||
.ipynb_checkpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |