-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
140 additions
and
29 deletions.
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
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
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,47 @@ | ||
import os | ||
import seamless | ||
|
||
if "DELEGATE" in os.environ: | ||
seamless.config.delegate() | ||
else: | ||
seamless.config.delegate(level=3) | ||
from seamless.core.transformation import get_global_info | ||
get_global_info() # avoid timing errors | ||
|
||
from seamless.highlevel import Context | ||
|
||
def func(a,b,c): | ||
import time | ||
time.sleep(3) | ||
return (a+b) * c | ||
|
||
ctx = Context() | ||
ctx.tf = func | ||
tf = ctx.tf | ||
tf.a = 2 | ||
tf.b = 3 | ||
tf.c = 4 | ||
import time | ||
t = time.time() | ||
ctx.compute() | ||
print("{:.1f} seconds".format(time.time() - t)) | ||
print(tf.result.value) | ||
|
||
tf_checksum = tf.get_transformation_checksum() | ||
print("Transformation:", tf_checksum) | ||
result_checksum = tf.result.checksum | ||
print("Result:", result_checksum) | ||
|
||
error_msg = tf.contest() | ||
print("Error:", error_msg) | ||
print() | ||
|
||
ctx.translate(force=True) # delete tf.result.checksum | ||
t = time.time() | ||
ctx.compute() | ||
print("{:.1f} seconds".format(time.time() - t)) | ||
print(tf.result.value) | ||
|
||
error_msg = tf.contest() | ||
print("Error:", error_msg) | ||
print() |
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,13 @@ | ||
Waiting for: Seamless transformer: .tf.tf | ||
3.1 seconds | ||
<Silk: 20 > | ||
Transformation: ce7f2f2038e94912b7f84ecdcd25284868a7bf017a57eb6decc4feac6b6c6521 | ||
Result: 8e843baef228089dc379d4c3b6e28c1bb5d44eee257f1206b5dfee44ef6b05ad | ||
RES 8e843baef228089dc379d4c3b6e28c1bb5d44eee257f1206b5dfee44ef6b05ad | ||
Error: None | ||
|
||
1.0 seconds | ||
<Silk: 20 > | ||
RES 8e843baef228089dc379d4c3b6e28c1bb5d44eee257f1206b5dfee44ef6b05ad | ||
Error: None | ||
|