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

"--stdin" doesn't work correctly for non-zero #12777

Closed
Klaaktu opened this issue Aug 24, 2024 · 0 comments · Fixed by openpmix/prrte#2038
Closed

"--stdin" doesn't work correctly for non-zero #12777

Klaaktu opened this issue Aug 24, 2024 · 0 comments · Fixed by openpmix/prrte#2038

Comments

@Klaaktu
Copy link

Klaaktu commented Aug 24, 2024

Thank you for taking the time to submit an issue!

Background information

What version of Open MPI are you using?

v5.0.2 (Fedora 40), v5.0.5 (Arch)

Describe how Open MPI was installed

From distribution: Fedora, Arch.

If you are building/installing from a git clone, please copy-n-paste the output from git submodule status.

Please describe the system on which you are running

  • Operating system/version: Fedora 40, Arch (in QEMU)
  • Computer hardware: x86_64
  • Network type: Wi-Fi

Details of the problem

When --stdin is changed to any process other than 0, the process reading from stdin will be stuck waiting even though an input is provided.
Here is a minimal example:

#include <mpi.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
    MPI_Init(&argc, &argv);
    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    if (rank == 1)
    {
        printf("rank %d\n", rank);
        getchar();
    }
    MPI_Finalize();
    return 0;
}
$ mpicc -Wall -pedantic -o test test.c
$ mpirun -n 2 --stdin 1 ./test
rank 1
a
b

^C

Debugging shows that the process is stuck on getchar().

p.s. Does not happen on 4.1.6 (Ubuntu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants