Подробнее
I33£3§S$3Sf$S$§§g8§££S£&§3 •■■:: ■ 1 s ••1!. •••: :•: '..'i •-.;v •:.'S 429 430 431 432 433 434 435 436 437 438 439 440 441 if (rank - 0) { st*rt_ti*e = MPl_wt !•*(); printf("Evaluation starts. Processors count • Xd split into Xd x Xd\n"# proc_nun ) c0l<ulatc_descent_er0dicfit(nx_count, ny_count, x_r>odes, y „nodes, result_grid, prcv_gi swap.-gfids(4resultj&rid, &prev_grid); iteration_count - nonline*r_coo3ug0te_£radient(nx_count, ny_coont, x_nodes, y_nodcs, sv*ap„gr id s (Sresu 11 id, &prev .grid); err ^ 0; <jtrr - error (nx„count, ny„count, x.nodes, y„oodes, result_grid); HPIjUlreduce(&c_err, Serr, 1, MPI_00U61E, HPIJWC, Grid_Co«n); if (rank — 0) { PILE mi - NULL; end„tine * PPI_Wti«e(); printf("The Xd iteration of COM netbod has been carried out.\n", iteratioo_count printf(*Tbc error of iterations is estinated by X.lif.\n", err); printf("Tine spent: Xf secoods\n", end_tine - start_ti»e); if (proc^nun *• 1) { f • fopen(*result.out", "w"); for (int i • 0; i < nx_count; i^) { for (int j - 0; j < ny„coont; }♦♦) fprintf(f, "Xf Xf Xf\n", x nodes(i], y„nodes{j), result„grid(i • ny i fprintf(f, "\n"); > ExchangeWithNeighbours(NX cou , rJY count, g); Nabla_H(?JX_count, NY_count# x_nodes, y„nodes, g, nabla); nominator = 0; c„nominator ■ dot(NX_count, NY„count, x_nodes, y_nodes, 6 MPI_Allreduce(&c_nominator, ^nominator, 1, MPI_D0U8LE, MP denominator = 0; c_denominator * dot(NX_count, NY„count# x_nodes, y_nodes, MPI_Allreduce(8c_denominator, &denominator, 1, MPI_OOUBLE tau ■ nominator / denominator; - »ifdef USE.OPENMP »pragma omp parallel for »endif for (int i = 0; i < NX count; i++) { for (int j ■ 0; j < NY_count; }♦♦) { int idx ■ i ■ NY„count ♦ j; res_grid[idx] = prev_grid(idx] - tau • g[idx]; ) ) ExchangeWithNeighbours(NX_count, NY_coont, res_grid); c_norm ■ norm(NX_count, NY„count, x_nodes, y_nodes, res g MPI_Allreducc(8c_norffl, &total_norm, 1, MPI_D0U8lE, MPI.MA
it-юмор,geek,Прикольные гаджеты. Научный, инженерный и айтишный юмор,ide,цветовая тема,удалённое
Еще на тему