Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. # include <stdlib.h>
  2. # include <stdio.h>
  3. # include <math.h>
  4.  
  5. # include "mpi.h"
  6.  
  7. int main ( int argc, char *argv[] );
  8. void heat_part ( int n, int p, int id, double x_min, double x_max );
  9.  
  10. /******************************************************************************/
  11.  
  12. int main ( int argc, char *argv[] )
  13. {
  14. double a = 0.0; // lewy brzeg przedzialu
  15. double b = 1.0; // prawy brzeg przedzialu
  16. int i;
  17. int id; // rank
  18. int n; // liczba punktow dla kazdego wezla
  19. int p; // size
  20. double x_max;
  21. double x_min;
  22.  
  23. MPI_Init ( &argc, &argv );
  24. MPI_Comm comm;
  25. MPI_Status status;
  26. int nt;
  27. printf("Podaj liczbe watkow: \n");
  28. scanf("%d",&nt);
  29.  
  30. MPI_Comm_spawn("heat", MPI_ARGV_NULL, nt,
  31. MPI_INFO_NULL, 0, MPI_COMM_SELF,
  32. &comm, MPI_ERRCODES_IGNORE);
  33.  
  34. int size = 14;
  35. double tab[size];
  36.  
  37. MPI_Finalize ( );
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement