예제 #1
0
static void action_compute(const char *const *action)
{
  double clock = smpi_process_simulated_elapsed();
  smpi_execute_flops(parse_double(action[2]));

  log_timed_action (action, clock);
}
예제 #2
0
static void smpi_execute(double duration)
{
  if (duration >= xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold")) {
    XBT_DEBUG("Sleep for %f to handle real computation time", duration);
    smpi_execute_flops(duration *
                       xbt_cfg_get_double(_surf_cfg_set,
                                          "smpi/running_power"));
  }
}
예제 #3
0
static void action_compute(const char *const *action)
{
  double clock = smpi_process_simulated_elapsed();
  smpi_execute_flops(parse_double(action[2]));

  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
    char *name = xbt_str_join_array(action, " ");
    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
    free(name);
  }
}
예제 #4
0
static void smpi_execute(double duration)
{
  /* FIXME: a global variable would be less expensive to consult than a call to xbt_cfg_get_double() right on the critical path */
  if (duration >= surf_cfg_get_double("smpi/cpu_threshold")) {
    XBT_DEBUG("Sleep for %f to handle real computation time", duration);
    smpi_execute_flops(duration *
    		surf_cfg_get_double("smpi/running_power"));
  } else {
    XBT_DEBUG("Real computation took %f while option smpi/cpu_threshold is set to %f => ignore it",
        duration, surf_cfg_get_double("smpi/cpu_threshold"));
  }
}
예제 #5
0
static void action_compute(const char *const *action)
{
  CHECK_ACTION_PARAMS(action, 1, 0);
  double clock = smpi_process_simulated_elapsed();
  double flops= parse_double(action[2]);
  int rank = smpi_process_index();
  instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
  extra->type=TRACING_COMPUTING;
  extra->comp_size=flops;
  TRACE_smpi_computing_in(rank, extra);

  smpi_execute_flops(flops);

  TRACE_smpi_computing_out(rank);
  log_timed_action (action, clock);
}
예제 #6
0
void Timer::simulateComputeTime(bool doComm, compute_t *_exec) {
  int sleep_duration = 0;

  comp_time = sleep_duration = getCompTime();

#ifdef SMPI_SIMULATION_ACTIVATED
  #ifdef SMPI_SIMULATION_TIME_INDEPENDENT
  long long flops = getNumInst();
  if (flops < 0) {
	cerr << "PAPI num instruction overflow!" << endl;
	exit(1);
  }
  //cout << "Simulating " << flops*1000.0 << " flops" << endl;
  smpi_execute_flops(flops*1000.0);	// Re-multiplying by 1000 (we had divided to avoid overflows)
  #else
  smpi_execute((double)comp_time / 1000000.0);
  #endif
  leftover = 0;
#else
  if(doComm)
    sleep_duration += getCommTime();
  sleep_duration -= getTime ();
  sleep_duration += leftover;
  /*if(my_rank == doTestFor){
		cout << comp_time << "   " << sleep_duration << endl;
	}*/

  if(sleep_duration > 0 && _exec){
    ( *(_exec->func) )( _exec->param );
    sleep_duration = getCompTime();
    if(doComm)
      sleep_duration += getCommTime();
    sleep_duration -= getTime();
    sleep_duration += leftover;
  }
  leftover = 0;

  if (sleep_duration > 0){
    leftover = busyWait(sleep_duration);
  } else {
    leftover = sleep_duration;
  }
#endif
}
예제 #7
0
static void action_allReduce(const char *const *action) {
  double comm_size = parse_double(action[2]);
  double comp_size = parse_double(action[3]);
  double clock = smpi_process_simulated_elapsed();
#ifdef HAVE_TRACING
  int rank = smpi_comm_rank(MPI_COMM_WORLD);
  TRACE_smpi_computing_out(rank);
  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
  smpi_mpi_reduce(NULL, NULL, comm_size, MPI_BYTE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
  smpi_execute_flops(comp_size);
  smpi_mpi_bcast(NULL, comm_size, MPI_BYTE, 0, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
  TRACE_smpi_computing_in(rank);
#endif

  if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
    char *name = xbt_str_join_array(action, " ");
    XBT_VERB("%s %f", name, smpi_process_simulated_elapsed()-clock);
    free(name);
  }
}
예제 #8
0
void smpi_sample_flops(double flops)
{
  smpi_execute_flops(flops);
}