亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? nbody_sh1p.c

?? mpi編程
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
                           << " [-d step_size_control_parameter]\n"                           << "         [-e diagnostics_interval]"                           << " [-o output_interval]\n"                           << "         [-t total_duration]"                           << " [-i (start output at t = 0)]\n"                           << "         [-x (extra debugging diagnostics)]"                           << endl;                      return false;         // execution should stop after help            case 'd': dt_param = atof(optarg);                      break;            case 'e': dt_dia = atof(optarg);                      break;            case 'i': i_flag = true;                      break;            case 'o': dt_out = atof(optarg);                      break;            case 't': dt_tot = atof(optarg);                      break;            case 'x': x_flag = true;                      break;            case '?': cerr << "usage: " << argv[0]                           << " [-h (for help)]"                           << " [-d step_size_control_parameter]\n"                           << "         [-e diagnostics_interval]"                           << " [-o output_interval]\n"                           << "         [-t total_duration]"                           << " [-i (start output at t = 0)]\n"                           << "         [-x (extra debugging diagnostics)]"                           << endl;                      return false;        // execution should stop after error            }    return true;                         // ready to continue program execution}/*----------------------------------------------------------------------------- *  get_snapshot  --  reads a single snapshot with the root processor  *                    from the input stream cin. * *  note: in this implementation, particle number, time and the data for *        individual particles are read in. *        All communication goes via the root (0) process. *  note: The routine also declared the MPI_Datatype particletype which is *        the contianer for the particle data. *        This structure is used for further MPI comminication. *----------------------------------------------------------------------------- */Particle *get_snapshot(int &n, real &t,		       MPI_Datatype &particletype){  int rank, size;  MPI_Comm_rank( MPI_COMM_WORLD, &rank );  MPI_Comm_size( MPI_COMM_WORLD, &size );  Particle *p_tmp;  if(rank==root) {    cerr << "Reading snapshot" << endl;    cin >> n;    cin >> t;    p_tmp = new Particle[n];    for(int i=0; i<n; i++) {      p_tmp[i].id = i;      cin >> p_tmp[i].mass;                         // mass of particle i      for (int k = 0; k < NDIM; k++)	cin >> p_tmp[i].pos[k];                 // position of particle i      for (int k = 0; k < NDIM; k++)	cin >> p_tmp[i].vel[k];                 // velocity of particle i    }  }  MPI_Bcast(&n,1,MPI_INT,root,MPI_COMM_WORLD); // broadcasts particle number  int n_local = (int)(floor(1.0*n/size));  if(n != n_local*size && rank==root) {    cerr << "WARNING: Paticle number in input is not a mulitple of the number of processors." 	 << endl;    cerr << "         Action: Reduce particle number to n = " 	 << n_local*size << "." << endl;  }  Particle *p = new Particle[n_local];  // defining the particletype  int inputblockcounts[2] = {1, 13};  MPI_Datatype ntypes[] = {MPI::INT, MPI::DOUBLE};  MPI::Aint displs[2];  MPI_Address(&p[0].id, &displs[0]);  MPI_Address(&p[0].mass, &displs[1]);  displs[1] -= displs[0];        //make them relative  displs[0] = 0;  MPI_Type_struct(2, inputblockcounts, displs, ntypes, &particletype);  MPI_Type_commit(&particletype);  // Distribute the particles over the processors  MPI_Scatter(p_tmp,n_local,particletype,p,n_local,particletype,root,MPI_COMM_WORLD);  n = n_local;  MPI_Bcast(&t,1,MPI_DOUBLE,root,MPI_COMM_WORLD);  delete []p_tmp;  return p;}/*----------------------------------------------------------------------------- *  put_snapshot  --  writes a single snapshot on the output stream cout. * *  note: Communication goes via the root (0) proceesor *----------------------------------------------------------------------------- */void put_snapshot(Particle p[], int n, real t,		  MPI_Datatype particletype){    int rank;    MPI_Comm_rank( MPI_COMM_WORLD, &rank );    int ntot;    MPI_Allreduce(&n, &ntot, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );    Particle *p_all;    if(rank==root) {      p_all = new Particle[ntot];    }    MPI_Gather(p,n,particletype,p_all,n,particletype,root,MPI_COMM_WORLD);    cout.precision(16);                       // full double precision    if(rank==root) {      cout << ntot << endl;                     // N, total particle number      cout << t << endl;                        // current time    for (int i = 0; i < ntot ; i++){      cout << p_all[i].mass;                      // mass of particle i        for (int k = 0; k < NDIM; k++)            cout << ' ' << p_all[i].pos[k];         // position of particle i        for (int k = 0; k < NDIM; k++)            cout << ' ' << p_all[i].vel[k];         // velocity of particle i        cout << endl;    }    delete []p_all;    }}    /*----------------------------------------------------------------------------- *  write_diagnostics  --  writes diagnostics on the error stream cerr: *                         current time; number of integration steps so far; *                         kinetic, potential, and total energy; absolute and *                         relative energy errors since the start of the run. *                         If x_flag (x for eXtra data) is true, all internal *                         data are dumped for each particle (mass, position, *                         velocity, acceleration, and jerk). * *  note: the kinetic energy is calculated here, while the potential energy is *        calculated in the function get_acc_jerk_pot_coll() and broadcasted *        by the other processors. * *  note: Communication goes via the root (0) proceesor *----------------------------------------------------------------------------- */void write_diagnostics(Particle p[], int n, real t, real epot_local,                       int nsteps, real & einit, bool init_flag,                       bool x_flag, real &tcpu){    int rank;    MPI_Comm_rank( MPI_COMM_WORLD, &rank );    real ekin_local = 0;       // kinetic energy of the n-body system    for (int i = 0; i < n ; i++)        for (int k = 0; k < NDIM ; k++)            ekin_local += 0.5 * p[i].mass * p[i].vel[k] * p[i].vel[k];    real ekin;    MPI_Allreduce(&ekin_local, &ekin, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );    real epot;    MPI_Allreduce(&epot_local, &epot, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );    epot *= 0.5;  // against double counting    real etot = ekin + epot;             // total energy of the n-body system    if (init_flag)                       // at first pass, pass the initial        einit = etot;                    // energy back to the calling function    tcpu = MPI_Wtime() - tcpu;    if(rank==0) {    cerr << "at time t = " << t << ", after " << nsteps         << " steps (CPU = " << tcpu << "): \n  E_kin = " << ekin         << " , E_pot = " << epot         << " , E_tot = " << etot << endl;    cerr << "                "         << "absolute energy error: E_tot - E_init = "         << etot - einit << endl;    cerr << "                "         << "relative energy error: (E_tot - E_init) / E_init = "         << (etot - einit) / einit << endl;    }    if (x_flag){        cerr << "  for debugging purposes, here is the internal data "             << "representation:\n";        for (int i = 0; i < n ; i++){            cerr << "    internal data for particle " << i+1 << " : " << endl;            cerr << "      ";            cerr << p[i].id << " " << p[i].mass;            for (int k = 0; k < NDIM; k++)                cerr << ' ' << p[i].pos[k];            for (int k = 0; k < NDIM; k++)                cerr << ' ' << p[i].vel[k];            for (int k = 0; k < NDIM; k++)                cerr << ' ' << p[i].acc[k];            for (int k = 0; k < NDIM; k++)                cerr << ' ' << p[i].jerk[k];            cerr << endl;        }    }} /*----------------------------------------------------------------------------- *  evolve  --  integrates an N-body system, for a total duration dt_tot. *              Snapshots are sent to the standard output stream once every *              time interval dt_out.  Diagnostics are sent to the standard *              error stream once every time interval dt_dia. * *  note: the integration time step, shared by all particles at any given time, *        is variable.  Before each integration step we use coll_time (short *        for collision time, an estimate of the time scale for any significant *        change in configuration to happen), multiplying it by dt_param (the *        accuracy parameter governing the size of dt in units of coll_time), *        to obtain the new time step size. * *  Before moving any particles, we start with an initial diagnostics output *  and snapshot output if desired.  In order to write the diagnostics, we *  first have to calculate the potential energy, with get_acc_jerk_pot_coll(). *  That function also calculates accelerations, jerks, and an estimate for the *  collision time scale, all of which are needed before we can enter the main *  integration loop below. *       In the main loop, we take as many integration time steps as needed to *  reach the next output time, do the output required, and continue taking *  integration steps and invoking output this way until the final time is *  reached, which triggers a `break' to jump out of the infinite loop set up *  with `while(true)'. *----------------------------------------------------------------------------- */void evolve(Particle p[],             int n, real & t, real dt_param, real dt_dia, real dt_out,            real dt_tot, bool init_out, bool x_flag,	    void *pipe, MPI_Datatype particletype){    int rank, size;    MPI_Comm_rank( MPI_COMM_WORLD, &rank );    MPI_Comm_size( MPI_COMM_WORLD, &size );    if(rank==root)       cerr << "Starting a Hermite integration for a " << n*size	   << "-body system,\n  from time t = " << t 	   << " with time step control parameter dt_param = " << dt_param	   << "  until time " << t + dt_tot 	   << " ,\n  with diagnostics output interval dt_dia = "

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩黄色一区二区| 精品一区二区三区欧美| 午夜av区久久| 六月丁香综合在线视频| 国产精品1区二区.| 色综合久久久久久久久| 欧美丰满嫩嫩电影| 欧美国产一区二区| 亚洲一区国产视频| 狠狠色狠狠色综合日日91app| 国产不卡视频一区| 欧美日韩精品三区| 久久久国产午夜精品| 亚洲欧美日韩小说| 免费xxxx性欧美18vr| 高清不卡一区二区在线| 在线一区二区三区四区五区| 日韩欧美一二三区| 1024成人网| 丝瓜av网站精品一区二区 | 欧美午夜精品久久久久久孕妇| 欧美中文字幕一区二区三区| 欧美大黄免费观看| 亚洲欧美电影院| 国产综合色视频| 91福利在线免费观看| 精品国精品国产尤物美女| 亚洲欧洲av色图| 免费欧美高清视频| 色美美综合视频| 久久久国产一区二区三区四区小说 | 亚洲一区二区三区免费视频| 精品在线你懂的| 在线观看日韩电影| 国产精品卡一卡二| 久久se精品一区精品二区| 色综合天天综合色综合av| 欧美mv日韩mv国产网站| 亚洲国产综合人成综合网站| 国产精品一区三区| 欧美一个色资源| 一区二区三国产精华液| 国产91对白在线观看九色| 欧美一区二区三区在| 亚洲激情图片一区| 成人h精品动漫一区二区三区| 日韩午夜av电影| 亚洲高清免费观看高清完整版在线观看| 激情深爱一区二区| 91精品国产综合久久小美女| 亚洲男帅同性gay1069| 丰满岳乱妇一区二区三区| 欧美一级国产精品| 偷拍亚洲欧洲综合| 在线影院国内精品| 亚洲美女屁股眼交3| 国产黄色成人av| 精品国产成人系列| 六月丁香婷婷久久| 欧美一区二区三区在线视频| 亚洲小少妇裸体bbw| 日本高清不卡视频| 中文字幕国产一区| 国产精品资源在线看| 欧美岛国在线观看| 久久成人综合网| 精品国产一区二区三区忘忧草| 日韩中文字幕亚洲一区二区va在线| 日本电影亚洲天堂一区| 亚洲美女屁股眼交| 在线观看日韩一区| 一个色综合av| 欧美在线观看视频一区二区三区| 亚洲精品老司机| 91网页版在线| 亚洲精品视频一区| 91福利精品视频| 亚洲一区二区成人在线观看| 日本二三区不卡| 亚洲123区在线观看| 欧美情侣在线播放| 麻豆久久久久久| 久久综合九色综合久久久精品综合| 久久99国内精品| 久久精品一区二区三区不卡牛牛| 国产精品一区二区无线| 中文字幕免费一区| 色综合久久中文字幕| 亚洲丰满少妇videoshd| 欧美福利电影网| 国产一区二区三区免费观看| 国产亚洲精品bt天堂精选| www.欧美亚洲| 亚洲最色的网站| 日韩一级免费一区| 国产毛片一区二区| 综合久久久久久久| 欧美日韩一区视频| 蜜桃在线一区二区三区| 久久丝袜美腿综合| 91麻豆福利精品推荐| 亚洲午夜一二三区视频| 日韩三级电影网址| 丁香婷婷综合五月| 亚洲激情在线激情| 日韩网站在线看片你懂的| 国产福利不卡视频| 一区二区三区四区不卡在线| 欧美高清www午色夜在线视频| 国产综合久久久久久鬼色| 国产精品久久久久久久久搜平片 | 亚洲欧洲国产专区| 欧美在线免费观看亚洲| 美女视频黄频大全不卡视频在线播放| 精品日韩一区二区三区| 成人黄色电影在线| 亚洲国产一区二区a毛片| 欧美v亚洲v综合ⅴ国产v| a级高清视频欧美日韩| 午夜精品视频在线观看| 国产亚洲人成网站| 在线视频欧美精品| 久久99久久精品| 亚洲欧美一区二区久久| 欧美一级视频精品观看| 成人免费视频app| 视频一区中文字幕国产| 国产精品久久久久久久久图文区| 欧美日韩不卡在线| 成人午夜视频网站| 免费成人av在线| 亚洲人吸女人奶水| 欧美tk—视频vk| 色偷偷88欧美精品久久久| 精品在线视频一区| 亚洲伊人伊色伊影伊综合网| 久久久久久久久久久久电影| 欧美色图12p| 成人精品一区二区三区四区| 天堂蜜桃91精品| 1区2区3区精品视频| 久久久综合网站| 91精品国产综合久久福利| 91在线视频官网| 国产老女人精品毛片久久| 日产国产欧美视频一区精品| 亚洲欧美另类在线| 国产亚洲污的网站| 日韩欧美的一区| 欧美日韩在线直播| 一本大道久久a久久精二百| 国产精品资源在线看| 奇米色777欧美一区二区| 一区二区三区欧美激情| 国产精品美女久久久久久久| 精品国产sm最大网站| 欧美日韩一级二级三级| 色婷婷综合久久久中文字幕| 成人精品国产免费网站| 国产专区综合网| 久久精品国产成人一区二区三区 | 欧美在线色视频| 91视频在线观看| 高清国产一区二区| 国产又黄又大久久| 免费成人美女在线观看.| 午夜a成v人精品| 亚洲1区2区3区4区| 性做久久久久久久免费看| 亚洲综合一区二区| 夜夜操天天操亚洲| 亚洲自拍另类综合| 亚洲精品成人精品456| 136国产福利精品导航| 中文字幕亚洲综合久久菠萝蜜| 久久精品人人做人人综合| 2024国产精品视频| 久久夜色精品国产欧美乱极品| 日韩免费观看2025年上映的电影| 在线不卡中文字幕播放| 欧美猛男gaygay网站| 欧美人牲a欧美精品| 这里是久久伊人| 制服丝袜在线91| 制服丝袜亚洲精品中文字幕| 欧美久久婷婷综合色| 欧美高清性hdvideosex| 欧美人狂配大交3d怪物一区| 欧美精品高清视频| 日韩一区二区三区精品视频 | 国产永久精品大片wwwapp| 国产在线精品不卡| 国产99久久久国产精品| 成人在线一区二区三区| www.日本不卡| 在线观看不卡一区| 欧美美女bb生活片| 日韩欧美激情一区| 国产三级精品在线| 一区在线中文字幕|