In MPI for multiple process scanf taking input only once
15 Sep
2013
15 Sep
'13
4:48 a.m.
I am trying to write MPI code with scanf which will take input for all process individually, but only one process taking the input from user and others assign garbage value to that variable. The program is as below #include <stdlib.h>#include <stdio.h>#include "mpi.h"#include<string.h> int main(int argc, char* argv[]) {int i, size, rank;int arr; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); printf("Enter the number\n"); scanf("%d",&i); printf("%d\n",i); MPI_Finalize(); exit(0);} -- Regards, -- Mahesh Doijade
4693
Age (days ago)
4693
Last active (days ago)
0 comments
1 participants
participants (1)
-
Mahesh Doijade