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

MPI.Init failing with panic #3

Open
rossmeier opened this issue Jun 5, 2016 · 1 comment
Open

MPI.Init failing with panic #3

rossmeier opened this issue Jun 5, 2016 · 1 comment

Comments

@rossmeier
Copy link

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
panic(0x4f0780, 0xc82000a360)
/usr/lib/go/src/runtime/panic.go:481 +0x3e6
github.com/JohannWeging/go-mpi.Init(0x7a4560, 0x0)
.../src/github.com/JohannWeging/go-mpi/init.go:41 +0x2c1
main.main()
.../main.go:16 +0x111

Go 1.6.2 on 64 bit machine with openmpi
err := C.MPI_Init(&c_argc, (***C.char)(unsafe.Pointer(&c_argv)))
I'm not familliar with that api, but probably you want to have a **C.char and therefore leave the & before the c_argv

@kinnarr
Copy link

kinnarr commented Jan 2, 2017

Go 1.6 changes the rules for go pointers in c code. You can disable the check with the environment variable GODEBUG=cgocheck=0

See https://golang.org/doc/go1.6#cgo for details

renyuneyun added a commit to renyuneyun/go-mpi that referenced this issue Mar 1, 2017
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

2 participants