[mpich-discuss] (no subject)

Huiwei Lu huiweilu at mcs.anl.gov
Sat Mar 7 23:02:21 CST 2015


Please use this mailing list for discussion MPICH related questions only.
If you have general parallel computing questions, please ask it on stack
overflow or other generic discussion Forums.

--
Huiwei Lu

On Sat, Mar 7, 2015 at 5:56 AM, Chafik sanaa <san.chafik at gmail.com> wrote:

> 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();
> }
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20150307/ded9ec58/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