Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve on diagonal matrix: Segmentation fault #67

Open
VikingScientist opened this issue Sep 11, 2016 · 0 comments
Open

Solve on diagonal matrix: Segmentation fault #67

VikingScientist opened this issue Sep 11, 2016 · 0 comments

Comments

@VikingScientist
Copy link
Contributor

C++ code

#include "graph.h"
#include "program.h"

using namespace simit;
using namespace std;

int main(int argc, char **argv) {
    init("cpu", sizeof(double));
    Set verts;

    ElementRef pt;
    for(int j=0; j<30; j++)
        pt = verts.add();

    Program program;
    program.loadFile("min.sim");
    Function func = program.compile("main");
    func.bind("verts", &verts);

    func.runSafe();

} 

with the file min.sim as the following

element Vertex
end

extern verts : set{Vertex};

func assemble(v : Vertex) -> (K : matrix[verts,verts](float),
                              b : vector[verts](float))
    K(v,v) = 1.0;
    b(v)   = 1.0;
end

export func main()
    K,b = map assemble to verts reduce +;
    u = K \ b;
end

Results in segmentation fault. Here is the full backtrace:

#0  0x00007ffff69058b2 in simit::ir::TensorIndex::getKind (this=0x64e988) at .../simit/src/tensor_index.cpp:47
#1  0x00007ffff69336e6 in simit::ir::TensorStorage::getTensorIndex (this=0x7fffffffca00) at .../simit/src/storage.cpp:56
#2  0x00007ffff6abc980 in simit::backend::LLVMBackend::emitArgument (this=0x649b70, argument=..., excludeStaticTypes=true)
    at .../simit/src/backend/llvm/llvm_backend.cpp:704
#3  0x00007ffff6abcf19 in simit::backend::LLVMBackend::emitArguments (this=0x649b70, arguments=std::vector of length 3, capacity 3 = {...}, 
    excludeStaticTypes=true) at .../simit/src/backend/llvm/llvm_backend.cpp:756
#4  0x00007ffff6abe6a5 in simit::backend::LLVMBackend::emitIntrinsicCall (this=0x649b70, callStmt=...)
    at .../simit/src/backend/llvm/llvm_backend.cpp:905
#5  0x00007ffff6ac06fa in simit::backend::LLVMBackend::compile (this=0x649b70, callStmt=...)
    at .../simit/src/backend/llvm/llvm_backend.cpp:1035
#6  0x00007ffff6ad3ce8 in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x658d60)
    at .../simit/src/backend/backend_visitor.h:144
#7  0x00007ffff68ea20a in simit::ir::CallStmt::accept (this=0x658d60, v=0x649b78) at .../simit/src/ir.h:356
#8  0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x656900, v=0x649b78) at .../simit/src/ir.h:107
#9  0x00007ffff6a9a6a7 in simit::backend::BackendVisitorBase::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.cpp:37
#10 0x00007ffff6ad43b3 in simit::backend::BackendVisitor<llvm::Value*>::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.h:111
#11 0x00007ffff6ad3eaa in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x6568f0)
    at .../simit/src/backend/backend_visitor.h:153
#12 0x00007ffff68ea368 in simit::ir::Block::accept (this=0x6568f0, v=0x649b78) at .../simit/src/ir.h:444
#13 0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x656a00, v=0x649b78) at .../simit/src/ir.h:107
#14 0x00007ffff6a9a6a7 in simit::backend::BackendVisitorBase::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.cpp:37
#15 0x00007ffff6ad43b3 in simit::backend::BackendVisitor<llvm::Value*>::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.h:111
#16 0x00007ffff6ad3eaa in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x6569f0)
    at .../simit/src/backend/backend_visitor.h:153
#17 0x00007ffff68ea368 in simit::ir::Block::accept (this=0x6569f0, v=0x649b78) at .../simit/src/ir.h:444
#18 0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x656600, v=0x649b78) at .../simit/src/ir.h:107
#19 0x00007ffff6a9a6d2 in simit::backend::BackendVisitorBase::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.cpp:39
#20 0x00007ffff6ad43b3 in simit::backend::BackendVisitor<llvm::Value*>::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.h:111
#21 0x00007ffff6ad3eaa in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x6565e0)
---Type <return> to continue, or q <return> to quit---
    at .../simit/src/backend/backend_visitor.h:153
#22 0x00007ffff68ea368 in simit::ir::Block::accept (this=0x6565e0, v=0x649b78) at .../simit/src/ir.h:444
#23 0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x652780, v=0x649b78) at .../simit/src/ir.h:107
#24 0x00007ffff6a9a519 in simit::backend::BackendVisitorBase::accept (this=0x649b78, stmt=...)
    at .../simit/src/backend/backend_visitor.cpp:18
#25 0x00007ffff6ac90fd in simit::backend::BackendVisitorExprHelper<llvm::Value*>::compile (this=0x649b78, stmt=...)
    at .../simit/src/backend/backend_visitor.h:42
#26 0x00007ffff6ac1995 in simit::backend::LLVMBackend::compile (this=0x649b70, scope=...)
    at .../simit/src/backend/llvm/llvm_backend.cpp:1143
#27 0x00007ffff6ad3d7e in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x652770)
    at .../simit/src/backend/backend_visitor.h:147
#28 0x00007ffff68ea23c in simit::ir::Scope::accept (this=0x652770, v=0x649b78) at .../simit/src/ir.h:362
#29 0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x658440, v=0x649b78) at .../simit/src/ir.h:107
#30 0x00007ffff6a9a6d2 in simit::backend::BackendVisitorBase::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.cpp:39
#31 0x00007ffff6ad43b3 in simit::backend::BackendVisitor<llvm::Value*>::compile (this=0x649b78, op=...)
    at .../simit/src/backend/backend_visitor.h:111
#32 0x00007ffff6ad3eaa in simit::backend::BackendVisitor<llvm::Value*>::visit (this=0x649b78, op=0x658420)
    at .../simit/src/backend/backend_visitor.h:153
#33 0x00007ffff68ea368 in simit::ir::Block::accept (this=0x658420, v=0x649b78) at .../simit/src/ir.h:444
#34 0x00007ffff690b681 in simit::ir::Stmt::accept (this=0x7fffffffda00, v=0x649b78) at .../simit/src/ir.h:107
#35 0x00007ffff6a9a519 in simit::backend::BackendVisitorBase::accept (this=0x649b78, stmt=...)
    at .../simit/src/backend/backend_visitor.cpp:18
#36 0x00007ffff6ac90fd in simit::backend::BackendVisitorExprHelper<llvm::Value*>::compile (this=0x649b78, stmt=...)
    at .../simit/src/backend/backend_visitor.h:42
#37 0x00007ffff6ab65f4 in simit::backend::LLVMBackend::compile (this=0x649b70, func=..., storage=...)
    at .../simit/src/backend/llvm/llvm_backend.cpp:161
#38 0x00007ffff6a912cc in simit::backend::Backend::compile (this=0x63d6d0, func=..., storage=...) at .../simit/src/backend/backend.cpp:48
#39 0x00007ffff69224fe in simit::compile (func=..., backend=0x63d6d0, addTimers=false) at .../simit/src/program.cpp:36
#40 0x00007ffff69225a7 in simit::compile (func=..., backend=0x63d6d0) at .../simit/src/program.cpp:40
#41 0x00007ffff6922ffd in simit::Program::compile (this=0x7fffffffdc30, function="main") at .../simit/src/program.cpp:104
#42 0x000000000040c34e in main (argc=1, argv=0x7fffffffde78) at .../simit-fem/min.cpp:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant