Changeset 5712

Show
Ignore:
Timestamp:
11/05/09 14:24:56 (3 weeks ago)
Author:
balaji
Message:

White space cleanup.

Location:
mpich2/trunk/src/pm/hydra
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/pm/hydra/include/hydra_utils.h

    r5653 r5712  
    113113 
    114114/* Disable for now; we might add something here in the future */ 
    115 #define HYDU_FUNC_ENTER()   do{}while(0) 
    116 #define HYDU_FUNC_EXIT()    do{}while(0) 
     115#define HYDU_FUNC_ENTER()   do {} while (0) 
     116#define HYDU_FUNC_EXIT()    do {} while (0) 
    117117 
    118118 
  • mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle_v2.c

    r5699 r5712  
    181181 
    182182    if (pending_reqs) 
    183         HYDU_dump_noprefix(stdout, "( "); 
     183        HYDU_dump_noprefix(stdout, "("); 
    184184    for (req = pending_reqs; req; req = req->next) 
    185185        HYDU_dump_noprefix(stdout, "%s ", 
     
    402402    } 
    403403 
    404     if (found) {      /* We found the attribute */ 
     404    if (found) {        /* We found the attribute */ 
    405405        i = 0; 
    406406        tmp[i++] = HYDU_strdup("cmd=info-getnodeattr-response;"); 
  • mpich2/trunk/src/pm/hydra/rmk/pbs/rmk_pbs_query_node_list.c

    r5486 r5712  
    3232    } 
    3333 
    34 fn_exit: 
     34  fn_exit: 
    3535    return status; 
    3636 
    37 fn_fail: 
     37  fn_fail: 
    3838    goto fn_exit; 
    3939} 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/bind_hwloc.c

    r5709 r5712  
    1212 
    1313static hwloc_topology_t topology; 
    14 static int              topo_initialized = 0; 
     14static int topo_initialized = 0; 
    1515 
    1616HYD_status HYDT_bind_hwloc_init(HYDT_bind_support_level_t * support_level) 
    1717{ 
    18     int node,sock,core,proc,thread; 
     18    int node, sock, core, proc, thread; 
    1919 
    20     hwloc_obj_t    obj_sys; 
    21     hwloc_obj_t    obj_node; 
    22     hwloc_obj_t    obj_sock; 
    23     hwloc_obj_t    obj_core; 
    24     hwloc_obj_t    obj_proc; 
     20    hwloc_obj_t obj_sys; 
     21    hwloc_obj_t obj_node; 
     22    hwloc_obj_t obj_sock; 
     23    hwloc_obj_t obj_core; 
     24    hwloc_obj_t obj_proc; 
    2525 
    2626    struct HYDT_topo_obj *node_ptr, *sock_ptr, *core_ptr, *thread_ptr; 
    2727 
    28     HYD_status status = HYD_SUCCESS;     
     28    HYD_status status = HYD_SUCCESS; 
    2929 
    3030    HYDU_FUNC_ENTER(); 
    31      
     31 
    3232    hwloc_topology_init(&topology); 
    3333    hwloc_topology_load(topology); 
     
    3535 
    3636    /* Get the max number of processing elements */ 
    37     HYDT_bind_info.total_proc_units = hwloc_get_nbobjs_by_type(topology,HWLOC_OBJ_PROC);    
     37    HYDT_bind_info.total_proc_units = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PROC); 
    3838 
    3939    /* We have qualified for basic binding support level */ 
    4040    *support_level = HYDT_BIND_BASIC; 
    41     
    42    /* Setup the machine level */    
    43    /* get the System object */ 
    44    obj_sys = hwloc_get_system_obj(topology); 
    45    /* init Hydra structure */ 
    46    HYDT_bind_info.machine.type         = HYDT_TOPO_MACHINE; 
    47    HYDT_bind_info.machine.os_index     = -1; /* This is a set, not a single unit */ 
    48    HYDT_bind_info.machine.parent       = NULL; 
    49    HYDT_bind_info.machine.num_children = hwloc_get_nbobjs_by_type(topology,HWLOC_OBJ_NODE); 
    50    /* There is no real node, consider there is one */ 
    51    if (!HYDT_bind_info.machine.num_children) 
    52      HYDT_bind_info.machine.num_children = 1; 
    53    HYDU_MALLOC(HYDT_bind_info.machine.children, struct HYDT_topo_obj *, 
    54                sizeof(struct HYDT_topo_obj), status); 
    55    HYDT_bind_info.machine.shared_memory_depth = NULL; 
    56     
    57    /* Setup the nodes levels */ 
    58    for(node = 0 ; node < HYDT_bind_info.machine.num_children ; node++) 
    59      {   
    60         node_ptr         = &HYDT_bind_info.machine.children[node];       
    61         node_ptr->type   =  HYDT_TOPO_NODE;    
    62         node_ptr->parent = &HYDT_bind_info.machine; 
    63         obj_node = hwloc_get_obj_inside_cpuset_by_type(topology,obj_sys->cpuset,HWLOC_OBJ_NODE,node); 
    6441 
    65         if(!obj_node) 
    66           obj_node = obj_sys; 
    67         node_ptr->os_index     = obj_node->os_index;; 
    68         node_ptr->num_children =  hwloc_get_nbobjs_inside_cpuset_by_type(topology,obj_node->cpuset,HWLOC_OBJ_SOCKET); 
     42    /* Setup the machine level */ 
     43    /* get the System object */ 
     44    obj_sys = hwloc_get_system_obj(topology); 
     45    /* init Hydra structure */ 
     46    HYDT_bind_info.machine.type = HYDT_TOPO_MACHINE; 
     47    HYDT_bind_info.machine.os_index = -1;       /* This is a set, not a single unit */ 
     48    HYDT_bind_info.machine.parent = NULL; 
     49    HYDT_bind_info.machine.num_children = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_NODE); 
     50    /* There is no real node, consider there is one */ 
     51    if (!HYDT_bind_info.machine.num_children) 
     52        HYDT_bind_info.machine.num_children = 1; 
     53    HYDU_MALLOC(HYDT_bind_info.machine.children, struct HYDT_topo_obj *, 
     54                sizeof(struct HYDT_topo_obj), status); 
     55    HYDT_bind_info.machine.shared_memory_depth = NULL; 
    6956 
    70         /* In case there is no socket! */ 
    71         if(!node_ptr->num_children) 
    72           node_ptr->num_children = 1; 
    73          
    74         HYDU_MALLOC(node_ptr->children, struct HYDT_topo_obj *, 
    75                     sizeof(struct HYDT_topo_obj) * node_ptr->num_children, status); 
    76         node_ptr->shared_memory_depth = NULL; 
    77                  
    78         /* Setup the socket level */ 
    79         for (sock = 0; sock < node_ptr->num_children ; sock++)  
    80           { 
    81              sock_ptr           = &node_ptr->children[sock]; 
    82              sock_ptr->type     = HYDT_TOPO_SOCKET;           
    83              sock_ptr->parent   = node_ptr; 
    84          
    85              obj_sock = hwloc_get_obj_inside_cpuset_by_type(topology,obj_node->cpuset,HWLOC_OBJ_SOCKET,sock); 
    86              if(!obj_sock) 
    87                obj_sock = obj_node; 
    88               
    89              sock_ptr->os_index     = obj_sock->os_index;          
    90              sock_ptr->num_children = hwloc_get_nbobjs_inside_cpuset_by_type(topology,obj_sock->cpuset,HWLOC_OBJ_CORE); 
    91               
    92              /* In case there is no core! */ 
    93              if(!sock_ptr->num_children) 
    94                  sock_ptr->num_children = 1; 
     57    /* Setup the nodes levels */ 
     58    for (node = 0; node < HYDT_bind_info.machine.num_children; node++) { 
     59        node_ptr = &HYDT_bind_info.machine.children[node]; 
     60        node_ptr->type = HYDT_TOPO_NODE; 
     61        node_ptr->parent = &HYDT_bind_info.machine; 
     62        obj_node = 
     63            hwloc_get_obj_inside_cpuset_by_type(topology, obj_sys->cpuset, HWLOC_OBJ_NODE, 
     64                                                node); 
    9565 
    96              HYDU_MALLOC(sock_ptr->children, struct HYDT_topo_obj *, 
    97                          sizeof(struct HYDT_topo_obj) * sock_ptr->num_children, status); 
    98              sock_ptr->shared_memory_depth = NULL; 
    99               
    100              /* setup the core level */ 
    101              for (core = 0; core < sock_ptr->num_children; core++)  
    102                {              
    103                   core_ptr               = &sock_ptr->children[core]; 
    104                   core_ptr->type         = HYDT_TOPO_CORE; 
    105                   core_ptr->parent       = sock_ptr; 
    106                    
    107                   obj_core = hwloc_get_obj_inside_cpuset_by_type(topology,obj_sock->cpuset,HWLOC_OBJ_CORE,core);                   
    108                   if(!obj_core) 
    109                     obj_core = obj_sock; 
    110                    
    111                   core_ptr->os_index     = obj_core->os_index;     
    112                   core_ptr->num_children = hwloc_get_nbobjs_inside_cpuset_by_type(topology,obj_core->cpuset,HWLOC_OBJ_PROC); 
    113                                    
    114                   HYDU_MALLOC(core_ptr->children, struct HYDT_topo_obj *, 
    115                               sizeof(struct HYDT_topo_obj) * core_ptr->num_children, status); 
    116                   core_ptr->shared_memory_depth = NULL; 
    117                    
    118                   /* setup the thread level */ 
    119                   for (thread = 0; thread < core_ptr->num_children; thread++)  
    120                     {                   
    121                         obj_proc = hwloc_get_obj_inside_cpuset_by_type(topology,obj_core->cpuset,HWLOC_OBJ_PROC,thread);                   
    122                         thread_ptr                      = &core_ptr->children[thread]; 
    123                         thread_ptr->type                = HYDT_TOPO_THREAD; 
    124                         thread_ptr->os_index            = obj_proc->os_index; 
    125                         thread_ptr->parent              = core_ptr; 
    126                         thread_ptr->num_children        = 0; 
    127                         thread_ptr->children            = NULL; 
    128                         thread_ptr->shared_memory_depth = NULL; 
    129                         
    130                        /* 
    131                         fprintf(stdout," thread id %i | Core id %i | Socket id %i | Node id %i \n", 
    132                         obj_proc->os_index,obj_core->os_index,obj_sock->os_index,obj_node->os_index); 
    133                         */  
    134                     } 
    135                    
    136                } 
    137           } 
    138      } 
    139     
    140    /* We have qualified for topology-aware binding support level */ 
    141    *support_level = HYDT_BIND_TOPO; 
     66        if (!obj_node) 
     67            obj_node = obj_sys; 
     68        node_ptr->os_index = obj_node->os_index;; 
     69        node_ptr->num_children = 
     70            hwloc_get_nbobjs_inside_cpuset_by_type(topology, obj_node->cpuset, 
     71                                                   HWLOC_OBJ_SOCKET); 
    14272 
    143    fn_exit: 
    144    HYDU_FUNC_EXIT(); 
    145    return status; 
    146     
    147    fn_fail: 
    148    goto fn_exit; 
     73        /* In case there is no socket! */ 
     74        if (!node_ptr->num_children) 
     75            node_ptr->num_children = 1; 
     76 
     77        HYDU_MALLOC(node_ptr->children, struct HYDT_topo_obj *, 
     78                    sizeof(struct HYDT_topo_obj) * node_ptr->num_children, status); 
     79        node_ptr->shared_memory_depth = NULL; 
     80 
     81        /* Setup the socket level */ 
     82        for (sock = 0; sock < node_ptr->num_children; sock++) { 
     83            sock_ptr = &node_ptr->children[sock]; 
     84            sock_ptr->type = HYDT_TOPO_SOCKET; 
     85            sock_ptr->parent = node_ptr; 
     86 
     87            obj_sock = 
     88                hwloc_get_obj_inside_cpuset_by_type(topology, obj_node->cpuset, 
     89                                                    HWLOC_OBJ_SOCKET, sock); 
     90            if (!obj_sock) 
     91                obj_sock = obj_node; 
     92 
     93            sock_ptr->os_index = obj_sock->os_index; 
     94            sock_ptr->num_children = 
     95                hwloc_get_nbobjs_inside_cpuset_by_type(topology, obj_sock->cpuset, 
     96                                                       HWLOC_OBJ_CORE); 
     97 
     98            /* In case there is no core! */ 
     99            if (!sock_ptr->num_children) 
     100                sock_ptr->num_children = 1; 
     101 
     102            HYDU_MALLOC(sock_ptr->children, struct HYDT_topo_obj *, 
     103                        sizeof(struct HYDT_topo_obj) * sock_ptr->num_children, status); 
     104            sock_ptr->shared_memory_depth = NULL; 
     105 
     106            /* setup the core level */ 
     107            for (core = 0; core < sock_ptr->num_children; core++) { 
     108                core_ptr = &sock_ptr->children[core]; 
     109                core_ptr->type = HYDT_TOPO_CORE; 
     110                core_ptr->parent = sock_ptr; 
     111 
     112                obj_core = 
     113                    hwloc_get_obj_inside_cpuset_by_type(topology, obj_sock->cpuset, 
     114                                                        HWLOC_OBJ_CORE, core); 
     115                if (!obj_core) 
     116                    obj_core = obj_sock; 
     117 
     118                core_ptr->os_index = obj_core->os_index; 
     119                core_ptr->num_children = 
     120                    hwloc_get_nbobjs_inside_cpuset_by_type(topology, obj_core->cpuset, 
     121                                                           HWLOC_OBJ_PROC); 
     122 
     123                HYDU_MALLOC(core_ptr->children, struct HYDT_topo_obj *, 
     124                            sizeof(struct HYDT_topo_obj) * core_ptr->num_children, status); 
     125                core_ptr->shared_memory_depth = NULL; 
     126 
     127                /* setup the thread level */ 
     128                for (thread = 0; thread < core_ptr->num_children; thread++) { 
     129                    obj_proc = 
     130                        hwloc_get_obj_inside_cpuset_by_type(topology, obj_core->cpuset, 
     131                                                            HWLOC_OBJ_PROC, thread); 
     132                    thread_ptr = &core_ptr->children[thread]; 
     133                    thread_ptr->type = HYDT_TOPO_THREAD; 
     134                    thread_ptr->os_index = obj_proc->os_index; 
     135                    thread_ptr->parent = core_ptr; 
     136                    thread_ptr->num_children = 0; 
     137                    thread_ptr->children = NULL; 
     138                    thread_ptr->shared_memory_depth = NULL; 
     139 
     140                    /* 
     141                     * fprintf(stdout," thread id %i | Core id %i | Socket id %i | Node id %i \n", 
     142                     * obj_proc->os_index,obj_core->os_index,obj_sock->os_index,obj_node->os_index); 
     143                     */ 
     144                } 
     145 
     146            } 
     147        } 
     148    } 
     149 
     150    /* We have qualified for topology-aware binding support level */ 
     151    *support_level = HYDT_BIND_TOPO; 
     152 
     153  fn_exit: 
     154    HYDU_FUNC_EXIT(); 
     155    return status; 
     156 
     157  fn_fail: 
     158    goto fn_exit; 
    149159} 
    150160 
     
    156166 
    157167    HYDU_FUNC_ENTER(); 
    158      
     168 
    159169    /* If the specified core is negative, we just ignore it */ 
    160170    if (core < 0) 
    161171        goto fn_exit; 
    162         
    163     hwloc_cpuset_set (cpuset, core); 
    164     if (!topo_initialized) 
    165      { 
    166         hwloc_topology_init(&topology); 
    167         hwloc_topology_load(topology); 
    168         topo_initialized = 1; 
    169      } 
    170     hwloc_set_cpubind(topology,cpuset,HWLOC_CPUBIND_THREAD); 
    171172 
    172     
     173    hwloc_cpuset_set(cpuset, core); 
     174    if (!topo_initialized) { 
     175        hwloc_topology_init(&topology); 
     176        hwloc_topology_load(topology); 
     177        topo_initialized = 1; 
     178    } 
     179    hwloc_set_cpubind(topology, cpuset, HWLOC_CPUBIND_THREAD); 
     180 
     181 
    173182  fn_exit: 
    174183    hwloc_cpuset_free(cpuset); 
  • mpich2/trunk/src/pm/hydra/tools/bind/plpa/bind_plpa.c

    r5653 r5712  
    4343    /* Setup the machine level */ 
    4444    HYDT_bind_info.machine.type = HYDT_TOPO_MACHINE; 
    45     HYDT_bind_info.machine.os_index = -1; /* This is a set, not a single unit */ 
     45    HYDT_bind_info.machine.os_index = -1;       /* This is a set, not a single unit */ 
    4646    HYDT_bind_info.machine.parent = NULL; 
    4747    HYDT_bind_info.machine.num_children = 1; 
     
    5454    node->type = HYDT_TOPO_NODE; 
    5555    node->os_index = -1; 
    56     node->parent =  &HYDT_bind_info.machine; 
     56    node->parent = &HYDT_bind_info.machine; 
    5757    ret = PLPA_NAME(get_socket_info) (&node->num_children, &max); 
    5858    if (ret) { 
  • mpich2/trunk/src/pm/hydra/ui/mpiexec/utils.c

    r5681 r5712  
    875875    } 
    876876 
    877     HYDU_dump_noprefix(stdout, 
    878                        "HYDRA build details:\n"); 
     877    HYDU_dump_noprefix(stdout, "HYDRA build details:\n"); 
    879878    HYDU_dump_noprefix(stdout, 
    880879                       "    Version:                                 %s\n", HYDRA_VERSION); 
    881     HYDU_dump_noprefix(stdout, 
    882                        "    CC:                                      %s\n", HYDRA_CC); 
    883     HYDU_dump_noprefix(stdout, 
    884                        "    CXX:                                     %s\n", HYDRA_CXX); 
    885     HYDU_dump_noprefix(stdout, 
    886                        "    F77:                                     %s\n", HYDRA_F77); 
    887     HYDU_dump_noprefix(stdout, 
    888                        "    F90:                                     %s\n", HYDRA_F90); 
     880    HYDU_dump_noprefix(stdout, "    CC:                                      %s\n", HYDRA_CC); 
     881    HYDU_dump_noprefix(stdout, "    CXX:                                     %s\n", HYDRA_CXX); 
     882    HYDU_dump_noprefix(stdout, "    F77:                                     %s\n", HYDRA_F77); 
     883    HYDU_dump_noprefix(stdout, "    F90:                                     %s\n", HYDRA_F90); 
    889884    HYDU_dump_noprefix(stdout, 
    890885                       "    Configure options:                       %s\n", 
    891886                       HYDRA_CONFIGURE_ARGS_CLEAN); 
     887    HYDU_dump_noprefix(stdout, "    Process Manager:                         pmi\n"); 
    892888    HYDU_dump_noprefix(stdout, 
    893                        "    Process Manager:                         pmi\n"); 
    894     HYDU_dump_noprefix(stdout, 
    895                        "    Boot-strap servers available:            %s\n", 
    896                        HYDRA_BSS_NAMES); 
    897     HYDU_dump_noprefix(stdout, 
    898                        "    Communication sub-systems available:     none\n"); 
     889                       "    Boot-strap servers available:            %s\n", HYDRA_BSS_NAMES); 
     890    HYDU_dump_noprefix(stdout, "    Communication sub-systems available:     none\n"); 
    899891    HYDU_dump_noprefix(stdout, 
    900892                       "    Binding libraries available:             %s\n", 
  • mpich2/trunk/src/pm/hydra/utils/others/others.c

    r5485 r5712  
    4949 
    5050HYD_status HYDU_add_to_proxy_list(char *hostname, int num_procs, 
    51                                   struct HYD_proxy **proxy_list) 
     51                                  struct HYD_proxy ** proxy_list) 
    5252{ 
    5353    static int pid = 0;