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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nbody_sh1p.c

?? mpi編程
?? C
?? 第 1 頁 / 共 3 頁
字號:
               // Time-stamp: <2002-01-18 21:51:36 piet>              // Time-stamp: <2003-21-10 03:22:41 spz>             //================================================================            //                                                                |           //           /__----__                         ........            |          //       .           \                     ....:        :.          |         //       :                 _\|/_         ..:                         |        //       :                   /|\         :                     _\|/_  |       //  ___   ___                  _____                      ___    /|\   |      //  /     |   \    /\ \     / |   |   \  / |        /\    |   \         |     //  |   __ |___/   /  \ \   /  |   |    \/  |       /  \   |___/         |    //   |    | |  \   /____\ \ /   |   |    /   |      /____\  |   \     \/  |   //     \___| |   \ /      \ V    |   |   /    |____ /      \ |___/     |   |  //                                                                      /   | //              :                       _/|     :..                    |/    |//                :..               ____/           :....          ..         |/*   o   //          :.    _\|/_     /                   :........:           | *  O  `//\                 /|\                                               | *  |     /\                                                                  | *============================================================================= * *  nbody_sh1p.C: an N-body integrator with a shared but variable time step *                (the same for all particles but changing in time), using *                the Hermite integration scheme. *                         *                ref.: Hut, P., Makino, J. & McMillan, S., 1995, *                      Astrophysical Journal Letters 443, L93-L96. *                 *                The original version (nbody_sh1.C) has been adapted  *                for a parallel ring algorithm using the MPI library.  *_____________________________________________________________________________ * *  usage: nbody_sh1p [-h (for help)] [-d step_size_control_parameter] *                    [-e diagnostics_interval] [-o output_interval] *                    [-t total_duration] [-i (start output at t = 0)] *                    [-x (extra debugging diagnostics)] *  *         "step_size_control_parameter" is a coefficient determining the *            the size of the shared but variable time step for all particles * *         "diagnostics_interval" is the time between output of diagnostics, *            in the form of kinetic, potential, and total energy; with the *            -x option, a dump of the internal particle data is made as well *  *         "output_interval" is the time between successive snapshot outputs * *         "total_duration" is the integration time, until the program stops * *         Input and output are written from the standard i/o streams.  Since *         all options have sensible defaults, the simplest way to run the code *         is by only specifying the i/o files for the N-body snapshots: * *            nbody_sh1 < data.in > data.out * *         The diagnostics information will then appear on the screen. *         To capture the diagnostics information in a file, capture the *         standard error stream as follows: * *            (nbody_sh1 < data.in > data.out) >& data.err * *  Note: if any of the times specified in the -e, -o, or -t options are not an *        an integer multiple of "step", output will occur slightly later than *        predicted, after a full time step has been taken.  And even if they *        are integer multiples, round-off error may induce one extra step. *_____________________________________________________________________________ * *  External data format: * *     The program expects input of a single snapshot of an N-body system, *     in the following format: the number of particles in the snapshot n; *     the time t; mass mi, position ri and velocity vi for each particle i, *     with position and velocity given through their three Cartesian *     coordinates, divided over separate lines as follows: * *                      n *                      t *                      m1 r1_x r1_y r1_z v1_x v1_y v1_z *                      m2 r2_x r2_y r2_z v2_x v2_y v2_z *                      ... *                      mn rn_x rn_y rn_z vn_x vn_y vn_z * *     Output of each snapshot is written according to the same format. * *  Internal data format: * *     The data for an N-body system is stored internally as a 1-dimensional *     array for particle characteristics collected in a structure. *     The structure contains particle identity, mass, and 1-dimensional  *     arrays for the position, velocity, acceleration and jerk. *     The particle identity is added in the MPI implemetation to prevent  *     computing acceleration and force on itself. *_____________________________________________________________________________ * *  Extera about the MPI implementation * *     The topology assumes a 1-dimensional ring of processors with  *     int(N/p) particles per processor. At the moment only p*int(N/p) *     particles can be integrated; excess of p*int(N/p) particles are ignored  *     in the input and particle residtribution. *     All I/O is via the root processor (0).  * *     Possible adjustments and improvement: *     - It is assumed that each star has a unique identifier, which is  *       provided at runtime. *     - For the comminucation all particle information is passed to other  *       processes, where this is not always required. *     - Since each processor works with N/p particles, little memory per  *       node is requires, the root node, however, requires to store an  *       entire snapshot at I/O. *     - Acceleration and jerk are computed for all particles individually,  *       the symmetry in the force calculation is not used. *_____________________________________________________________________________ * *  Compiling * *    Successfull compilation requires the presence of MPI or some compatible  *    derivative such as MPICH. *    Here we give the command line example for compilation with MPICH  *    assuming that it is installed on your system on /usr/local/MPI * *    First: create the pipe.o object file: *    %> /usr/local/MPI/bin/mpiCC -g -O2 -I/usr/local/MPI/include -c pipe.C * *    Second: compile nbody_sh1p.C and link it with pipe.o: *    %> /usr/local/MPI/bin/mpiCC -g -O2 -I/usr/local/MPI/include \ *          nbody_sh1p.C -L/usr/local/MPI/lib -lmpich pipe.o -o nbody_sh1p *_____________________________________________________________________________ * *  Testrun *  *    Test run with 6 processors by the following command line *    %> /usr/local/MPI/bin/mpirun -np 6 ./nbody_sh1p < n24body.in *_____________________________________________________________________________ * *    version 1:  Jan 2002   Piet Hut, Jun Makino *    version 2:  Okt 2003   Simon Portegies Zwart *_____________________________________________________________________________ */#include  <iostream>#include  <cmath>                          // to include sqrt(), etc.#include  <cstdlib>                        // for atoi() and atof()#include  <unistd.h>                       // for getopt()#include  <mpi.h>                          // include the MPI library#include  "pipe.h"                         // the MPI pipe routinesusing namespace std;typedef double  real;                      // "real" as a general name for the                                           // standard floating-point data type// practical for debugging#define PRI(x) {for (int __pri__ = 0; __pri__ < x; __pri__++) cerr << " ";}#define PR(x)  cerr << #x << " = " << x << " "#define PRC(x) cerr << #x << " = " << x << ",  "#define PRL(x) cerr << #x << " = " << x << endlconst int NDIM = 3;                        // number of spatial dimensionsconst real VERY_LARGE_NUMBER = 1e300;const int root = 0;                        // identity of the root processor// The Particle structuretypedef struct {  int id;  real mass;  real pos[NDIM];  real vel[NDIM];  real acc[NDIM];  real jerk[NDIM];} Particle;void correct_step(Particle p[], Particle po[], int n, real dt);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);void evolve_step(Particle p[], int n, real & t,                 real dt, real & epot, real & coll_time,		 void *pipe);void get_acc_jerk_pot_coll(Particle pl[], int nl, 			   Particle po[], int no, 			   real & epot, real & coll_time);Particle * get_snapshot(int &n, real &t, MPI_Datatype &particletype);void predict_step(Particle p[], int n, real dt);void put_snapshot(Particle p[], int n, real t, MPI_Datatype particletype);bool read_options(int argc, char *argv[], real & dt_param, real & dt_dia,                  real & dt_out, real & dt_tot, bool & i_flag, bool & x_flag);void write_diagnostics(Particle p[], int n, real t, real epot,                       int nsteps, real & einit, bool init_flag,                       bool x_flag, real &tcpu);#define loop(idx,last) for (idx = 0; idx < last ; idx++)void uniform(real a, real *x);void uniform(Particle p[], int n);void get_acc_jerk_pot_coll(Particle p[], int n, real &epot, real &coll_time, 			   void *pipe);/*----------------------------------------------------------------------------- *  main  --  reads option values, reads a snapshot, and launches the *            integrator *----------------------------------------------------------------------------- */int main(int argc, char *argv[]){    // initialize MPI    int rank, size;    MPI_Init( &argc, &argv );    MPI_Comm_rank( MPI_COMM_WORLD, &rank );    MPI_Comm_size( MPI_COMM_WORLD, &size );    real  dt_param = 0.03;     // control parameter to determine time step size    real  dt_dia = 1;          // time interval between diagnostics output    real  dt_out = 1;          // time interval between output of snapshots    real  dt_tot = 10;         // duration of the integration    bool  init_out = false;    // if true: snapshot output with start at t = 0                               //          with an echo of the input snapshot    bool  x_flag = false;      // if true: extra debugging diagnostics output    if (! read_options(argc, argv, dt_param, dt_dia, dt_out, dt_tot, init_out,                       x_flag))        return 1;                // halt criterion detected by read_options()    int n;    real t;    MPI_Datatype particletype;    Particle *p = get_snapshot(n, t, particletype);    real noutp = 1;    real dt;    put_snapshot(p, n, t, particletype);    void * pipe;  // Create a MPI pipe for a 1-dimensional ring topology    MPE_Pipe_create( MPI_COMM_WORLD, particletype, n, &pipe );    evolve(p, n, t, dt_param, dt_dia, dt_out, dt_tot, init_out,	   x_flag, pipe, particletype);    delete []p;    MPE_Pipe_free( &pipe );             // Clean up MPI    MPI_Type_free( &particletype );    MPI_Finalize();}/*----------------------------------------------------------------------------- *  read_options  --  reads the command line options, and implements them. * *  note: when the help option -h is invoked, the return value is set to false, *        to prevent further execution of the main program; similarly, if an *        unknown option is used, the return value is set to false. *----------------------------------------------------------------------------- */bool read_options(int argc, char *argv[], real & dt_param, real & dt_dia,                  real & dt_out, real & dt_tot, bool & i_flag, bool & x_flag){    int c;    while ((c = getopt(argc, argv, "hd:e:o:t:ix")) != -1)        switch(c){            case 'h': cerr << "usage: " << argv[0]                           << " [-h (for help)]"

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
proumb性欧美在线观看| 欧美亚洲国产一卡| 午夜天堂影视香蕉久久| 久久亚洲综合av| 欧美三级一区二区| 国产69精品一区二区亚洲孕妇| 午夜影院在线观看欧美| 国产精品国产自产拍高清av王其 | 欧美三级乱人伦电影| 国产美女主播视频一区| 亚洲综合一二区| 国产精品美女一区二区三区| 日韩视频一区二区三区在线播放| 91成人免费电影| va亚洲va日韩不卡在线观看| 韩国女主播一区二区三区| 偷拍日韩校园综合在线| 亚洲黄一区二区三区| 国产亚洲欧美一区在线观看| 6080亚洲精品一区二区| 色偷偷久久一区二区三区| 国产成人av在线影院| 老司机免费视频一区二区| 午夜精品福利一区二区三区蜜桃| 成人免费在线播放视频| 中文字幕免费不卡| 26uuu色噜噜精品一区二区| 日韩欧美亚洲一区二区| 欧美一级高清大全免费观看| 欧美日韩亚洲不卡| 欧美色网一区二区| 欧美调教femdomvk| 欧美视频在线一区二区三区| av不卡免费电影| 93久久精品日日躁夜夜躁欧美| 成人免费三级在线| 国产成人午夜视频| 国产成人av一区| 国产精品1区二区.| 粉嫩av亚洲一区二区图片| 国产美女精品一区二区三区| 国产一区二区三区在线观看精品 | 国产中文字幕精品| 韩国精品主播一区二区在线观看 | 亚洲韩国精品一区| 亚洲午夜电影网| 水蜜桃久久夜色精品一区的特点| 亚洲www啪成人一区二区麻豆| 亚洲成av人片在线| 免费成人av在线| 激情综合网天天干| 成人性生交大合| av高清久久久| 欧美在线小视频| 91精品婷婷国产综合久久性色| 日韩一区国产二区欧美三区| 日韩视频一区在线观看| 久久久久久亚洲综合| 国产精品理论在线观看| 亚洲欧美日本在线| 天堂蜜桃一区二区三区| 精品一区二区三区免费| 成人黄色一级视频| 欧美在线观看一二区| 在线成人av影院| 国产亚洲精品超碰| 亚洲欧美经典视频| 青青草国产成人99久久| 国产精品一区二区视频| 色综合天天综合色综合av| 欧美在线观看视频在线| 精品国偷自产国产一区| 中文字幕不卡三区| 亚洲在线视频一区| 九九久久精品视频| 91麻豆福利精品推荐| 91精品国产91久久久久久一区二区| 亚洲精品一线二线三线| 自拍偷自拍亚洲精品播放| 日韩在线播放一区二区| 国产91精品一区二区麻豆亚洲| 在线观看国产一区二区| 久久久99久久| 亚洲自拍偷拍av| 国产一区不卡视频| 在线免费观看日韩欧美| 久久众筹精品私拍模特| 亚洲国产美女搞黄色| 国产精品自拍在线| 欧美日韩中文一区| 国产三级久久久| 日日摸夜夜添夜夜添国产精品 | 国产乱人伦偷精品视频免下载| 91在线你懂得| 精品国产99国产精品| 亚洲午夜精品17c| 国产91丝袜在线18| 日韩精品一区二区在线| 一区二区三区日韩欧美精品| 国产一区二区中文字幕| 欧美色老头old∨ideo| 国产精品三级av在线播放| 美女视频免费一区| 在线欧美日韩精品| 国产精品欧美经典| 国产一区二区免费视频| 欧美日韩高清在线播放| 18涩涩午夜精品.www| 狠狠色狠狠色综合日日91app| 精品视频在线视频| 中文字幕中文字幕在线一区| 麻豆91免费看| 51精品秘密在线观看| 亚洲男女毛片无遮挡| 国产精品自拍三区| 欧美精品一区男女天堂| 午夜视频久久久久久| 91激情五月电影| 一区二区在线看| 成人黄色在线看| 国产精品久久久一本精品| 国产成人精品免费一区二区| 精品精品欲导航| 久久超级碰视频| 日韩欧美色综合| 日本伊人精品一区二区三区观看方式| 91蜜桃免费观看视频| 亚洲色图19p| 色婷婷av一区二区三区软件| 国产精品久久影院| 99视频超级精品| 中文字幕一区二区三区在线播放 | 一区二区三区四区在线免费观看 | 99re这里只有精品首页| 中文字幕 久热精品 视频在线| 国产一区二区三区免费在线观看| 日韩精品一区在线| 国产在线播放一区二区三区| 精品裸体舞一区二区三区| 久久精品国产在热久久| 日韩精品一区二区三区视频| 久久精品国产精品亚洲精品| 欧美电视剧免费观看| 国产自产视频一区二区三区| 久久久久久久性| 成人免费看的视频| 亚洲男人的天堂网| 欧美日免费三级在线| 青青草国产精品亚洲专区无| 日韩视频永久免费| 国产成人一级电影| 国产精品麻豆一区二区| 色综合久久88色综合天天6| 一区二区三区在线观看动漫| 欧美日韩免费在线视频| 免费av网站大全久久| 欧美精品一区二区三区蜜臀| 国产精品性做久久久久久| 亚洲欧洲无码一区二区三区| 在线观看日韩电影| 久久国产综合精品| 国产女人水真多18毛片18精品视频 | 国产精品一线二线三线| 国产精品电影一区二区三区| 欧美三级韩国三级日本三斤| 久久精品国产99国产精品| 久久久综合网站| 色乱码一区二区三区88| 天堂蜜桃一区二区三区| 国产午夜精品久久久久久免费视| 99久久精品免费| 日精品一区二区三区| 久久久国产精品午夜一区ai换脸| av亚洲产国偷v产偷v自拍| 日韩经典中文字幕一区| 久久蜜桃一区二区| 色av成人天堂桃色av| 麻豆91免费看| 一区二区三区在线高清| 久久色.com| 欧美亚洲一区二区在线| 国产一区视频网站| 亚洲午夜久久久久久久久电影院| 久久久美女毛片| 欧美日韩国产一二三| 国产成人精品1024| 午夜视频一区二区| 国产精品高潮久久久久无| 欧美一区二区三区公司| av在线免费不卡| 激情图片小说一区| 亚洲午夜影视影院在线观看| 久久综合久久久久88| 欧美美女一区二区三区| 99免费精品在线观看| 久久精品噜噜噜成人av农村| 亚洲一区二区五区| 国产精品狼人久久影院观看方式| 日韩一级片网址| 在线观看日韩电影|