コード例 #1
0
ファイル: sg_emul.c プロジェクト: rosacris/simgrid
void gras_emul_exit(void)
{
  if (locbuf)
    free(locbuf);
  xbt_dict_free(&benchmark_set);
  xbt_os_timer_free(timer);
}
コード例 #2
0
ファイル: smpi_global.cpp プロジェクト: krytarowski/simgrid
void smpi_global_destroy(void)
{
  int count = smpi_process_count();
  int i;

  smpi_bench_destroy();
  if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){
      while (smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD)) > 0);
      xbt_barrier_destroy(process_data[0]->finalization_barrier);
  }else{
      smpi_deployment_cleanup_instances();
  }
  for (i = 0; i < count; i++) {
    if(process_data[i]->comm_self!=MPI_COMM_NULL){
      smpi_comm_destroy(process_data[i]->comm_self);
    }
    if(process_data[i]->comm_intra!=MPI_COMM_NULL){
      smpi_comm_destroy(process_data[i]->comm_intra);
    }
    xbt_os_timer_free(process_data[i]->timer);
    xbt_mutex_destroy(process_data[i]->mailboxes_mutex);
    xbt_free(process_data[i]);
  }
  xbt_free(process_data);
  process_data = NULL;

  if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){
    smpi_comm_cleanup_smp(MPI_COMM_WORLD);
    smpi_comm_cleanup_attributes(MPI_COMM_WORLD);
    if(smpi_coll_cleanup_callback!=NULL)
      smpi_coll_cleanup_callback();
    xbt_free(MPI_COMM_WORLD);
  }

  MPI_COMM_WORLD = MPI_COMM_NULL;

  if (!MC_is_active()) {
    xbt_os_timer_free(global_timer);
  }

  xbt_free(index_to_process_data);
  if(smpi_privatize_global_variables)
    smpi_destroy_global_memory_segments();
  smpi_free_static();
}