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

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

?? appdemo.java

?? MPI for java for Distributed Programming
?? JAVA
字號:
/***************************************************************************                                                                         **             Java Grande Forum Benchmark Suite - MPJ Version 1.0         **                                                                         **                            produced by                                  **                                                                         **                  Java Grande Benchmarking Project                       **                                                                         **                                at                                       **                                                                         **                Edinburgh Parallel Computing Centre                      **                                                                         **                email: epcc-javagrande@epcc.ed.ac.uk                     **                                                                         **      Original version of this code by Hon Yau (hwyau@epcc.ed.ac.uk)     **                                                                         **      This version copyright (c) The University of Edinburgh, 2001.      **                         All rights reserved.                            **                                                                         ***************************************************************************/package jgf_mpj_benchmarks.section3.montecarlo; //package montecarlo;import jgf_mpj_benchmarks.jgfutil.*;//aimport jgfutil.*;import java.util.*;import java.awt.*;import mpi.*;/**  * Code, a test-harness for invoking and driving the Applications  * Demonstrator classes.  *  * <p>To do:  * <ol>  *   <li>Very long delay prior to connecting to the server.</li>  *   <li>Some text output seem to struggle to get out, without  *       the user tapping ENTER on the keyboard!</li>  * </ol>  *  * @author H W Yau  * @version $Revision: 1.1 $ $Date: 2005/04/29 17:43:42 $  */public class AppDemo extends Universal {  //------------------------------------------------------------------------  // Class variables.  //------------------------------------------------------------------------    public static double JGFavgExpectedReturnRateMC =0.0;  /**    * A class variable.    */  public static boolean DEBUG=true;  /**    * The prompt to write before any debug messages.    */  protected static String prompt="AppDemo> ";  public static final int Serial=1;  //------------------------------------------------------------------------  // Instance variables.  //------------------------------------------------------------------------  /**    * Directory in which to find the historical rates.    */  private String dataDirname;  /**    * Name of the historical rate to model.    */  private String dataFilename;  /**    * The number of time-steps which the Monte Carlo simulation should    * run for.    */  private int nTimeStepsMC=0;  /**    * The number of Monte Carlo simulations to run.    */  private int nRunsMC=0;  /**    * The max no of Monte Carlo simulations per process    */  private int p_nRunsMC=0;  /**    * The default duration between time-steps, in units of a year.    */  private double dTime = 1.0/365.0;  /**    * Flag to determine whether initialisation has already taken place.    */  private boolean initialised=false;  /**    * Variable to determine which deployment scenario to run.    */  private int runMode;  private java.util.Vector tasks;  private java.util.Vector results;  /**    * temporary vector for MPI    */  private java.util.Vector [] p_results = new java.util.Vector[1];  public AppDemo(    String dataDirname, String dataFilename, int nTimeStepsMC,   int nRunsMC) {    this.dataDirname    = dataDirname;    this.dataFilename   = dataFilename;    this.nTimeStepsMC   = nTimeStepsMC;    this.nRunsMC        = nRunsMC;    this.initialised    = false;    set_prompt(prompt);    set_DEBUG(DEBUG);  }  /**    * Single point of contact for running this increasingly bloated    * class.  Other run modes can later be defined for whether a new rate    * should be loaded in, etc.    * Note that if the <code>hostname</code> is set to the string "none",    * then the demonstrator runs in purely serial mode.    */  /**    * Initialisation and Run methods.    */    PriceStock psMC;    double pathStartValue = 100.0;    double avgExpectedReturnRateMC = 0.0;    double avgVolatilityMC = 0.0;    ToInitAllTasks initAllTasks = null;    public void initSerial() {     try{      //      // Measure the requested path rate.      RatePath rateP = new RatePath(dataDirname, dataFilename);      rateP.dbgDumpFields();      ReturnPath returnP = rateP.getReturnCompounded();      returnP.estimatePath();      returnP.dbgDumpFields();      double expectedReturnRate = returnP.get_expectedReturnRate();      double volatility         = returnP.get_volatility();      //      // Now prepare for MC runs.      initAllTasks = new ToInitAllTasks(returnP, nTimeStepsMC,       pathStartValue);      String slaveClassName = "MonteCarlo.PriceStock";      //      // Now create the tasks.      initTasks(nRunsMC);      //    } catch( DemoException demoEx ) {      dbgPrintln(demoEx.toString());      System.exit(-1);    }  }  public void runSerial() throws MPIException{    int ilow,ihigh;    if(JGFMonteCarloBench.rank==0) {       results = new java.util.Vector(nRunsMC);    }     p_nRunsMC = (nRunsMC + JGFMonteCarloBench.nprocess -1) / JGFMonteCarloBench.nprocess;    p_results[0] = new java.util.Vector(p_nRunsMC);    ilow = JGFMonteCarloBench.rank*p_nRunsMC;    ihigh = (JGFMonteCarloBench.rank+1)*p_nRunsMC;    if (JGFMonteCarloBench.rank==JGFMonteCarloBench.nprocess-1) ihigh = nRunsMC;      // Now do the computation.      PriceStock ps;      for( int iRun=ilow; iRun < ihigh; iRun++ ) {	ps = new PriceStock();	ps.setInitAllTasks(initAllTasks);	ps.setTask(tasks.elementAt(iRun));	ps.run();	p_results[0].addElement(ps.getResult());      }    if(JGFMonteCarloBench.rank==0) {     for(int i=0;i<p_results[0].size();i++){       results.addElement((ToResult) p_results[0].elementAt(i));     }     for(int j=1;j<JGFMonteCarloBench.nprocess;j++) {       p_results[0].removeAllElements();       MPI.COMM_WORLD.Recv(p_results,0,1,MPI.OBJECT,j,j);       for(int i=0;i<p_results[0].size();i++){         results.addElement((ToResult) p_results[0].elementAt(i));       }     }    } else {     MPI.COMM_WORLD.Send(p_results,0,1,MPI.OBJECT,0,JGFMonteCarloBench.rank);    }  }  public void processSerial() {      //      // Process the results.    try {      processResults();    } catch( DemoException demoEx ) {      dbgPrintln(demoEx.toString());      System.exit(-1);    }  }  //------------------------------------------------------------------------  /**    * Generates the parameters for the given Monte Carlo simulation.    *    * @param nRunsMC the number of tasks, and hence Monte Carlo paths to    *        produce.    */  private void initTasks(int nRunsMC) {    tasks = new java.util.Vector(nRunsMC);    for( int i=0; i < nRunsMC; i++ ) {      String header="MC run "+String.valueOf(i);      ToTask task = new ToTask(header, (long)i*11);      tasks.addElement((Object) task);    }  }  /**    * Method for doing something with the Monte Carlo simulations.    * It's probably not mathematically correct, but shall take an average over    * all the simulated rate paths.    *    * @exception DemoException thrown if there is a problem with reading in    *            any values.    */  private void processResults() throws DemoException{    double avgExpectedReturnRateMC = 0.0;    double avgVolatilityMC = 0.0;    double runAvgExpectedReturnRateMC = 0.0;    double runAvgVolatilityMC = 0.0;    ToResult returnMC;    if( nRunsMC != results.size() ) {      errPrintln("Fatal: TaskRunner managed to finish with no all the results gathered in!");      System.exit(-1);    }    //    // Create an instance of a RatePath, for accumulating the results of the    // Monte Carlo simulations.    RatePath avgMCrate = new RatePath(nTimeStepsMC, "MC", 19990109, 19991231, dTime);    for( int i=0; i < nRunsMC; i++ ) {      // First, create an instance which is supposed to generate a      // particularly simple MC path.      returnMC = (ToResult) results.elementAt(i);      avgMCrate.inc_pathValue(returnMC.get_pathValue());      avgExpectedReturnRateMC += returnMC.get_expectedReturnRate();      avgVolatilityMC         += returnMC.get_volatility();      runAvgExpectedReturnRateMC = avgExpectedReturnRateMC /((double)(i+1));      runAvgVolatilityMC = avgVolatilityMC / ((double)(i+1));    } // for i;    avgMCrate.inc_pathValue((double)1.0/((double)nRunsMC));    avgExpectedReturnRateMC /= nRunsMC;    avgVolatilityMC         /= nRunsMC;    /*    try{      Thread.sleep(200);    } catch( InterruptedException intEx) {      errPrintln(intEx.toString());    }    */    JGFavgExpectedReturnRateMC = avgExpectedReturnRateMC;//    dbgPrintln("Average over "+nRunsMC+": expectedReturnRate="+//    avgExpectedReturnRateMC+" volatility="+avgVolatilityMC + JGFavgExpectedReturnRateMC);  }  //  //------------------------------------------------------------------------  // Accessor methods for class AppDemo.  // Generated by 'makeJavaAccessor.pl' script.  HWY.  20th January 1999.  //------------------------------------------------------------------------  /**    * Accessor method for private instance variable <code>dataDirname</code>.    *    * @return Value of instance variable <code>dataDirname</code>.    */  public String get_dataDirname() {    return(this.dataDirname);  }  /**    * Set method for private instance variable <code>dataDirname</code>.    *    * @param dataDirname the value to set for the instance variable <code>dataDirname</code>.    */  public void set_dataDirname(String dataDirname) {    this.dataDirname = dataDirname;  }  /**    * Accessor method for private instance variable <code>dataFilename</code>.    *    * @return Value of instance variable <code>dataFilename</code>.    */  public String get_dataFilename() {    return(this.dataFilename);  }  /**    * Set method for private instance variable <code>dataFilename</code>.    *    * @param dataFilename the value to set for the instance variable <code>dataFilename</code>.    */  public void set_dataFilename(String dataFilename) {    this.dataFilename = dataFilename;  }  /**    * Accessor method for private instance variable <code>nTimeStepsMC</code>.    *    * @return Value of instance variable <code>nTimeStepsMC</code>.    */  public int get_nTimeStepsMC() {    return(this.nTimeStepsMC);  }  /**    * Set method for private instance variable <code>nTimeStepsMC</code>.    *    * @param nTimeStepsMC the value to set for the instance variable <code>nTimeStepsMC</code>.    */  public void set_nTimeStepsMC(int nTimeStepsMC) {    this.nTimeStepsMC = nTimeStepsMC;  }  /**    * Accessor method for private instance variable <code>nRunsMC</code>.    *    * @return Value of instance variable <code>nRunsMC</code>.    */  public int get_nRunsMC() {    return(this.nRunsMC);  }  /**    * Set method for private instance variable <code>nRunsMC</code>.    *    * @param nRunsMC the value to set for the instance variable <code>nRunsMC</code>.    */  public void set_nRunsMC(int nRunsMC) {    this.nRunsMC = nRunsMC;  }  /**    * Accessor method for private instance variable <code>tasks</code>.    *    * @return Value of instance variable <code>tasks</code>.    */  public java.util.Vector get_tasks() {    return(this.tasks);  }  /**    * Set method for private instance variable <code>tasks</code>.    *    * @param tasks the value to set for the instance variable <code>tasks</code>.    */  public void set_tasks(java.util.Vector tasks) {    this.tasks = tasks;  }  /**    * Accessor method for private instance variable <code>results</code>.    *    * @return Value of instance variable <code>results</code>.    */  public java.util.Vector get_results() {    return(this.results);  }  /**    * Set method for private instance variable <code>results</code>.    *    * @param results the value to set for the instance variable <code>results</code>.    */  public void set_results(java.util.Vector results) {    this.results = results;  }  //------------------------------------------------------------------------}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日夜夜精品视频免费| 欧美精品成人一区二区三区四区| 亚洲另类色综合网站| 久久夜色精品一区| 久久久无码精品亚洲日韩按摩| 3d成人动漫网站| 欧美人体做爰大胆视频| 欧美视频中文字幕| 欧美日韩国产一区| 日韩视频免费观看高清完整版在线观看| 91黄色免费版| 欧美亚洲一区三区| 欧美精品粉嫩高潮一区二区| 日韩欧美一区二区免费| 欧美mv和日韩mv国产网站| 日韩美一区二区三区| 国产视频一区不卡| 亚洲欧洲美洲综合色网| 亚洲精品成人少妇| 午夜精品久久一牛影视| 精品一二三四在线| 成人av在线电影| 91成人网在线| 精品日韩av一区二区| 国产精品视频麻豆| 亚洲国产精品自拍| 黄色小说综合网站| 94-欧美-setu| 欧美一区二区视频网站| 久久久久久久久一| 日韩一区在线免费观看| 亚洲国产成人av| 日本不卡的三区四区五区| 国产激情视频一区二区在线观看| 色婷婷精品久久二区二区蜜臀av| 在线成人av影院| 国产欧美一区二区三区网站| 亚洲精品大片www| 国产一区欧美二区| 欧美日韩在线三级| 国产欧美精品国产国产专区| 亚洲国产综合在线| 国产成人av一区| 欧美一区二区三区小说| 中文字幕亚洲不卡| 国产精品资源网站| 69堂亚洲精品首页| 亚洲欧美日韩国产成人精品影院| 捆绑变态av一区二区三区| 一本一道久久a久久精品| 精品国产网站在线观看| 亚洲午夜羞羞片| 99国产精品久久| 久久久噜噜噜久久中文字幕色伊伊| 亚洲综合丁香婷婷六月香| 国产成人在线看| 欧美不卡视频一区| 视频一区二区不卡| 在线精品国精品国产尤物884a| 久久久久久麻豆| 国产在线麻豆精品观看| 91精品在线免费观看| 亚洲一区在线免费观看| 一本色道久久综合亚洲精品按摩| 欧美经典一区二区| 国产精品白丝av| 精品国产123| 久久国产视频网| 日韩一区和二区| 日本午夜一本久久久综合| 欧洲国产伦久久久久久久| 亚洲色图清纯唯美| 91在线视频官网| 1区2区3区欧美| 99久久99久久综合| 亚洲视频电影在线| 91亚洲大成网污www| 中文字幕中文字幕一区二区| 国产黄色精品视频| 久久久亚洲精品石原莉奈| 精品亚洲国产成人av制服丝袜| 欧美一级免费观看| 麻豆精品一区二区av白丝在线| 91麻豆精品国产91| 国产综合久久久久久鬼色| 精品久久久久99| 国产一区二区三区免费播放| 久久这里只有精品视频网| 国内精品伊人久久久久影院对白| 欧美精品一区二区三区蜜臀| 国产一区二区三区美女| 亚洲国产精品av| 91蜜桃视频在线| 亚洲成人综合视频| 欧美一区二区视频免费观看| 狠狠色狠狠色合久久伊人| 国产喷白浆一区二区三区| a美女胸又www黄视频久久| 夜色激情一区二区| 88在线观看91蜜桃国自产| 国内精品不卡在线| 日韩美女精品在线| 91精品国产品国语在线不卡| 国产美女视频91| 亚洲欧美日韩电影| 日韩欧美国产三级电影视频| 成人美女在线观看| 亚洲小说欧美激情另类| 欧美大白屁股肥臀xxxxxx| 国产福利电影一区二区三区| 亚洲综合激情小说| 久久丝袜美腿综合| 欧美性受极品xxxx喷水| 久久国产精品露脸对白| 亚洲天堂2016| 精品日韩一区二区三区| av动漫一区二区| 老司机精品视频在线| 亚洲乱码国产乱码精品精可以看| 91精品福利在线一区二区三区| 成人综合婷婷国产精品久久| 日韩影院免费视频| 亚洲男人的天堂网| 2020日本不卡一区二区视频| 欧美日韩综合不卡| 国产成人精品在线看| 日本伊人色综合网| 亚洲在线中文字幕| 国产精品伦一区| 久久这里只有精品视频网| 欧美日韩高清一区| 91免费国产视频网站| 国产精品99久久久久久久vr| 日韩精品91亚洲二区在线观看 | 午夜欧美视频在线观看| 久久一区二区三区国产精品| 正在播放一区二区| 色av综合在线| av电影在线不卡| 国产99精品国产| 精品综合免费视频观看| 偷拍一区二区三区| 亚洲一区二区不卡免费| 亚洲日本一区二区| 亚洲欧洲性图库| 中文字幕一区二区三区视频| 久久久久国色av免费看影院| 日韩精品中文字幕一区二区三区 | 青青草原综合久久大伊人精品 | 91精品国产色综合久久不卡蜜臀| 不卡免费追剧大全电视剧网站| 国产一区免费电影| 国产一区二区免费视频| 国产麻豆欧美日韩一区| 国产精品香蕉一区二区三区| 国产夫妻精品视频| 国产白丝精品91爽爽久久| 国产大陆精品国产| 成人黄色777网| 91丨porny丨国产| 在线免费观看日本一区| 在线视频观看一区| 欧美日韩一区二区电影| 777午夜精品免费视频| 欧美日韩激情一区二区三区| 欧美一区二视频| 久久久久久夜精品精品免费| 亚洲国产精品高清| 亚洲女人****多毛耸耸8| 洋洋av久久久久久久一区| 亚洲va国产天堂va久久en| 日韩av高清在线观看| 免费观看日韩av| 国产91富婆露脸刺激对白| 成人av在线资源网站| 91成人在线观看喷潮| 91精品国产欧美一区二区 | 国产精品一卡二卡在线观看| 国产v综合v亚洲欧| 一本一道久久a久久精品 | 精品三级在线看| 国产精品三级在线观看| 亚洲午夜久久久| 精品亚洲成av人在线观看| 国产精品系列在线播放| 91高清视频免费看| 欧美一区二区不卡视频| 国产欧美精品在线观看| 亚洲国产美国国产综合一区二区| 精品一区二区综合| 94-欧美-setu| 精品国产一区二区精华| 亚洲精品视频免费看| 久久不见久久见免费视频1| 97成人超碰视| 久久久久久久久伊人| 亚洲第一精品在线| 99精品热视频| 久久亚洲春色中文字幕久久久| 亚洲欧美精品午睡沙发|