Ejemplo n.º 1
0
tm_topology_t *optimize_topology(tm_topology_t *topology){
  int *arity = NULL,nb_levels;
  int *numbering = NULL,nb_nodes;
  tm_topology_t *new_topo;

  topology_arity(topology,&arity,&nb_levels);
  /*   printf("nb_levels=%d\n",nb_levels); */
  /*   for(i=0;i<nb_levels;i++) */
  /*     printf("%d:",arity[i]); */
  /*   printf("\n");   */

  topology_numbering(topology,&numbering,&nb_nodes);
  /*   printf("nb_nodes=%d\n",nb_nodes); */
  /*   for(i=0;i<nb_nodes;i++) */
  /*     printf("%d,",numbering[i]); */
  /*   printf("\n"); */

  optimize_arity(&arity,&nb_levels,nb_levels-2);
  new_topo = build_synthetic_topology(arity,nb_levels,numbering,nb_nodes);
  /* display_topology(*topology); */
  FREE(arity);
  FREE(numbering);

  return new_topo;
  /*  exit(-1); */
}
Ejemplo n.º 2
0
tm_topology_t *build_abe_topology(int nb_procs){
  int arity[4]={nb_procs,2,2,2}; /*abe memory hierarchy. Should be given by HWLOC*/
  int nbring[8]={0,2,4,6,1,3,5,7}; /*abe cores numbering. Should be given by HWLOC*/
  return build_synthetic_topology(arity,5,nbring,8);
}