コード例 #1
0
void populateJobs(RunManager &rm, bool bulkadd, const openstudio::path &t_model, int number)
{
  std::vector<openstudio::runmanager::Job> jobs;

  openstudio::runmanager::ConfigOptions co;
  co.fastFindEnergyPlus();

  for (int i = 0; i < number; ++i)
  {
    boost::timer t;
    Workflow wf("Null->Null->ModelToIdf->ExpandObjects->EnergyPlusPreProcess->EnergyPlus->EnergyPlusPostProcess");

    
    // keep filepaths short enough for Windows
    JobParams params;
    std::stringstream ss;
    ss << i;
    params.append("jobnumber", ss.str());
    params.append(JobParam("flatoutdir"));

    wf.add(co.getTools());
    wf.add(params);

    openstudio::runmanager::Job j = wf.create(openstudio::toPath("ClearJobsPerformanceTest"), t_model);
    LOG_FREE(Info, "RunManagerTiming", "Time to create job: " << t.elapsed());

    if (!bulkadd)
    {
      rm.enqueue(j, true);
    } else {
      jobs.push_back(j);
    }

    LOG_FREE(Info, "RunManagerTiming", "Total Time to crate Job: " << t.elapsed());
  }

  if (bulkadd)
  {
    rm.enqueue(jobs, true);
  }
}
コード例 #2
0
void populateJobs(RunManager &rm)
{
  for (int i = 1; i < 31; ++i)
  {
    Workflow wf;
    for (int j = 0; j < i; ++j)
    {
      wf.addJob(JobType::Null);
    }
    // keep filepaths short enough for Windows
    wf.addParam(runmanager::JobParam("flatoutdir"));
    rm.enqueue(wf.create(openstudio::toPath("ClearJobsPerformanceTest")), true);
  }
}