Sorry; traveling and didn't see the whole thread.
This might be the struct alignment bug I tracked down a few months ago? (Alignment attribute in the wrong place.)
On Tuesday, July 26, 2016, Andreas Noack <andreasnoackjensen@gmail.com> wrote:On my El Capitan macbook I get a segfault when running the program below with more than a single process but only when MPICH has been compiled with Clang.I don't get that good debug info but here is some of what I got(lldb) cProcess 61129 resumingProcess 61129 stopped* thread #1: tid = 0x32c438, 0x00000003119d0432 libpmpi.12.dylib`MPID_Request_create + 244, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)frame #0: 0x00000003119d0432 libpmpi.12.dylib`MPID_Request_create + 244libpmpi.12.dylib`MPID_Request_create:-> 0x3119d0432 <+244>: movaps %xmm0, 0x230(%rax)0x3119d0439 <+251>: movq $0x0, 0x240(%rax)0x3119d0444 <+262>: movl %ecx, 0x210(%rax)0x3119d044a <+268>: popq %rbpMy version of Clang isApple LLVM version 7.3.0 (clang-703.0.31)Target: x86_64-apple-darwin15.6.0Thread model: posixInstalledDir: /Library/Developer/CommandLineTools/usr/binand the bug has been confirmed by my colleague who is running Linux and compiling with Clang 3.8. The program runs fine with OpenMPI+Clang.#include <mpi.h>#include <stdio.h>#include <stdlib.h>int main(int argc, char *argv[]){MPI_Init(&argc, &argv);MPI_Comm comm = MPI_COMM_WORLD;uint64_t *A, *C;int rnk;MPI_Comm_rank(comm, &rnk);A = calloc(1, sizeof(uint64_t));C = calloc(2, sizeof(uint64_t));A[0] = rnk + 1;MPI_Allgather(A, 1, MPI_UINT64_T, C, 1, MPI_UINT64_T, comm);MPI_Finalize();return 0;}
Best regardsAndreas NoackPostdoctoral AssociateComputer Science and Artificial Intelligence LaboratoryMassachusetts Institute of Technology