Exemplo n.º 1
0
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_free(MPI_COMM_WORLD);
      xbt_barrier_destroy(process_data[0]->finalization_barrier);
  }else{
      smpi_deployment_cleanup_instances();
  }
  MPI_COMM_WORLD = MPI_COMM_NULL;
  for (i = 0; i < count; i++) {
    if(process_data[i]->comm_self!=MPI_COMM_NULL){
      smpi_group_unuse(smpi_comm_group(process_data[i]->comm_self));
      smpi_comm_destroy(process_data[i]->comm_self);
    }
    if(process_data[i]->comm_intra!=MPI_COMM_NULL){
      smpi_group_unuse(smpi_comm_group(process_data[i]->comm_intra));
      smpi_comm_destroy(process_data[i]->comm_intra);
    }
    xbt_os_timer_free(process_data[i]->timer);
    simcall_rdv_destroy(process_data[i]->mailbox);
    simcall_rdv_destroy(process_data[i]->mailbox_small);
    xbt_mutex_destroy(process_data[i]->mailboxes_mutex);
    xbt_free(process_data[i]);
  }
  xbt_free(process_data);
  process_data = NULL;

  xbt_free(index_to_process_data);
  if(smpi_privatize_global_variables)
    smpi_destroy_global_memory_segments();
  smpi_free_static();
}
Exemplo n.º 2
0
void MSG_mailbox_free(void *mailbox)
{
  simcall_rdv_destroy((msg_mailbox_t)mailbox);
}