Question: Use open MPI library to parallelize the following C code: #include #include #include /* Fonction calculant le second membre des equations du mvt ici d2u/dt2
Use open MPI library to parallelize the following C code:
#include int N,Nt,i,it; double E,b,h,S,I,rho,dt,F,cm = 0.; double *u,*v,*SM,dx; double du,d2u,d3u,d4u,NL; FILE* fres = fopen("def.dat","w"); FILE* finit = fopen("def_init.dat","w"); FILE* fparam = fopen("param.dat","r+"); // donnees du pb fscanf(fparam,"%d",&N);// initialisation des donnes fscanf(fparam,"%d",&Nt); printf("%d %d ",N,Nt); dx = 1.0/(double) N; E = 1.0e9; rho = 1.0e3; b = 0.02; h = 0.02; S = b*h; I = b*h*h*h/12.0; F = -1000.0; dt = 1.0e-10; // allocation memoire u = malloc(N*sizeof(double)); v = malloc(N*sizeof(double)); SM= malloc(N*sizeof(double)); // initialisation for(i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
