user2489033
user2489033

Reputation: 1

Print Before MPI_init

I am printing one statement before MPI_INIT. But it's not printing the message.

MPI.c

int x=25;
double T1;
print(" hello");
MPI_Init (&argc, &argv);  /* starts MPI */
MPI_Comm_rank (MPI_COMM_WORLD, &rank);  /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size)

It's not printing any message

Upvotes: 0

Views: 300

Answers (1)

nullptr
nullptr

Reputation: 11058

That's probably because it's buffered. Try adding \n: print(" hello\n");. Or better flush the output buffer: fflush(stdout);.

MPI_Init affects MPI calls only. It does nothing with printf.

Upvotes: 1

Related Questions