Created
December 2, 2019 21:46
-
-
Save yadudoc/690145693f4984edf43c8041652028f9 to your computer and use it in GitHub Desktop.
Cause a worker failure due to MemoryView serializability issue.
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
import parsl | |
from parsl.providers import LocalProvider | |
from parsl.channels import LocalChannel | |
from parsl.config import Config | |
from parsl.executors import HighThroughputExecutor | |
config = Config( | |
executors=[ | |
HighThroughputExecutor( | |
label="htex_local", | |
max_workers=1, | |
provider=LocalProvider( | |
channel=LocalChannel(), | |
init_blocks=1, | |
max_blocks=1, | |
), | |
) | |
], | |
retries=1 | |
) | |
from parsl import python_app | |
import numpy as np | |
@python_app | |
def pickled_compute_descript(smile, size=10): | |
import numpy as np | |
import pickle | |
x = np.array(list(range(0, size)), dtype=complex).astype(np.float32) | |
return pickle.dumps(x) | |
@python_app | |
def compute_descript(smile, size=10): | |
import numpy as np | |
import pickle | |
x = np.array(list(range(0, size)), dtype=complex).astype(np.float32) | |
return x | |
if __name__ == "__main__": | |
parsl.load(config) | |
smile = "CCCS(=O)c1ccc2[nH]c(=NC(=O)OC)[nH]c2c1" | |
for i in [10, 100, 1000, 10000]: | |
x = pickled_compute_descript(smile, size=i) | |
print(x.result()) | |
for i in [10, 100, 1000, 10000]: | |
x = compute_descript(smile, size=i) | |
print(x.result()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment