I tried running your code below on a workstation with an Ubuntu 22.04.2 OS on 4 processes. I’m using openmpi-5.0.8. I get the error that MPI_Finalize() function was called after MPI_FINALIZE invoked.
MPI was configured with configure --enable-oshmem --with-ucx=/my/local/UCX/install --prefix=/my/local/MPI/install Bruce From: Tomislav Janjusic US <[email protected]> Date: Thursday, December 4, 2025 at 11:38 AM To: Open MPI users <[email protected]> Cc: Palmer, Bruce J <[email protected]> Subject: Re: [EXTERNAL] [OMPI users] shmem_finalize Hey Bruce, Do you have a minimal reproducer? We tried with: int main(int argc, char *argv[]) { MPI_Init(NULL, NULL); shmem_init(); shmem_finalize(); MPI_Finalize(); return 0; } And cannot reproduce though we do some issues if we reorder inits. On Wednesday, December 3, 2025 at 3:02:09 PM UTC-6 Palmer, Bruce J wrote: It appears to complain about a call to MPI_Comm_free that is called after MPI_Finalize. I assume this is occurring because there is a call to MPI_Comm_free (or its internal equivalent) inside MPI_Finalize and this is triggered because our code has a call to shmem_finalize that is followed by a call to MPI_Finalize. My understanding is that should be allowed. Bruce From: 'Pritchard Jr., Howard' via Open MPI users <[email protected]> Date: Wednesday, December 3, 2025 at 11:11 AM To: [email protected] <[email protected]> Subject: Re: [EXTERNAL] [OMPI users] shmem_finalize Check twice before you click! This email originated from outside PNNL. HI Bruce, Could you describe more what the crash is? Does the application emit some sort of error message or is there a segmentation fault and maybe traceback? Also which version of Open MPI/OSHMEM are you using? Howard From: "'Palmer, Bruce J' via Open MPI users" <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Tuesday, December 2, 2025 at 2:54 PM To: Open MPI Users <[email protected]> Subject: [EXTERNAL] [OMPI users] shmem_finalize Hi, Not sure if this is the right place for this inquiry, but I’ve got a question about the implementation of OpenSHMEM that is distributed with OpenMPI. As far as I can tell from the OpenSHMEM documentation, MPI_Finalize() and shmem_finalize are relatively independent and it should be possible to call shmem_finalize followed by MPI_Finalize without incurring an error. However, it looks like the shmem_finalize implementation is calling omni_mpi_finalize and this causes MPI_Finalize to crash. I can fix this easily in my application, but it seems like I shouldn’t have to. Bruce To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
