[mpich-discuss] (no subject)

Chafik sanaa san.chafik at gmail.com
Sat Mar 7 05:56:18 CST 2015


when I execute my program nothing appears, it must  use a parallelism even
for reading our text file !?
this is my code:
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
#define MAX_LIGNE 40
#define MAX_COL    40
#define Matrice_adjacence "fichier22.txt"
#define Matrice_General "fichier111.txt"
typedef int Matrice[MAX_LIGNE][MAX_COL];
int main(int argc, char** argv)
{
int nbr_proc, rang_proc;
Matrice  E;
int  m1, n1;
FILE * aLire = fopen(Matrice_General, "r");
if (aLire == NULL)
{
printf("No file");
}
else
{
fscanf(aLire, "%d%d", &n1, &m1);
for (int i = 0; i < n1; i++) {
for (int j = 0; j < m1; j++)
fscanf(aLire, "%d", &E[i][j]);
fscanf(aLire, "\n");
}
}
fclose(aLire);
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rang_proc);
MPI_Comm_size(MPI_COMM_WORLD, &nbr_proc);

printf("Hi from proc %d ", rang_proc);

MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20150307/87bac15f/attachment.html>
-------------- next part --------------
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list