Comments (2)
Looks like its caused by parallelization of python import. Minimal repro:
from python import Python
from algorithm import parallelize
fn do_something_python(text: String) raises -> PythonObject:
var uuid = Python.import_module('uuid')
return text + '\t' + str(uuid.uuid4())
fn main() raises:
var texts = DynamicVector[String]()
texts.append("Hello, World!")
texts.append("This is a test.")
texts.append("Hello, World!")
texts.append("This is a test.")
texts.append("Hello, World!")
texts.append("This is a test.")
texts.append("Hello, World!")
texts.append("This is a test.")
texts.append("Hello, World!")
texts.append("This is a test.")
# works just right
# for i in range(len(texts)):
# print(do_something_python(texts[i]))
@parameter
fn _do(i: Int):
try:
print(do_something_python(texts[i]))
except:
print('Error')
# parallelize[_do](1) # returns only UUID4, but not text... why?
parallelize[_do](len(texts))
p.s. IDK why, but paralellize[_do](1)
outputs something, that only Scooby Doo team is able to investigate
from mojo.
By the way, ffi.DLHandle
-> get_function
also doesn't work, resulting the same error
from mojo.
Related Issues (20)
- [BUG] Mojo destroys value too eagerly HOT 2
- [stdlib] Move `SIMD._dynamic_shuffle` closer to utf-8 validation use HOT 4
- [stdlib] Make `InlineFixedVector` work on `CollectionElement` HOT 3
- [BUG] Program with input() crashes when run directly by mojo CLI HOT 1
- [BUG] Return values are correct, but REPL reports incorrect HOT 2
- [BUG] LLVM ERROR: Failed to infer result type(s).
- [BUG] RPL gets chars from a String pointer correctly, Mojo file does it wrong HOT 1
- [BUG] parallelize won't work with local variables (they turn to uninitialized) HOT 2
- [Docs] Recommend using `a.ctypes.data` over `a.__array_interface__['data'][0]` for accessing NumPy array pointers
- [Docs] Document how to use the VScode debugger when running the stdlib tests HOT 1
- [BUG] Can't return a mutable reference HOT 2
- [Modular CLI] Crash after `magic shell` and hitting the `Run Mojo File` btn in vscode
- [BUG][LSP] Unicode breaks LSP
- [BUG] `PythonObject` doesn't handle large `UInt64` correctly
- [BUG] The field storing the number of items in a List or Dict should be named "length", not "size" HOT 7
- [Feature Request] Rename the `Sized` trait (perhaps to `Countable`) HOT 2
- [BUG] LLVM ERROR: out of memory
- [BUG] mojo build failed because ld cannot find -lz -ltinfo
- [BUG] Unable to use formatter in Mojo Playground
- [Feature Request] [stdlib] A Foreign Function Interfacing exclusive package (`ffi`)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mojo.