I am trying to enable opeMP in visual studio code. I could not find a guide to do this. Any help?
I am trying to run a code that looks like this:
//TIME LOOP:
for (int nt = 0; nt < time_steps; nt++){
#pragma omp parallel for
//PARTICLE LOOP:
for (int particle = 0; particle < number_of_particles; particle++){
double E[3];
double B[3];
double x[3];
double v[3];
fill_vector(X,x,particle);
fill_vector(V,v,particle);
get_fields(E, B, x);
Boris(x, v, E, B);
update_matrix(X,x,particle);
update_matrix(V,v,particle);
fprintf(fout1,"%d, %g, %g, %g, %g, %g, %g, %g\n",particle,nt*dt,x[0],x[1],x[2],v[0],v[1],v[2]);
}
}
fclose(fout1);
double time2 = WTime();
printf("TIME = %g\n",time2-time1);
return 0;