mojo icon indicating copy to clipboard operation
mojo copied to clipboard

Parallelizing loops with InlinedFixedVector

Open Sukii opened this issue 11 months ago • 1 comments

Bug description

I have a mojo code that I am trying to run in parallel with 10 CPU cores (12th Gen Intel® Core™ i5-1235U × 12) on Ubuntu 22.04.4 LTS. I get this error message:

/home/skv/github/vortex_simulations/free2d/parallel_nvortices.mojo:33:12: error: unexpected token in expression
@parameter(inout vors: InlinedFixedVector[Vortex,NUM_VORTICES])
           ^
mojo: /__w/modular/modular/KGEN/lib/MojoParser/DeclResolution.cpp:801: mlir::LogicalResult M::KGEN::LIT::DeclResolver::resolveSignature(LIT::FuncOp, M::KGEN::LIT::Lexer &, M::KGEN::LIT::ASTDecl &): Assertion `p.getToken().isAny(Token::kw_async, Token::kw_def, Token::kw_fn) && "not a function definition?"' failed.
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.	Program arguments: mojo parallel_nvortices.mojo
1.	Crash resolving decl signature at loc("/home/skv/github/vortex_simulations/free2d/parallel_nvortices.mojo":34:1)
    >> fn advance(inout vors: InlinedFixedVector[Vortex,NUM_VORTICES], dt: Float16):
       ^                                                                            
[3841:3842:20240320,142020.083770:ERROR directory_reader_posix.cc:42] opendir /home/skv/.modular/crashdb/attachments/f0a5943f-dfbf-4de6-9548-9bc056e6e869: No such file or directory (2)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo      0x00005dbb0df92337
1  mojo      0x00005dbb0df8ff0e
2  mojo      0x00005dbb0df92a0f
3  libc.so.6 0x000079b122042520
4  libc.so.6 0x000079b1220969fc pthread_kill + 300
5  libc.so.6 0x000079b122042476 raise + 22
6  libc.so.6 0x000079b1220287f3 abort + 211
7  libc.so.6 0x000079b12202871b
8  libc.so.6 0x000079b122039e96
9  mojo      0x00005dbb0e4033ff
10 mojo      0x00005dbb0e41c4e3
11 mojo      0x00005dbb0e41d2c8
12 mojo      0x00005dbb0e3c4614
13 mojo      0x00005dbb0e3c4980
14 mojo      0x00005dbb0df5ab1f
15 mojo      0x00005dbb0df47f1b
16 mojo      0x00005dbb0df59f60
17 mojo      0x00005dbb0df416c2
18 libc.so.6 0x000079b122029d90
19 libc.so.6 0x000079b122029e40 __libc_start_main + 128
20 mojo      0x00005dbb0df40c9e
Aborted (core dumped)

Steps to reproduce

System information

- 12th Gen Intel® Core™ i5-1235U × 12 on Ubuntu 22.04.4 LTS. 
- `mojo -v`: `mojo 0.7.0 (af002202)`

- `modular -v`: `modular 0.5.2 (6b3a04fd)`

Sukii avatar Mar 20 '24 16:03 Sukii