Changeset 3763

Show
Ignore:
Timestamp:
01/29/09 20:11:30 (3 weeks ago)
Author:
balaji
Message:

Moved the network module directory structure to remove the unnecessary "_module" tag. Made similar appropriate changes to the function and datatype names as well. The newgm module is left alone, as it's not in the configuration path, and will probably be deleted. The wintcp module is not changed either, as the naming convention for it is different from the rest of the modules.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mpich2/trunk/maint/createcoverage.in

    r3751 r3763  
    209209    ch3:nemesis) 
    210210    # FIXME: Add the other directories 
    211     devsrcdirs="src/mpid/ch3/channels/nemesis/src src/mpid/ch3/src src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp_module src/mpid/ch3/channels/nemesis/nemesis/src" 
     211    devsrcdirs="src/mpid/ch3/channels/nemesis/src src/mpid/ch3/src src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp src/mpid/ch3/channels/nemesis/nemesis/src" 
    212212    extra_opts="$extra_opts --enable-nemesis-dbg-localoddeven" 
    213213    ;; 
  • mpich2/trunk/src/mpi/errhan/errnames.txt

    r3699 r3763  
    901901**cookiepkt:failure occurred while attempting to send COOKIE packet 
    902902**donepkt:failure occurred while attempting to send DONE packet 
    903 **psm_module_connect:psm_module_connect failed 
    904 **psm_module_connect %d: psm_module_connect failed (%d) 
     903**psm_connect:psm_connect failed 
     904**psm_connect %d: psm_connect failed (%d) 
    905905**decode_buffer:decode_buffer failed 
    906906**decode_buffer %d:decode_buffer failed (%d) 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/configure.in

    r3751 r3763  
    179179for net in $nemesis_networks ; do 
    180180 
    181     if test ! -d $srcdir/nemesis/net_mod/${net}_module ; then 
    182         AC_MSG_ERROR([Network module ${net} is unknown  $srcdir/nemesis/net_mod/${net}_module ]) 
     181    if test ! -d $srcdir/nemesis/net_mod/${net} ; then 
     182        AC_MSG_ERROR([Network module ${net} is unknown  $srcdir/nemesis/net_mod/${net} ]) 
    183183    fi 
    184184    net_macro=`echo $net | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 
    185     net_macro="MPIDI_NEM_${net_macro}_MODULE
     185    net_macro="MPIDI_NEM_${net_macro}
    186186 
    187187    if test -z "$nemesis_nets_array" ; then 
     
    198198 
    199199    if test -z "$nemesis_nets_dirs" ; then 
    200         nemesis_nets_dirs="${net}_module
    201     else 
    202         nemesis_nets_dirs="$nemesis_nets_dirs ${net}_module
     200        nemesis_nets_dirs="${net}
     201    else 
     202        nemesis_nets_dirs="$nemesis_nets_dirs ${net}
    203203    fi 
    204204 
    205205    if test -z "$nemesis_nets_func_decl" ; then 
    206         nemesis_nets_func_decl="MPIDI_nem_${net}_module_funcs" 
    207     else 
    208         nemesis_nets_func_decl="${nemesis_nets_func_decl}, MPIDI_nem_${net}_module_funcs" 
     206        nemesis_nets_func_decl="MPIDI_nem_${net}_funcs" 
     207    else 
     208        nemesis_nets_func_decl="${nemesis_nets_func_decl}, MPIDI_nem_${net}_funcs" 
    209209    fi 
    210210 
    211211    if test -z "$nemesis_nets_func_array" ; then 
    212         nemesis_nets_func_array="&MPIDI_nem_${net}_module_funcs" 
    213     else 
    214         nemesis_nets_func_array="${nemesis_nets_func_array}, &MPIDI_nem_${net}_module_funcs" 
     212        nemesis_nets_func_array="&MPIDI_nem_${net}_funcs" 
     213    else 
     214        nemesis_nets_func_array="${nemesis_nets_func_array}, &MPIDI_nem_${net}_funcs" 
    215215    fi 
    216216 
     
    277277case "${nemesis_network}" in 
    278278     elan ) 
    279           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_ELAN_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     279          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_ELAN, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    280280     gm ) 
    281           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_GM_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     281          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_GM, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    282282     mx ) 
    283           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_MX_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     283          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_MX, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    284284     tcp ) 
    285           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_TCP_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     285          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_TCP, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    286286     ib ) 
    287           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_IB_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     287          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_IB, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    288288     psm ) 
    289           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_PSM_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     289          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_PSM, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    290290     * ) 
    291           AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_NO_MODULE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
     291          AC_DEFINE(MPID_NEM_NET_MODULE, MPID_NEM_NONE, [Choose elan, gm, mx, tcp, ib, psm, or no network]) ;; 
    292292esac 
    293293 
     
    521521PAC_SUBCONFIG_FINALIZE() 
    522522 
    523 AC_OUTPUT(Makefile src/Makefile nemesis/Makefile nemesis/src/Makefile nemesis/utils/Makefile nemesis/utils/replacements/Makefile nemesis/utils/monitor/Makefile nemesis/net_mod/Makefile nemesis/net_mod/elan_module/Makefile  nemesis/net_mod/gm_module/Makefile nemesis/net_mod/mx_module/Makefile nemesis/net_mod/tcp_module/Makefile nemesis/net_mod/ib_module/Makefile nemesis/net_mod/psm_module/Makefile nemesis/net_mod/none_module/Makefile localdefs nemesis/include/mpid_nem_net_module_defs.h nemesis/src/mpid_nem_net_array.c) 
     523AC_OUTPUT(Makefile src/Makefile nemesis/Makefile nemesis/src/Makefile nemesis/utils/Makefile nemesis/utils/replacements/Makefile nemesis/utils/monitor/Makefile nemesis/net_mod/Makefile nemesis/net_mod/elan/Makefile  nemesis/net_mod/gm/Makefile nemesis/net_mod/mx/Makefile nemesis/net_mod/tcp/Makefile nemesis/net_mod/ib/Makefile nemesis/net_mod/psm/Makefile nemesis/net_mod/none/Makefile localdefs nemesis/include/mpid_nem_net_module_defs.h nemesis/src/mpid_nem_net_array.c) 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/Makefile.sm

    r3751 r3763  
    1 SUBDIRS_nemesis_nets_dirs = elan_module gm_module mx_module tcp_module ib_module none_module psm_module 
     1SUBDIRS_nemesis_nets_dirs = elan gm mx tcp ib none psm 
    22SUBDIRS = @nemesis_nets_dirs@ 
    33 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/Makefile.sm

    r188 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   elan_module_finalize.c  elan_module_init.c  elan_module_poll.c      elan_module_send.c \ 
    5   elan_module_register.c  elan_module_test.c 
     4  elan_finalize.c  elan_init.c  elan_poll.c      elan_send.c \ 
     5  elan_register.c  elan_test.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_finalize.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "elan_module_impl.h" 
     7#include "elan_impl.h" 
    88#include <elan/elan.h> 
    99 
    1010 
    1111#undef FUNCNAME 
    12 #define FUNCNAME MPID_nem_elan_module_finalize 
     12#define FUNCNAME MPID_nem_elan_finalize 
    1313#undef FCNAME 
    1414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1515int 
    16 MPID_nem_elan_module_finalize() 
     16MPID_nem_elan_finalize() 
    1717{ 
    1818   int mpi_errno = MPI_SUCCESS; 
     
    2222         while ( !MPID_nem_elan_event_queue_empty(MPID_nem_module_elan_pending_event_queue)) 
    2323          { 
    24              MPID_nem_elan_module_poll(MPID_NEM_POLL_OUT); 
     24             MPID_nem_elan_poll(MPID_NEM_POLL_OUT); 
    2525          } 
    2626 
     
    4242 
    4343#undef FUNCNAME 
    44 #define FUNCNAME MPID_nem_elan_module_ckpt_shutdown 
     44#define FUNCNAME MPID_nem_elan_ckpt_shutdown 
    4545#undef FCNAME 
    4646#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    4747int 
    48 MPID_nem_elan_module_ckpt_shutdown () 
     48MPID_nem_elan_ckpt_shutdown () 
    4949{ 
    5050   int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_impl.h

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #ifndef ELAN_MODULE_IMPL_H 
    8 #define ELAN_MODULE_IMPL_H 
     7#ifndef ELAN_IMPL_H 
     8#define ELAN_IMPL_H 
    99 
    1010#include <elan/elan.h> 
    1111#include "mpid_nem_impl.h" 
    1212 
    13 int MPID_nem_elan_module_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
     13int MPID_nem_elan_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
    1414                               int num_proc_elements, MPID_nem_cell_ptr_t module_elements, int num_module_elements, 
    1515                               MPID_nem_queue_ptr_t *module_free_queue, int ckpt_restart, 
    1616                               MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p); 
    17 int MPID_nem_elan_module_finalize (void); 
    18 int MPID_nem_elan_module_ckpt_shutdown (void); 
    19 int MPID_nem_elan_module_poll(MPID_nem_poll_dir_t in_or_out); 
    20 int MPID_nem_elan_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    21 int MPID_nem_elan_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    22 int MPID_nem_elan_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    23 int MPID_nem_elan_module_vc_init (MPIDI_VC_t *vc); 
    24 int MPID_nem_elan_module_vc_destroy(MPIDI_VC_t *vc); 
    25 int MPID_nem_elan_module_vc_terminate (MPIDI_VC_t *vc); 
     17int MPID_nem_elan_finalize (void); 
     18int MPID_nem_elan_ckpt_shutdown (void); 
     19int MPID_nem_elan_poll(MPID_nem_poll_dir_t in_or_out); 
     20int MPID_nem_elan_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     21int MPID_nem_elan_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     22int MPID_nem_elan_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     23int MPID_nem_elan_vc_init (MPIDI_VC_t *vc); 
     24int MPID_nem_elan_vc_destroy(MPIDI_VC_t *vc); 
     25int MPID_nem_elan_vc_terminate (MPIDI_VC_t *vc); 
    2626 
    27 int  MPID_nem_elan_module_test (void); 
     27int  MPID_nem_elan_test (void); 
    2828 
    29 int  MPID_mem_elan_module_register_mem (void *p, int len); 
    30 int  MPID_nem_elan_module_deregister_mem (void *p, int len); 
     29int  MPID_mem_elan_register_mem (void *p, int len); 
     30int  MPID_nem_elan_deregister_mem (void *p, int len); 
    3131 
    3232/* completion counter is atomically decremented when operation completes */ 
    33 int  MPID_nem_elan_module_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
    34 int  MPID_nem_elan_module_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
     33int  MPID_nem_elan_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
     34int  MPID_nem_elan_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
    3535 
    3636/* large message transfer functions */ 
    37 int  MPID_nem_elan_module_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
    38 int  MPID_nem_elan_module_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
    39 int  MPID_nem_elan_module_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    40 int  MPID_nem_elan_module_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    41 int  MPID_nem_elan_module_lmt_send_post (struct iovec cookie); 
    42 int  MPID_nem_elan_module_lmt_recv_post (struct iovec cookie); 
     37int  MPID_nem_elan_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
     38int  MPID_nem_elan_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
     39int  MPID_nem_elan_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     40int  MPID_nem_elan_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     41int  MPID_nem_elan_lmt_send_post (struct iovec cookie); 
     42int  MPID_nem_elan_lmt_recv_post (struct iovec cookie); 
    4343 
    4444 
     
    6363    void *rxq_ptr_array;  
    6464    int   vpid; 
    65 } MPID_nem_elan_module_vc_area; 
     65} MPID_nem_elan_vc_area; 
    6666 
    6767/* accessor macro to private fields in VC */ 
    68 #define VC_FIELD(vc, field) (((MPID_nem_elan_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     68#define VC_FIELD(vc, field) (((MPID_nem_elan_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    6969 
    7070typedef struct MPID_nem_elan_cell 
     
    143143extern MPID_nem_queue_ptr_t MPID_nem_process_free_queue; 
    144144 
    145 #endif /*ELAN_MODULE_IMPL_H */ 
     145#endif /*ELAN_IMPL_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_init.c

    • Property svn:mergeinfo set
    r3391 r3763  
    1111#include "mpidimpl.h" 
    1212#include "mpid_nem_impl.h" 
    13 #include "elan_module_impl.h" 
    14  
    15 MPID_nem_netmod_funcs_t MPIDI_nem_elan_module_funcs = { 
    16     MPID_nem_elan_module_init, 
    17     MPID_nem_elan_module_finalize, 
    18     MPID_nem_elan_module_ckpt_shutdown, 
    19     MPID_nem_elan_module_poll, 
    20     MPID_nem_elan_module_send, 
    21     MPID_nem_elan_module_get_business_card, 
    22     MPID_nem_elan_module_connect_to_root, 
    23     MPID_nem_elan_module_vc_init, 
    24     MPID_nem_elan_module_vc_destroy, 
    25     MPID_nem_elan_module_vc_terminate 
     13#include "elan_impl.h" 
     14 
     15MPID_nem_netmod_funcs_t MPIDI_nem_elan_funcs = { 
     16    MPID_nem_elan_init, 
     17    MPID_nem_elan_finalize, 
     18    MPID_nem_elan_ckpt_shutdown, 
     19    MPID_nem_elan_poll, 
     20    MPID_nem_elan_send, 
     21    MPID_nem_elan_get_business_card, 
     22    MPID_nem_elan_connect_to_root, 
     23    MPID_nem_elan_vc_init, 
     24    MPID_nem_elan_vc_destroy, 
     25    MPID_nem_elan_vc_terminate 
    2626}; 
    2727 
     
    234234/* 
    235235 int   
    236    MPID_nem_elan_module_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
     236   MPID_nem_elan_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
    237237                  MPID_nem_cell_ptr_t module_elements, int num_module_elements,  
    238238                  MPID_nem_queue_ptr_t *module_free_queue) 
     
    253253 
    254254#undef FUNCNAME 
    255 #define FUNCNAME MPID_nem_mx_module_init 
     255#define FUNCNAME MPID_nem_elan_init 
    256256#undef FCNAME 
    257257#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    258258int 
    259 MPID_nem_elan_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     259MPID_nem_elan_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    260260                MPID_nem_queue_ptr_t proc_free_queue,  
    261261                MPID_nem_cell_ptr_t proc_elements,   int num_proc_elements, 
     
    269269    
    270270   /* first make sure that our private fields in the vc fit into the area provided  */ 
    271    MPIU_Assert(sizeof(MPID_nem_elan_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     271   MPIU_Assert(sizeof(MPID_nem_elan_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    272272 
    273273   if( MPID_nem_mem_region.ext_procs > 0) 
    274274     { 
    275275        init_elan(pg_p); 
    276         mpi_errno = MPID_nem_elan_module_get_business_card (pg_rank, bc_val_p, val_max_sz_p); 
     276        mpi_errno = MPID_nem_elan_get_business_card (pg_rank, bc_val_p, val_max_sz_p); 
    277277        if (mpi_errno) MPIU_ERR_POP (mpi_errno);                 
    278278     }    
     
    297297 
    298298#undef FUNCNAME 
    299 #define FUNCNAME MPID_nem_elan_module_get_business_card 
     299#define FUNCNAME MPID_nem_elan_get_business_card 
    300300#undef FCNAME 
    301301#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    302302int 
    303   MPID_nem_elan_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
     303  MPID_nem_elan_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
    304304{ 
    305305   int mpi_errno = MPI_SUCCESS; 
     
    343343 
    344344#undef FUNCNAME 
    345 #define FUNCNAME MPID_nem_elan_module_get_from_bc 
     345#define FUNCNAME MPID_nem_elan_get_from_bc 
    346346#undef FCNAME 
    347347#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    348348int 
    349 MPID_nem_elan_module_get_from_bc (const char *business_card,ELAN_QUEUE **remoteq_ptr, int *vpid) 
     349MPID_nem_elan_get_from_bc (const char *business_card,ELAN_QUEUE **remoteq_ptr, int *vpid) 
    350350{ 
    351351   int mpi_errno = MPI_SUCCESS; 
     
    375375 
    376376#undef FUNCNAME 
    377 #define FUNCNAME MPID_nem_elan_module_connect_to_root 
     377#define FUNCNAME MPID_nem_elan_connect_to_root 
    378378#undef FCNAME 
    379379#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    380380int 
    381 MPID_nem_elan_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
     381MPID_nem_elan_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
    382382{ 
    383383   int mpi_errno = MPI_SUCCESS; 
     
    389389 
    390390#undef FUNCNAME 
    391 #define FUNCNAME MPID_nem_elan_module_vc_init 
     391#define FUNCNAME MPID_nem_elan_vc_init 
    392392#undef FCNAME 
    393393#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    394394int 
    395 MPID_nem_elan_module_vc_init (MPIDI_VC_t *vc, const char *business_card) 
     395MPID_nem_elan_vc_init (MPIDI_VC_t *vc, const char *business_card) 
    396396{ 
    397397   int mpi_errno = MPI_SUCCESS;    
     
    402402        int         vpid; 
    403403           
    404         mpi_errno = MPID_nem_elan_module_get_from_bc (business_card, &remoteq_ptr, &vpid); 
     404        mpi_errno = MPID_nem_elan_get_from_bc (business_card, &remoteq_ptr, &vpid); 
    405405        /* --BEGIN ERROR HANDLING-- */    
    406406        if (mpi_errno)  
     
    423423 
    424424#undef FUNCNAME 
    425 #define FUNCNAME MPID_nem_elan_module_vc_destroy 
    426 #undef FCNAME 
    427 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    428 int MPID_nem_elan_module_vc_destroy(MPIDI_VC_t *vc) 
     425#define FUNCNAME MPID_nem_elan_vc_destroy 
     426#undef FCNAME 
     427#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     428int MPID_nem_elan_vc_destroy(MPIDI_VC_t *vc) 
    429429{ 
    430430    int mpi_errno = MPI_SUCCESS;    
     
    436436 
    437437#undef FUNCNAME 
    438 #define FUNCNAME MPID_nem_elan_module_vc_terminate 
    439 #undef FCNAME 
    440 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    441 int MPID_nem_elan_module_vc_terminate (MPIDI_VC_t *vc) 
     438#define FUNCNAME MPID_nem_elan_vc_terminate 
     439#undef FCNAME 
     440#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     441int MPID_nem_elan_vc_terminate (MPIDI_VC_t *vc) 
    442442{ 
    443443    return MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_poll.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "elan_module_impl.h" 
     7#include "elan_impl.h" 
    88#include <elan/elan.h> 
    99#include "my_papi_defs.h" 
     
    3535 
    3636#undef FUNCNAME 
    37 #define FUNCNAME MPID_nem_elan_module_send_from_queue 
     37#define FUNCNAME MPID_nem_elan_send_from_queue 
    3838#undef FCNAME 
    3939#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    4040inline int 
    41 MPID_nem_elan_module_send_from_queue( void ) 
     41MPID_nem_elan_send_from_queue( void ) 
    4242{    
    4343   int mpi_errno = MPI_SUCCESS; 
     
    9595 
    9696#undef FUNCNAME 
    97 #define FUNCNAME MPID_nem_elan_module_recv 
     97#define FUNCNAME MPID_nem_elan_recv 
    9898#undef FCNAME 
    9999#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    100100inline int  
    101 MPID_nem_elan_module_recv( void ) 
     101MPID_nem_elan_recv( void ) 
    102102{ 
    103103   int mpi_errno = MPI_SUCCESS; 
     
    120120 
    121121#undef FUNCNAME 
    122 #define FUNCNAME MPID_nem_elan_module_poll 
     122#define FUNCNAME MPID_nem_elan_poll 
    123123#undef FCNAME 
    124124#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    125125int 
    126 MPID_nem_elan_module_poll(MPID_nem_poll_dir_t in_or_out) 
     126MPID_nem_elan_poll(MPID_nem_poll_dir_t in_or_out) 
    127127{ 
    128128   int mpi_errno = MPI_SUCCESS; 
     
    132132        if (in_or_out == MPID_NEM_POLL_OUT) 
    133133          { 
    134              MPID_nem_elan_module_send_from_queue(); 
    135              MPID_nem_elan_module_recv(); 
     134             MPID_nem_elan_send_from_queue(); 
     135             MPID_nem_elan_recv(); 
    136136          } 
    137137        else 
    138138          { 
    139              MPID_nem_elan_module_recv(); 
    140              MPID_nem_elan_module_send_from_queue(); 
     139             MPID_nem_elan_recv(); 
     140             MPID_nem_elan_send_from_queue(); 
    141141          } 
    142142     } 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_register.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "elan_module_impl.h" 
     7#include "elan_impl.h" 
    88#include <elan/elan.h> 
    99 
    1010int 
    11 MPID_nem_elan_module_register_mem (void *p, int len) 
     11MPID_nem_elan_register_mem (void *p, int len) 
    1212{ 
    1313   return 0; 
     
    1515 
    1616int 
    17 MPID_nem_elan_module_deregister_mem (void *p, int len) 
     17MPID_nem_elan_deregister_mem (void *p, int len) 
    1818{ 
    1919   return 0; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_send.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "elan_module_impl.h" 
     7#include "elan_impl.h" 
    88#include <elan/elan.h> 
    99#include "my_papi_defs.h" 
     
    1111 
    1212#undef FUNCNAME 
    13 #define FUNCNAME MPID_nem_elan_module_send 
     13#define FUNCNAME MPID_nem_elan_send 
    1414#undef FCNAME 
    1515#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1616int  
    17 MPID_nem_elan_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
     17MPID_nem_elan_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
    1818{    
    1919   MPID_nem_elan_cell_ptr_t elan_event_cell; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/elan/elan_test.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "elan_module_impl.h" 
     7#include "elan_impl.h" 
    88#include <elan/elan.h> 
    99 
    1010int 
    11 MPID_nem_mx_module_test() 
     11MPID_nem_elan_test() 
    1212{ 
    1313    return 0;  
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/Makefile.sm

    r100 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   gm_module_finalize.c  gm_module_init.c  gm_module_poll.c      gm_module_send.c \ 
    5   gm_module_getput.c    gm_module_lmt.c   gm_module_register.c  gm_module_test.c 
     4  gm_finalize.c  gm_init.c  gm_poll.c      gm_send.c \ 
     5  gm_getput.c    gm_lmt.c   gm_register.c  gm_test.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_finalize.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99#undef FUNCNAME 
    10 #define FUNCNAME MPID_nem_gm_module_finalize 
     10#define FUNCNAME MPID_nem_gm_finalize 
    1111#undef FCNAME 
    1212#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1313int 
    14 MPID_nem_gm_module_finalize() 
     14MPID_nem_gm_finalize() 
    1515{ 
    1616    int mpi_errno = MPI_SUCCESS; 
    1717    int max_send_tokens; 
    18     MPID_nem_gm_module_send_queue_t *e; 
     18    MPID_nem_gm_send_queue_t *e; 
    1919 
    2020    max_send_tokens = gm_num_send_tokens (MPID_nem_module_gm_port); 
    2121     
    22     while (MPID_nem_module_gm_num_send_tokens < max_send_tokens && !MPID_nem_gm_module_queue_empty (send)) 
     22    while (MPID_nem_module_gm_num_send_tokens < max_send_tokens && !MPID_nem_gm_queue_empty (send)) 
    2323    { 
    24         mpi_errno = MPID_nem_gm_module_recv_poll(); 
     24        mpi_errno = MPID_nem_gm_recv_poll(); 
    2525        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    2626    } 
    2727     
    28     while (MPID_nem_gm_module_send_free_queue) 
     28    while (MPID_nem_gm_send_free_queue) 
    2929    { 
    30         e = MPID_nem_gm_module_send_free_queue; 
    31         MPID_nem_gm_module_send_free_queue = e->next; 
     30        e = MPID_nem_gm_send_free_queue; 
     31        MPID_nem_gm_send_free_queue = e->next; 
    3232        MPIU_Free (e); 
    3333    } 
    3434     
    35     mpi_errno = MPID_nem_gm_module_lmt_finalize(); 
     35    mpi_errno = MPID_nem_gm_lmt_finalize(); 
    3636    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    3737 
     
    4545 
    4646#undef FUNCNAME 
    47 #define FUNCNAME MPID_nem_gm_module_ckpt_shutdown 
     47#define FUNCNAME MPID_nem_gm_ckpt_shutdown 
    4848#undef FCNAME 
    4949#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    5050int 
    51 MPID_nem_gm_module_ckpt_shutdown () 
     51MPID_nem_gm_ckpt_shutdown () 
    5252{ 
    5353    /* for GM we can't touch the network because the original process is still using it */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_getput.c

    • Property svn:mergeinfo set
    r2924 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99static void 
     
    2222 
    2323int 
    24 MPID_nem_gm_module_do_get (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr) 
     24MPID_nem_gm_do_get (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr) 
    2525{ 
    2626/*     gm_get (MPID_nem_module_gm_port, (long)source_p, target_p, len, GM_LOW_PRIORITY, node_id, port_id, getput_callback, completion_ctr); */ 
     
    3131 
    3232int 
    33 MPID_nem_gm_module_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr) 
     33MPID_nem_gm_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr) 
    3434{ 
    3535    int ret; 
     
    5959    if (MPID_nem_module_gm_num_send_tokens) 
    6060    { 
    61         MPID_nem_gm_module_do_get (target_p, source_p, len, VC_FIELD(source_vc, gm_node_id), VC_FIELD(source_vc, gm_port_id), completion_ctr); 
     61        MPID_nem_gm_do_get (target_p, source_p, len, VC_FIELD(source_vc, gm_node_id), VC_FIELD(source_vc, gm_port_id), completion_ctr); 
    6262    } 
    6363    else 
    6464    { 
    65         MPID_nem_gm_module_send_queue_t *e = MPID_nem_gm_module_queue_alloc (send); 
     65        MPID_nem_gm_send_queue_t *e = MPID_nem_gm_queue_alloc (send); 
    6666 
    6767        e->type = SEND_TYPE_RDMA; 
     
    7373        e->port_id = VC_FIELD(source_vc, gm_port_id); 
    7474        e->u.rdma.completion_ctr = completion_ctr; 
    75         MPID_nem_gm_module_queue_enqueue (send, e); 
     75        MPID_nem_gm_queue_enqueue (send, e); 
    7676    } 
    7777     
     
    8080 
    8181int 
    82 MPID_nem_gm_module_do_put (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr) 
     82MPID_nem_gm_do_put (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr) 
    8383{ 
    8484/*     gm_put (MPID_nem_module_gm_port, source_p, (long)target_p, len, GM_LOW_PRIORITY, node_id, port_id, getput_callback, completion_ctr); */ 
     
    8989 
    9090int 
    91 MPID_nem_gm_module_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr) 
     91MPID_nem_gm_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr) 
    9292{ 
    9393    int ret; 
     
    104104    if (MPID_nem_module_gm_num_send_tokens) 
    105105    { 
    106         MPID_nem_gm_module_do_put (target_p, source_p, len, VC_FIELD(target_vc, gm_node_id), VC_FIELD(target_vc, gm_port_id), completion_ctr); 
     106        MPID_nem_gm_do_put (target_p, source_p, len, VC_FIELD(target_vc, gm_node_id), VC_FIELD(target_vc, gm_port_id), completion_ctr); 
    107107    } 
    108108    else 
    109109    { 
    110         MPID_nem_gm_module_send_queue_t *e = MPID_nem_gm_module_queue_alloc (send); 
     110        MPID_nem_gm_send_queue_t *e = MPID_nem_gm_queue_alloc (send); 
    111111 
    112112        e->type = SEND_TYPE_RDMA; 
     
    118118        e->port_id = VC_FIELD(target_vc, gm_port_id); 
    119119        e->u.rdma.completion_ctr = completion_ctr; 
    120         MPID_nem_gm_module_queue_enqueue (send, e); 
     120        MPID_nem_gm_queue_enqueue (send, e); 
    121121    } 
    122122    return 0; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_impl.h

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #ifndef GM_MODULE_IMPL_H 
    8 #define GM_MODULE_IMPL_H 
     7#ifndef GM_IMPL_H 
     8#define GM_IMPL_H 
    99#include <gm.h> 
    1010#include "mpid_nem_impl.h" 
     
    3333extern MPID_nem_queue_ptr_t MPID_nem_process_free_queue; 
    3434 
    35 int MPID_nem_gm_module_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
     35int MPID_nem_gm_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
    3636                             int num_proc_elements, MPID_nem_cell_ptr_t module_elements, int num_module_elements, 
    3737                             MPID_nem_queue_ptr_t *module_free_queue, int ckpt_restart, 
    3838                             MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p); 
    39 int MPID_nem_gm_module_finalize (void); 
    40 int MPID_nem_gm_module_ckpt_shutdown (void); 
    41 int MPID_nem_gm_module_poll (MPID_nem_poll_dir_t in_or_out); 
    42 int MPID_nem_gm_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    43 int MPID_nem_gm_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    44 int MPID_nem_gm_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    45 int MPID_nem_gm_module_vc_init (MPIDI_VC_t *vc); 
    46 int MPID_nem_gm_module_vc_destroy(MPIDI_VC_t *vc); 
    47 int MPID_nem_gm_module_vc_terminate (MPIDI_VC_t *vc); 
    48  
    49 int MPID_nem_gm_module_test (void); 
    50  
    51 int MPID_mem_gm_module_register_mem (void *p, int len); 
    52 int MPID_nem_gm_module_deregister_mem (void *p, int len); 
     39int MPID_nem_gm_finalize (void); 
     40int MPID_nem_gm_ckpt_shutdown (void); 
     41int MPID_nem_gm_poll (MPID_nem_poll_dir_t in_or_out); 
     42int MPID_nem_gm_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     43int MPID_nem_gm_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     44int MPID_nem_gm_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     45int MPID_nem_gm_vc_init (MPIDI_VC_t *vc); 
     46int MPID_nem_gm_vc_destroy(MPIDI_VC_t *vc); 
     47int MPID_nem_gm_vc_terminate (MPIDI_VC_t *vc); 
     48 
     49int MPID_nem_gm_test (void); 
     50 
     51int MPID_mem_gm_register_mem (void *p, int len); 
     52int MPID_nem_gm_deregister_mem (void *p, int len); 
    5353 
    5454/* completion counter is atomically decremented when operation completes */ 
    55 int MPID_nem_gm_module_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
    56 int MPID_nem_gm_module_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
     55int MPID_nem_gm_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
     56int MPID_nem_gm_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
    5757 
    5858/* large message transfer functions */ 
    59 int MPID_nem_gm_module_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
    60 int MPID_nem_gm_module_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
    61 int MPID_nem_gm_module_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    62 int MPID_nem_gm_module_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    63 int MPID_nem_gm_module_lmt_send_post (struct iovec cookie); 
    64 int MPID_nem_gm_module_lmt_recv_post (struct iovec cookie); 
    65  
    66 int MPID_nem_gm_module_recv_poll(); 
    67 inline int MPID_nem_gm_module_recv(); 
     59int MPID_nem_gm_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
     60int MPID_nem_gm_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
     61int MPID_nem_gm_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     62int MPID_nem_gm_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     63int MPID_nem_gm_lmt_send_post (struct iovec cookie); 
     64int MPID_nem_gm_lmt_recv_post (struct iovec cookie); 
     65 
     66int MPID_nem_gm_recv_poll(); 
     67inline int MPID_nem_gm_recv(); 
    6868inline int MPID_nem_send_from_queue(); 
    6969 
    70 int MPID_nem_gm_module_recv_init(); 
    71  
    72 int MPID_nem_gm_module_lmt_init(); 
    73 int MPID_nem_gm_module_lmt_finalize(); 
    74 int MPID_nem_gm_module_lmt_do_get (int node_id, int port_id, struct iovec **r_iov, int *r_n_iov, int *r_offset, struct iovec **s_iov, int *s_n_iov, 
     70int MPID_nem_gm_recv_init(); 
     71 
     72int MPID_nem_gm_lmt_init(); 
     73int MPID_nem_gm_lmt_finalize(); 
     74int MPID_nem_gm_lmt_do_get (int node_id, int port_id, struct iovec **r_iov, int *r_n_iov, int *r_offset, struct iovec **s_iov, int *s_n_iov, 
    7575                          int *s_offset, int *compl_ctr); 
    7676 
    7777/* these perform the gm_put or gm_get call, there must be at least one send token  */ 
    78 /* called by MPID_nem_gm_module_put and _get and by polling functions */ 
    79 int MPID_nem_gm_module_do_put (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr); 
    80 int MPID_nem_gm_module_do_get (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr); 
     78/* called by MPID_nem_gm_put and _get and by polling functions */ 
     79int MPID_nem_gm_do_put (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr); 
     80int MPID_nem_gm_do_get (void *target_p, void *source_p, int len, int node_id, int port_id, int *completion_ctr); 
    8181 
    8282/* gm module packet */ 
     
    9898    unsigned source_id;  
    9999    unsigned char gm_unique_id[6]; /* GM unique id length is 6 bytes.  GM doesn't define a constant. */ 
    100 } MPID_nem_gm_module_vc_area; 
     100} MPID_nem_gm_vc_area; 
    101101 
    102102/* accessor macro to private fields in VC */ 
    103 #define VC_FIELD(vc, field) (((MPID_nem_gm_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     103#define VC_FIELD(vc, field) (((MPID_nem_gm_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    104104 
    105105 
    106106/* lmt queues */ 
    107107 
    108 typedef struct MPID_nem_gm_module_lmt_queue 
     108typedef struct MPID_nem_gm_lmt_queue 
    109109{ 
    110110    int node_id; 
     
    117117    int s_offset; 
    118118    int *compl_ctr; 
    119     struct MPID_nem_gm_module_lmt_queue *next; 
    120 } 
    121 MPID_nem_gm_module_lmt_queue_t; 
    122  
    123 typedef struct MPID_nem_gm_module_lmt_queue_head 
    124 { 
    125     MPID_nem_gm_module_lmt_queue_t *head; 
    126     MPID_nem_gm_module_lmt_queue_t *tail; 
    127 } 
    128 MPID_nem_gm_module_lmt_queue_head_t; 
    129  
    130 extern MPID_nem_gm_module_lmt_queue_head_t MPID_nem_gm_module_lmt_queue; 
    131 extern MPID_nem_gm_module_lmt_queue_t *MPID_nem_gm_module_lmt_free_queue; 
    132  
    133  
    134  
    135 typedef struct MPID_nem_gm_module_rdma_desc 
     119    struct MPID_nem_gm_lmt_queue *next; 
     120} 
     121MPID_nem_gm_lmt_queue_t; 
     122 
     123typedef struct MPID_nem_gm_lmt_queue_head 
     124{ 
     125    MPID_nem_gm_lmt_queue_t *head; 
     126    MPID_nem_gm_lmt_queue_t *tail; 
     127} 
     128MPID_nem_gm_lmt_queue_head_t; 
     129 
     130extern MPID_nem_gm_lmt_queue_head_t MPID_nem_gm_lmt_queue; 
     131extern MPID_nem_gm_lmt_queue_t *MPID_nem_gm_lmt_free_queue; 
     132 
     133 
     134 
     135typedef struct MPID_nem_gm_rdma_desc 
    136136{ 
    137137    enum {RDMA_TYPE_PUT, RDMA_TYPE_GET} type; 
     
    141141    int *completion_ctr; 
    142142} 
    143 MPID_nem_gm_module_rdma_desc_t; 
    144  
    145 typedef struct MPID_nem_gm_module_send_queue 
    146 { 
    147     struct MPID_nem_gm_module_send_queue *next; 
     143MPID_nem_gm_rdma_desc_t; 
     144 
     145typedef struct MPID_nem_gm_send_queue 
     146{ 
     147    struct MPID_nem_gm_send_queue *next; 
    148148    int node_id; 
    149149    int port_id; 
     
    152152    { 
    153153        MPID_nem_cell_t *cell; 
    154         MPID_nem_gm_module_rdma_desc_t rdma; 
     154        MPID_nem_gm_rdma_desc_t rdma; 
    155155    } u; 
    156156} 
    157 MPID_nem_gm_module_send_queue_t; 
    158  
    159 typedef struct MPID_nem_gm_module_send_queue_head 
    160 { 
    161     MPID_nem_gm_module_send_queue_t *head; 
    162     MPID_nem_gm_module_send_queue_t *tail; 
    163 } 
    164 MPID_nem_gm_module_send_queue_head_t; 
    165  
    166 extern MPID_nem_gm_module_send_queue_head_t MPID_nem_gm_module_send_queue; 
    167 extern MPID_nem_gm_module_send_queue_t *MPID_nem_gm_module_send_free_queue; 
    168  
    169  
    170  
    171 #define MPID_nem_gm_module_queue_empty(queue) (MPID_nem_gm_module_##queue##_queue.head == NULL) 
    172 #define MPID_nem_gm_module_queue_head(queue) (MPID_nem_gm_module_##queue##_queue.head) 
    173 #define MPID_nem_gm_module_queue_dequeue(queue, e) do {                                       \ 
    174     *(e) = MPID_nem_gm_module_##queue##_queue.head;                                   \ 
     157MPID_nem_gm_send_queue_t; 
     158 
     159typedef struct MPID_nem_gm_send_queue_head 
     160{ 
     161    MPID_nem_gm_send_queue_t *head; 
     162    MPID_nem_gm_send_queue_t *tail; 
     163} 
     164MPID_nem_gm_send_queue_head_t; 
     165 
     166extern MPID_nem_gm_send_queue_head_t MPID_nem_gm_send_queue; 
     167extern MPID_nem_gm_send_queue_t *MPID_nem_gm_send_free_queue; 
     168 
     169 
     170 
     171#define MPID_nem_gm_queue_empty(queue) (MPID_nem_gm_##queue##_queue.head == NULL) 
     172#define MPID_nem_gm_queue_head(queue) (MPID_nem_gm_##queue##_queue.head) 
     173#define MPID_nem_gm_queue_dequeue(queue, e) do {                                      \ 
     174    *(e) = MPID_nem_gm_##queue##_queue.head;                                  \ 
    175175    if (*(e))                                                                   \ 
    176176    {                                                                           \ 
    177         MPID_nem_gm_module_##queue##_queue.head = MPID_nem_gm_module_##queue##_queue.head->next;      \ 
    178         if (MPID_nem_gm_module_##queue##_queue.head == NULL)                          \ 
    179             MPID_nem_gm_module_##queue##_queue.tail = NULL;                           \ 
     177        MPID_nem_gm_##queue##_queue.head = MPID_nem_gm_##queue##_queue.head->next;    \ 
     178        if (MPID_nem_gm_##queue##_queue.head == NULL)                         \ 
     179            MPID_nem_gm_##queue##_queue.tail = NULL;                          \ 
    180180    }                                                                           \ 
    181181} while (0) 
    182182 
    183 #define MPID_nem_gm_module_queue_enqueue(queue, e) do {               \ 
    184     if (MPID_nem_gm_module_##queue##_queue.tail == NULL)              \ 
    185         MPID_nem_gm_module_##queue##_queue.head = e;          \ 
     183#define MPID_nem_gm_queue_enqueue(queue, e) do {              \ 
     184    if (MPID_nem_gm_##queue##_queue.tail == NULL)             \ 
     185        MPID_nem_gm_##queue##_queue.head = e;         \ 
    186186    else                                                \ 
    187         MPID_nem_gm_module_##queue##_queue.tail->next = e;    \ 
    188     MPID_nem_gm_module_##queue##_queue.tail = e;                      \ 
     187        MPID_nem_gm_##queue##_queue.tail->next = e;   \ 
     188    MPID_nem_gm_##queue##_queue.tail = e;                     \ 
    189189    (e)->next = NULL;                                   \ 
    190190} while (0) 
    191191 
    192 #define MPID_nem_gm_module_queue_free(queue, e) /*free (e)*/ do {     \ 
    193     (e)->next = MPID_nem_gm_module_##queue##_free_queue;                      \ 
    194     MPID_nem_gm_module_##queue##_free_queue = e;                              \ 
     192#define MPID_nem_gm_queue_free(queue, e) /*free (e)*/ do {    \ 
     193    (e)->next = MPID_nem_gm_##queue##_free_queue;                     \ 
     194    MPID_nem_gm_##queue##_free_queue = e;                             \ 
    195195} while (0) 
    196196 
    197 #define MPID_nem_gm_module_queue_alloc(queue) ({                                                              \ 
    198     MPID_nem_gm_module_##queue##_queue_t *e;                                                          \ 
    199     if (MPID_nem_gm_module_##queue##_free_queue)                                                              \ 
     197#define MPID_nem_gm_queue_alloc(queue) ({                                                             \ 
     198    MPID_nem_gm_##queue##_queue_t *e;                                                                 \ 
     199    if (MPID_nem_gm_##queue##_free_queue)                                                             \ 
    200200    {                                                                                           \ 
    201         e = MPID_nem_gm_module_##queue##_free_queue;                                                  \ 
    202         MPID_nem_gm_module_##queue##_free_queue = MPID_nem_gm_module_##queue##_free_queue->next;                      \ 
     201        e = MPID_nem_gm_##queue##_free_queue;                                                 \ 
     202        MPID_nem_gm_##queue##_free_queue = MPID_nem_gm_##queue##_free_queue->next;                    \ 
    203203    }                                                                                           \ 
    204204    else                                                                                        \ 
    205205    {                                                                                           \ 
    206         e = (MPID_nem_gm_module_##queue##_queue_t *)MPIU_Malloc (sizeof (MPID_nem_gm_module_##queue##_queue_t));      \ 
     206        e = (MPID_nem_gm_##queue##_queue_t *)MPIU_Malloc (sizeof (MPID_nem_gm_##queue##_queue_t));    \ 
    207207    }                                                                                           \ 
    208208    e;                                                                                          \ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_init.c

    • Property svn:mergeinfo set
    r3270 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
    8  
    9 MPID_nem_netmod_funcs_t MPIDI_nem_gm_module_funcs = { 
    10     MPID_nem_gm_module_init, 
    11     MPID_nem_gm_module_finalize, 
    12     MPID_nem_gm_module_ckpt_shutdown, 
    13     MPID_nem_gm_module_poll, 
    14     MPID_nem_gm_module_send, 
    15     MPID_nem_gm_module_get_business_card, 
    16     MPID_nem_gm_module_connect_to_root, 
    17     MPID_nem_gm_module_vc_init, 
    18     MPID_nem_gm_module_vc_destroy, 
    19     MPID_nem_gm_module_vc_terminate 
     7#include "gm_impl.h" 
     8 
     9MPID_nem_netmod_funcs_t MPIDI_nem_gm_funcs = { 
     10    MPID_nem_gm_init, 
     11    MPID_nem_gm_finalize, 
     12    MPID_nem_gm_ckpt_shutdown, 
     13    MPID_nem_gm_poll, 
     14    MPID_nem_gm_send, 
     15    MPID_nem_gm_get_business_card, 
     16    MPID_nem_gm_connect_to_root, 
     17    MPID_nem_gm_vc_init, 
     18    MPID_nem_gm_vc_destroy, 
     19    MPID_nem_gm_vc_terminate 
    2020}; 
    2121 
     
    3737 
    3838#define FREE_SEND_QUEUE_ELEMENTS MPID_NEM_NUM_CELLS 
    39 MPID_nem_gm_module_send_queue_head_t MPID_nem_gm_module_send_queue = {0}; 
    40 MPID_nem_gm_module_send_queue_t *MPID_nem_gm_module_send_free_queue = 0; 
     39MPID_nem_gm_send_queue_head_t MPID_nem_gm_send_queue = {0}; 
     40MPID_nem_gm_send_queue_t *MPID_nem_gm_send_free_queue = 0; 
    4141 
    4242static int my_pg_rank; 
     
    9898/* 
    9999   int   
    100    MPID_nem_gm_module_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
     100   MPID_nem_gm_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
    101101                  MPID_nem_cell_ptr_t module_elements, int num_module_elements, 
    102102                  MPID_nem_queue_ptr_t *module_free_queue) 
     
    117117 
    118118#undef FUNCNAME 
    119 #define FUNCNAME MPID_nem_gm_module_init 
    120 #undef FCNAME 
    121 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    122 int 
    123 MPID_nem_gm_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     119#define FUNCNAME MPID_nem_gm_init 
     120#undef FCNAME 
     121#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     122int 
     123MPID_nem_gm_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    124124                         MPID_nem_queue_ptr_t proc_free_queue,  
    125125                         MPID_nem_cell_ptr_t proc_elements,   int num_proc_elements, 
     
    136136 
    137137    /* first make sure that our private fields in the vc fit into the area provided  */ 
    138     MPIU_Assert(sizeof(MPID_nem_gm_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     138    MPIU_Assert(sizeof(MPID_nem_gm_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    139139 
    140140    my_pg_rank = pg_rank; 
     
    143143    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    144144 
    145     mpi_errno = MPID_nem_gm_module_get_business_card(pg_rank, bc_val_p, val_max_sz_p); 
     145    mpi_errno = MPID_nem_gm_get_business_card(pg_rank, bc_val_p, val_max_sz_p); 
    146146    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    147147 
     
    153153    MPID_nem_module_gm_num_send_tokens = gm_num_send_tokens(MPID_nem_module_gm_port); 
    154154 
    155     mpi_errno = MPID_nem_gm_module_recv_init(); 
     155    mpi_errno = MPID_nem_gm_recv_init(); 
    156156    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    157157 
    158     MPID_nem_gm_module_send_queue.head = NULL; 
    159     MPID_nem_gm_module_send_queue.tail = NULL; 
    160  
    161     MPID_nem_gm_module_send_free_queue = NULL; 
     158    MPID_nem_gm_send_queue.head = NULL; 
     159    MPID_nem_gm_send_queue.tail = NULL; 
     160 
     161    MPID_nem_gm_send_free_queue = NULL; 
    162162     
    163163    for (i = 0; i < FREE_SEND_QUEUE_ELEMENTS; ++i) 
    164164    { 
    165         MPID_nem_gm_module_send_queue_t *e; 
     165        MPID_nem_gm_send_queue_t *e; 
    166166         
    167         e = MPIU_Malloc (sizeof (MPID_nem_gm_module_send_queue_t)); 
    168         if (e == NULL) MPIU_CHKMEM_SETERR (mpi_errno, sizeof (MPID_nem_gm_module_send_queue_t), "gm module send queue"); 
    169         e->next = MPID_nem_gm_module_send_free_queue; 
    170         MPID_nem_gm_module_send_free_queue = e; 
    171     } 
    172      
    173     mpi_errno = MPID_nem_gm_module_lmt_init(); 
     167        e = MPIU_Malloc (sizeof (MPID_nem_gm_send_queue_t)); 
     168        if (e == NULL) MPIU_CHKMEM_SETERR (mpi_errno, sizeof (MPID_nem_gm_send_queue_t), "gm module send queue"); 
     169        e->next = MPID_nem_gm_send_free_queue; 
     170        MPID_nem_gm_send_free_queue = e; 
     171    } 
     172     
     173    mpi_errno = MPID_nem_gm_lmt_init(); 
    174174    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    175175 
     
    183183 
    184184#undef FUNCNAME 
    185 #define FUNCNAME MPID_nem_gm_module_get_business_card 
    186 #undef FCNAME 
    187 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    188 int 
    189 MPID_nem_gm_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
     185#define FUNCNAME MPID_nem_gm_get_business_card 
     186#undef FCNAME 
     187#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     188int 
     189MPID_nem_gm_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
    190190{ 
    191191    int mpi_errno = MPI_SUCCESS; 
     
    219219 
    220220#undef FUNCNAME 
    221 #define FUNCNAME MPID_nem_gm_module_get_port_unique_from_bc 
    222 #undef FCNAME 
    223 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    224 int 
    225 MPID_nem_gm_module_get_port_unique_from_bc (const char *business_card, unsigned *port_id, unsigned char *unique_id) 
     221#define FUNCNAME MPID_nem_gm_get_port_unique_from_bc 
     222#undef FCNAME 
     223#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     224int 
     225MPID_nem_gm_get_port_unique_from_bc (const char *business_card, unsigned *port_id, unsigned char *unique_id) 
    226226{ 
    227227    int mpi_errno = MPI_SUCCESS; 
     
    249249 
    250250#undef FUNCNAME 
    251 #define FUNCNAME MPID_nem_gm_module_connect_to_root 
    252 #undef FCNAME 
    253 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    254 int 
    255 MPID_nem_gm_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
     251#define FUNCNAME MPID_nem_gm_connect_to_root 
     252#undef FCNAME 
     253#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     254int 
     255MPID_nem_gm_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
    256256{ 
    257257    /* In GM, once the VC is initialized there's nothing extra that we need to do to establish a connection */ 
     
    260260 
    261261#undef FUNCNAME 
    262 #define FUNCNAME MPID_nem_gm_module_vc_init 
    263 #undef FCNAME 
    264 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    265 int 
    266 MPID_nem_gm_module_vc_init(MPIDI_VC_t *vc) 
     262#define FUNCNAME MPID_nem_gm_vc_init 
     263#undef FCNAME 
     264#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     265int 
     266MPID_nem_gm_vc_init(MPIDI_VC_t *vc) 
    267267{     
    268268    int mpi_errno = MPI_SUCCESS; 
     
    282282    VC_FIELD(vc, source_id) = my_pg_rank; /* FIXME: this is only valid for processes in COMM_WORLD */ 
    283283 
    284     mpi_errno = MPID_nem_gm_module_get_port_unique_from_bc (business_card, &VC_FIELD(vc, gm_port_id), VC_FIELD(vc, gm_unique_id)); 
     284    mpi_errno = MPID_nem_gm_get_port_unique_from_bc (business_card, &VC_FIELD(vc, gm_port_id), VC_FIELD(vc, gm_unique_id)); 
    285285    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    286286 
     
    302302 
    303303#undef FUNCNAME 
    304 #define FUNCNAME MPID_nem_gm_module_vc_destroy 
    305 #undef FCNAME 
    306 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    307 int MPID_nem_gm_module_vc_destroy(MPIDI_VC_t *vc) 
     304#define FUNCNAME MPID_nem_gm_vc_destroy 
     305#undef FCNAME 
     306#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     307int MPID_nem_gm_vc_destroy(MPIDI_VC_t *vc) 
    308308{ 
    309309    int mpi_errno = MPI_SUCCESS;    
     
    315315 
    316316#undef FUNCNAME 
    317 #define FUNCNAME MPID_nem_gm_module_vc_terminate 
    318 #undef FCNAME 
    319 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    320 int MPID_nem_gm_module_vc_terminate (MPIDI_VC_t *vc) 
     317#define FUNCNAME MPID_nem_gm_vc_terminate 
     318#undef FCNAME 
     319#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     320int MPID_nem_gm_vc_terminate (MPIDI_VC_t *vc) 
    321321{ 
    322322    return MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_lmt.c

    • Property svn:mergeinfo set
    r2924 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99#define FREE_LMT_QUEUE_ELEMENTS MPID_NEM_NUM_CELLS 
    1010 
    11 MPID_nem_gm_module_lmt_queue_head_t MPID_nem_gm_module_lmt_queue = {0}; 
    12 MPID_nem_gm_module_lmt_queue_t *MPID_nem_gm_module_lmt_free_queue = 0; 
     11MPID_nem_gm_lmt_queue_head_t MPID_nem_gm_lmt_queue = {0}; 
     12MPID_nem_gm_lmt_queue_t *MPID_nem_gm_lmt_free_queue = 0; 
    1313 
    1414#undef FUNCNAME 
    15 #define FUNCNAME MPID_nem_gm_module_lmt_init 
     15#define FUNCNAME MPID_nem_gm_lmt_init 
    1616#undef FCNAME 
    1717#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1818int 
    19 MPID_nem_gm_module_lmt_init() 
     19MPID_nem_gm_lmt_init() 
    2020{ 
    2121    int mpi_errno = MPI_SUCCESS; 
    2222    int i; 
    2323     
    24     MPID_nem_gm_module_lmt_queue.head = NULL; 
    25     MPID_nem_gm_module_lmt_queue.tail = NULL; 
    26  
    27     MPID_nem_gm_module_lmt_free_queue = NULL; 
     24    MPID_nem_gm_lmt_queue.head = NULL; 
     25    MPID_nem_gm_lmt_queue.tail = NULL; 
     26 
     27    MPID_nem_gm_lmt_free_queue = NULL; 
    2828     
    2929    for (i = 0; i < FREE_LMT_QUEUE_ELEMENTS; ++i) 
    3030    { 
    31         MPID_nem_gm_module_lmt_queue_t *e; 
     31        MPID_nem_gm_lmt_queue_t *e; 
    3232         
    33         e = MPIU_Malloc (sizeof (MPID_nem_gm_module_lmt_queue_t)); 
    34         if (e == NULL) MPIU_CHKMEM_SETERR (mpi_errno, sizeof (MPID_nem_gm_module_send_queue_t), "gm module lmt queue"); 
    35         e->next = MPID_nem_gm_module_lmt_free_queue; 
    36         MPID_nem_gm_module_lmt_free_queue = e; 
     33        e = MPIU_Malloc (sizeof (MPID_nem_gm_lmt_queue_t)); 
     34        if (e == NULL) MPIU_CHKMEM_SETERR (mpi_errno, sizeof (MPID_nem_gm_send_queue_t), "gm module lmt queue"); 
     35        e->next = MPID_nem_gm_lmt_free_queue; 
     36        MPID_nem_gm_lmt_free_queue = e; 
    3737    } 
    3838 
     
    4444 
    4545int 
    46 MPID_nem_gm_module_lmt_finalize() 
    47 { 
    48     MPID_nem_gm_module_lmt_queue_t *e; 
    49  
    50     while (MPID_nem_gm_module_lmt_free_queue) 
    51     { 
    52         e = MPID_nem_gm_module_lmt_free_queue; 
    53         MPID_nem_gm_module_lmt_free_queue = e->next; 
     46MPID_nem_gm_lmt_finalize() 
     47{ 
     48    MPID_nem_gm_lmt_queue_t *e; 
     49 
     50    while (MPID_nem_gm_lmt_free_queue) 
     51    { 
     52        e = MPID_nem_gm_lmt_free_queue; 
     53        MPID_nem_gm_lmt_free_queue = e->next; 
    5454        MPIU_Free (e); 
    5555    } 
     
    5959 
    6060static inline int 
    61 MPID_nem_gm_module_lmt_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *remote_vc, struct iovec *cookie) 
     61MPID_nem_gm_lmt_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *remote_vc, struct iovec *cookie) 
    6262{ 
    6363    int ret = 0; 
     
    6767    for (i = 0; i < n_iov; ++i) 
    6868    { 
    69         ret = MPID_nem_gm_module_register_mem (iov[i].iov_base, iov[i].iov_len); 
     69        ret = MPID_nem_gm_register_mem (iov[i].iov_base, iov[i].iov_len); 
    7070        if (ret != 0) 
    7171        { 
     
    8989    for (j = i-1; j <= 0; --j) 
    9090    { 
    91         MPID_nem_gm_module_deregister_mem (iov[j].iov_base, iov[j].iov_len); 
     91        MPID_nem_gm_deregister_mem (iov[j].iov_base, iov[j].iov_len); 
    9292    } 
    9393 
     
    9696 
    9797int 
    98 MPID_nem_gm_module_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie) 
    99 { 
    100     return MPID_nem_gm_module_lmt_pre (iov, n_iov, dest, cookie); 
    101 } 
    102  
    103 int 
    104 MPID_nem_gm_module_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie) 
    105 { 
    106     return MPID_nem_gm_module_lmt_pre (iov, n_iov, src, cookie); 
    107 } 
    108  
    109 int 
    110 MPID_nem_gm_module_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr) 
     98MPID_nem_gm_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie) 
     99{ 
     100    return MPID_nem_gm_lmt_pre (iov, n_iov, dest, cookie); 
     101} 
     102 
     103int 
     104MPID_nem_gm_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie) 
     105{ 
     106    return MPID_nem_gm_lmt_pre (iov, n_iov, src, cookie); 
     107} 
     108 
     109int 
     110MPID_nem_gm_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr) 
    111111{ 
    112112    /* We're using gets to transfer the data so, this should not be called */ 
     
    115115 
    116116int 
    117 MPID_nem_gm_module_lmt_start_recv (MPIDI_VC_t *src_vc, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr) 
     117MPID_nem_gm_lmt_start_recv (MPIDI_VC_t *src_vc, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr) 
    118118{ 
    119119    int ret; 
     
    132132    s_offset = 0; 
    133133     
    134     ret = MPID_nem_gm_module_lmt_do_get (VC_FIELD(src_vc, gm_node_id), VC_FIELD(src_vc, gm_port_id), &r_iov, &r_n_iov, &r_offset, &s_iov, &s_n_iov, &s_offset, 
     134    ret = MPID_nem_gm_lmt_do_get (VC_FIELD(src_vc, gm_node_id), VC_FIELD(src_vc, gm_port_id), &r_iov, &r_n_iov, &r_offset, &s_iov, &s_n_iov, &s_offset, 
    135135                                completion_ctr); 
    136136    if (ret == LMT_AGAIN) 
    137137    { 
    138         MPID_nem_gm_module_lmt_queue_t *e = MPID_nem_gm_module_queue_alloc (lmt); 
     138        MPID_nem_gm_lmt_queue_t *e = MPID_nem_gm_queue_alloc (lmt); 
    139139        if (!e) 
    140140        { 
     
    151151        e->s_offset = s_offset; 
    152152        e->compl_ctr = completion_ctr; 
    153         MPID_nem_gm_module_queue_enqueue (lmt, e); 
     153        MPID_nem_gm_queue_enqueue (lmt, e); 
    154154    } 
    155155    else if (ret == LMT_FAILURE) 
    156156    { 
    157         printf ("error: MPID_nem_gm_module_lmt_do_get() failed \n"); 
     157        printf ("error: MPID_nem_gm_lmt_do_get() failed \n"); 
    158158        return -1;       
    159159    } 
     
    162162 
    163163static inline int 
    164 MPID_nem_gm_module_lmt_post (struct iovec cookie) 
     164MPID_nem_gm_lmt_post (struct iovec cookie) 
    165165{ 
    166166    int ret = 0; 
     
    174174    for (i = 0; i < n_iov; ++i) 
    175175    { 
    176         MPID_nem_gm_module_deregister_mem (iov[i].iov_base, iov[i].iov_len); 
     176        MPID_nem_gm_deregister_mem (iov[i].iov_base, iov[i].iov_len); 
    177177    } 
    178178     
     
    183183 
    184184int 
    185 MPID_nem_gm_module_lmt_send_post (struct iovec cookie) 
    186 { 
    187     return MPID_nem_gm_module_lmt_post (cookie); 
    188 } 
    189  
    190 int 
    191 MPID_nem_gm_module_lmt_recv_post (struct iovec cookie) 
    192 { 
    193     return MPID_nem_gm_module_lmt_post (cookie); 
     185MPID_nem_gm_lmt_send_post (struct iovec cookie) 
     186{ 
     187    return MPID_nem_gm_lmt_post (cookie); 
     188} 
     189 
     190int 
     191MPID_nem_gm_lmt_recv_post (struct iovec cookie) 
     192{ 
     193    return MPID_nem_gm_lmt_post (cookie); 
    194194} 
    195195 
     
    209209 
    210210int 
    211 MPID_nem_gm_module_lmt_do_get (int node_id, int port_id, struct iovec **r_iov, int *r_n_iov, int *r_offset, struct iovec **s_iov, int *s_n_iov, 
     211MPID_nem_gm_lmt_do_get (int node_id, int port_id, struct iovec **r_iov, int *r_n_iov, int *r_offset, struct iovec **s_iov, int *s_n_iov, 
    212212                      int *s_offset, int *compl_ctr) 
    213213{ 
     
    276276    if (s_i != *s_n_iov || r_i != *r_n_iov) 
    277277    { 
    278         printf ("error: iov mismatch in MPID_nem_gm_module_lmt_start_recv\n"); 
     278        printf ("error: iov mismatch in MPID_nem_gm_lmt_start_recv\n"); 
    279279        return LMT_FAILURE; 
    280280    } 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_poll.c

    • Property svn:mergeinfo set
    r690 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99/* receive buffer */ 
     
    3030 
    3131#undef FUNCNAME 
    32 #define FUNCNAME MPID_nem_gm_module_recv_init 
    33 #undef FCNAME 
    34 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    35 int MPID_nem_gm_module_recv_init() 
     32#define FUNCNAME MPID_nem_gm_recv_init 
     33#undef FCNAME 
     34#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     35int MPID_nem_gm_recv_init() 
    3636{ 
    3737    int mpi_errno = MPI_SUCCESS; 
     
    6969 
    7070#undef FUNCNAME 
    71 #define FUNCNAME MPID_nem_gm_module_recv 
    72 #undef FCNAME 
    73 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    74 inline int MPID_nem_gm_module_recv() 
     71#define FUNCNAME MPID_nem_gm_recv 
     72#undef FCNAME 
     73#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     74inline int MPID_nem_gm_recv() 
    7575{ 
    7676    int mpi_errno = MPI_SUCCESS; 
     
    7878    MPIDI_VC_t *vc; 
    7979     
    80     /*    printf_d ("MPID_nem_gm_module_recv()\n"); */ 
     80    /*    printf_d ("MPID_nem_gm_recv()\n"); */ 
    8181     
    8282    while (!RECVBUF_S_EMPTY()) 
     
    174174{ 
    175175    int ret; 
    176     MPID_nem_gm_module_lmt_queue_t *e; 
    177      
    178     MPID_nem_gm_module_queue_dequeue (lmt, &e); 
     176    MPID_nem_gm_lmt_queue_t *e; 
     177     
     178    MPID_nem_gm_queue_dequeue (lmt, &e); 
    179179     
    180180    while (e && MPID_nem_module_gm_num_send_tokens) 
    181181    { 
    182         ret = MPID_nem_gm_module_lmt_do_get (e->node_id, e->port_id, &e->r_iov, &e->r_n_iov, &e->r_offset, &e->s_iov, &e->s_n_iov, &e->s_offset, 
     182        ret = MPID_nem_gm_lmt_do_get (e->node_id, e->port_id, &e->r_iov, &e->r_n_iov, &e->r_offset, &e->s_iov, &e->s_n_iov, &e->s_offset, 
    183183                                             e->compl_ctr); 
    184184        if (ret == LMT_AGAIN) 
    185185        { 
    186             MPID_nem_gm_module_queue_free (lmt, e); 
    187             MPID_nem_gm_module_queue_dequeue (lmt, &e); 
     186            MPID_nem_gm_queue_free (lmt, e); 
     187            MPID_nem_gm_queue_dequeue (lmt, &e); 
    188188        } 
    189189        else if (ret == LMT_FAILURE) 
    190190        { 
    191             printf ("error: MPID_nem_gm_module_lmt_do_get failed.  Dequeuing.\n"); 
    192             MPID_nem_gm_module_queue_free (lmt, e); 
    193             MPID_nem_gm_module_queue_dequeue (lmt, &e); 
     191            printf ("error: MPID_nem_gm_lmt_do_get failed.  Dequeuing.\n"); 
     192            MPID_nem_gm_queue_free (lmt, e); 
     193            MPID_nem_gm_queue_dequeue (lmt, &e); 
    194194        } 
    195195    } 
     
    199199 
    200200#undef FUNCNAME 
    201 #define FUNCNAME MPID_nem_gm_module_send_poll 
     201#define FUNCNAME MPID_nem_gm_send_poll 
    202202#undef FCNAME 
    203203#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    204204inline int 
    205 MPID_nem_gm_module_send_poll( void ) 
     205MPID_nem_gm_send_poll( void ) 
    206206{ 
    207207    int mpi_errno = MPI_SUCCESS; 
     
    210210    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    211211    /*lmt_poll(); */ 
    212     mpi_errno = MPID_nem_gm_module_recv(); 
    213     if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    214  
    215  fn_exit: 
    216     return mpi_errno; 
    217  fn_fail: 
    218     goto fn_exit; 
    219 } 
    220  
    221 #undef FUNCNAME 
    222 #define FUNCNAME MPID_nem_gm_module_recv_poll 
     212    mpi_errno = MPID_nem_gm_recv(); 
     213    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
     214 
     215 fn_exit: 
     216    return mpi_errno; 
     217 fn_fail: 
     218    goto fn_exit; 
     219} 
     220 
     221#undef FUNCNAME 
     222#define FUNCNAME MPID_nem_gm_recv_poll 
    223223#undef FCNAME 
    224224#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    225225inline int 
    226 MPID_nem_gm_module_recv_poll( void ) 
    227 { 
    228     int mpi_errno = MPI_SUCCESS; 
    229      
    230     mpi_errno = MPID_nem_gm_module_recv(); 
     226MPID_nem_gm_recv_poll( void ) 
     227{ 
     228    int mpi_errno = MPI_SUCCESS; 
     229     
     230    mpi_errno = MPID_nem_gm_recv(); 
    231231    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    232232    mpi_errno = MPID_nem_send_from_queue(); 
     
    240240 
    241241#undef FUNCNAME 
    242 #define FUNCNAME MPID_nem_gm_module_poll 
     242#define FUNCNAME MPID_nem_gm_poll 
    243243#undef FCNAME 
    244244#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    245245int 
    246 MPID_nem_gm_module_poll(MPID_nem_poll_dir_t in_or_out) 
     246MPID_nem_gm_poll(MPID_nem_poll_dir_t in_or_out) 
    247247{ 
    248248    if (in_or_out == MPID_NEM_POLL_OUT) 
    249249    { 
    250         return MPID_nem_gm_module_send_poll(); 
     250        return MPID_nem_gm_send_poll(); 
    251251    } 
    252252    else 
    253253    { 
    254         return MPID_nem_gm_module_recv_poll(); 
    255     } 
    256 } 
     254        return MPID_nem_gm_recv_poll(); 
     255    } 
     256} 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_register.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99int 
    10 MPID_nem_gm_module_register_mem (void *p, int len) 
     10MPID_nem_gm_register_mem (void *p, int len) 
    1111{ 
    1212    if (gm_register_memory (MPID_nem_module_gm_port, p, len) == GM_SUCCESS) 
     
    1717 
    1818int 
    19 MPID_nem_gm_module_deregister_mem (void *p, int len) 
     19MPID_nem_gm_deregister_mem (void *p, int len) 
    2020{ 
    2121    if (gm_deregister_memory (MPID_nem_module_gm_port, p, len) == GM_SUCCESS) 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_send.c

    • Property svn:mergeinfo set
    r690 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99#define DO_PAPI3(x) /*x */ 
     
    5454{ 
    5555    int mpi_errno = MPI_SUCCESS; 
    56     MPID_nem_gm_module_send_queue_t *e; 
     56    MPID_nem_gm_send_queue_t *e; 
    5757    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_SEND_FROM_QUEUE); 
    5858#ifdef BOUNCE_BUFFER 
     
    6868/*     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_SEND_FROM_QUEUE);     */ 
    6969     
    70     while (!MPID_nem_gm_module_queue_empty (send) && MPID_nem_module_gm_num_send_tokens) 
     70    while (!MPID_nem_gm_queue_empty (send) && MPID_nem_module_gm_num_send_tokens) 
    7171    { 
    72         MPID_nem_gm_module_queue_dequeue (send, &e); 
     72        MPID_nem_gm_queue_dequeue (send, &e); 
    7373 
    7474        switch (e->type) 
     
    8484            { 
    8585            case RDMA_TYPE_GET: 
    86                 mpi_errno = MPID_nem_gm_module_do_get (e->u.rdma.target_p, e->u.rdma.source_p, e->u.rdma.len, e->node_id, e->port_id, 
     86                mpi_errno = MPID_nem_gm_do_get (e->u.rdma.target_p, e->u.rdma.source_p, e->u.rdma.len, e->node_id, e->port_id, 
    8787                                                       e->u.rdma.completion_ctr); 
    8888                if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    8989                break; 
    9090            case RDMA_TYPE_PUT: 
    91                 mpi_errno = MPID_nem_gm_module_do_put (e->u.rdma.target_p, e->u.rdma.source_p, e->u.rdma.len, e->node_id, e->port_id, 
     91                mpi_errno = MPID_nem_gm_do_put (e->u.rdma.target_p, e->u.rdma.source_p, e->u.rdma.len, e->node_id, e->port_id, 
    9292                                                       e->u.rdma.completion_ctr); 
    9393                if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
     
    102102            break; 
    103103        } 
    104         MPID_nem_gm_module_queue_free (send, e); 
     104        MPID_nem_gm_queue_free (send, e); 
    105105    } 
    106106 fn_exit: 
     
    112112 
    113113#undef FUNCNAME 
    114 #define FUNCNAME MPID_nem_gm_module_send 
     114#define FUNCNAME MPID_nem_gm_send 
    115115#undef FCNAME 
    116116#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    117117int 
    118 MPID_nem_gm_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
     118MPID_nem_gm_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
    119119{ 
    120120    int mpi_errno = MPI_SUCCESS; 
    121     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_GM_MODULE_SEND); 
     121    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_GM_SEND); 
    122122 
    123     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_GM_MODULE_SEND);     
     123    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_GM_SEND);     
    124124     
    125125    DO_PAPI3 (PAPI_reset (PAPI_EventSet)); 
     
    135135    else 
    136136    { 
    137         MPID_nem_gm_module_send_queue_t *e; 
     137        MPID_nem_gm_send_queue_t *e; 
    138138 
    139139        DO_PAPI3 (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues15)); 
    140         e = MPID_nem_gm_module_queue_alloc (send); 
     140        e = MPID_nem_gm_queue_alloc (send); 
    141141        e->node_id = VC_FIELD(vc, gm_node_id); 
    142142        e->port_id = VC_FIELD(vc, gm_port_id); 
     
    147147        cell->pkt.mpich2.datalen = datalen; 
    148148         
    149         MPID_nem_gm_module_queue_enqueue (send, e); 
     149        MPID_nem_gm_queue_enqueue (send, e); 
    150150        mpi_errno = MPID_nem_send_from_queue(); 
    151151        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
     
    154154    }     
    155155 fn_exit: 
    156     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_GM_MODULE_SEND); 
     156    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_GM_SEND); 
    157157    return mpi_errno; 
    158158 fn_fail: 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/gm/gm_test.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "gm_module_impl.h" 
     7#include "gm_impl.h" 
    88 
    99int 
    10 MPID_nem_gm_module_test() 
     10MPID_nem_gm_test() 
    1111{ 
    1212    return gm_receive_pending (MPID_nem_module_gm_port); 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/Makefile.sm

    r100 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   ib_module_init.c ib_module_ckpt_shutdown.c ib_module_connect_to_root.c \ 
    5   ib_module_finalize.c ib_module_get_bus_card.c ib_module_init.c \ 
    6   ib_module_poll.c ib_module_vc_init.c ib_module_send.c ib_param.c \ 
    7   ib_module_cm.c ib_module_priv.c ib_utils.c ib_module_cell.c \ 
    8   ib_module_vc_finalize.c 
     4  ib_init.c ib_ckpt_shutdown.c ib_connect_to_root.c ib_finalize.c ib_get_bus_card.c ib_init.c \ 
     5  ib_poll.c ib_vc_init.c ib_send.c ib_param.c ib_cm.c ib_priv.c ib_utils.c ib_cell.c \ 
     6  ib_vc_finalize.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_cell.c

    • Property svn:mergeinfo set
    r3391 r3763  
    88#include "ib_device.h" 
    99#include "ib_utils.h" 
    10 #include "ib_module_cm.h" 
    11 #include "ib_module_priv.h" 
    12 #include "ib_module_impl.h" 
    13  
    14 static MPID_nem_ib_module_queue_ptr_t alloc_cells_queue; 
    15  
    16 #undef FUNCNAME 
    17 #define FUNCNAME MPID_nem_ib_module_add_cells 
    18 #undef FCNAME 
    19 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    20  
    21 int MPID_nem_ib_module_add_cells(int n) 
     10#include "ib_cm.h" 
     11#include "ib_priv.h" 
     12#include "ib_impl.h" 
     13 
     14static MPID_nem_ib_queue_ptr_t alloc_cells_queue; 
     15 
     16#undef FUNCNAME 
     17#define FUNCNAME MPID_nem_ib_add_cells 
     18#undef FCNAME 
     19#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     20 
     21int MPID_nem_ib_add_cells(int n) 
    2222{ 
    2323    int mpi_errno = MPI_SUCCESS; 
    2424    int i; 
    25     MPID_nem_ib_module_cell_pool_t *pool; 
    26     MPID_nem_ib_module_cell_elem_t *ce; 
    27     MPID_nem_ib_module_queue_elem_t *qe; 
    28     MPID_nem_ib_module_queue_elem_t *cell_ptr_elem; 
    29  
    30     pool = &MPID_nem_ib_module_cell_pool; 
    31  
    32     ce = MPIU_Malloc(sizeof(MPID_nem_ib_module_cell_elem_t) * n); 
     25    MPID_nem_ib_cell_pool_t *pool; 
     26    MPID_nem_ib_cell_elem_t *ce; 
     27    MPID_nem_ib_queue_elem_t *qe; 
     28    MPID_nem_ib_queue_elem_t *cell_ptr_elem; 
     29 
     30    pool = &MPID_nem_ib_cell_pool; 
     31 
     32    ce = MPIU_Malloc(sizeof(MPID_nem_ib_cell_elem_t) * n); 
    3333 
    3434    if(NULL == ce) { 
    3535        MPIU_CHKMEM_SETERR(mpi_errno,  
    36                 sizeof(MPID_nem_ib_module_cell_elem_t) * n,  
     36                sizeof(MPID_nem_ib_cell_elem_t) * n,  
    3737                "IB Module Cell Elements"); 
    3838    } 
    3939 
    40     memset(ce, 0, sizeof(MPID_nem_ib_module_cell_elem_t) * n); 
    41  
    42     MPID_nem_ib_module_queue_alloc(alloc_cells_queue, &cell_ptr_elem); 
     40    memset(ce, 0, sizeof(MPID_nem_ib_cell_elem_t) * n); 
     41 
     42    MPID_nem_ib_queue_alloc(alloc_cells_queue, &cell_ptr_elem); 
    4343 
    4444    cell_ptr_elem->data = ce; 
    4545 
    46     MPID_nem_ib_module_queue_enqueue(alloc_cells_queue, cell_ptr_elem); 
     46    MPID_nem_ib_queue_enqueue(alloc_cells_queue, cell_ptr_elem); 
    4747 
    4848    /* Allocate the queue elements and enqueue */ 
     
    5050    for(i = 0; i < n; i++) { 
    5151 
    52         mpi_errno = MPID_nem_ib_module_queue_new_elem(&qe, &ce[i]); 
     52        mpi_errno = MPID_nem_ib_queue_new_elem(&qe, &ce[i]); 
    5353 
    5454        if(mpi_errno) { 
     
    5656        } 
    5757 
    58         MPID_nem_ib_module_queue_enqueue(pool->queue, qe); 
     58        MPID_nem_ib_queue_enqueue(pool->queue, qe); 
    5959 
    6060        /* Record the Queue element pointer */ 
     
    6969 
    7070#undef FUNCNAME 
    71 #define FUNCNAME MPID_nem_ib_module_init_cell_pool 
    72 #undef FCNAME 
    73 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    74  
    75 int MPID_nem_ib_module_init_cell_pool(int n) 
     71#define FUNCNAME MPID_nem_ib_init_cell_pool 
     72#undef FCNAME 
     73#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     74 
     75int MPID_nem_ib_init_cell_pool(int n) 
    7676{ 
    7777    int mpi_errno = MPI_SUCCESS; 
    78     MPID_nem_ib_module_cell_pool_t *pool; 
    79  
    80     pool = &MPID_nem_ib_module_cell_pool; 
    81  
    82     MPID_nem_ib_module_queue_init(&pool->queue); 
    83  
    84     MPID_nem_ib_module_queue_init(&alloc_cells_queue); 
    85  
    86     mpi_errno = MPID_nem_ib_module_add_cells(n); 
     78    MPID_nem_ib_cell_pool_t *pool; 
     79 
     80    pool = &MPID_nem_ib_cell_pool; 
     81 
     82    MPID_nem_ib_queue_init(&pool->queue); 
     83 
     84    MPID_nem_ib_queue_init(&alloc_cells_queue); 
     85 
     86    mpi_errno = MPID_nem_ib_add_cells(n); 
    8787 
    8888    if(mpi_errno) { 
     
    9999 
    100100#undef FUNCNAME 
    101 #define FUNCNAME MPID_nem_ib_module_finalize_cell_pool 
    102 #undef FCNAME 
    103 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    104  
    105 void MPID_nem_ib_module_finalize_cell_pool() 
    106 { 
    107     MPID_nem_ib_module_queue_elem_t *e; 
    108     MPID_nem_ib_module_cell_elem_t *ce; 
    109  
    110     while(!MPID_nem_ib_module_queue_empty( 
    111                 MPID_nem_ib_module_cell_pool.queue)) { 
    112  
    113         MPID_nem_ib_module_queue_dequeue( 
    114                 MPID_nem_ib_module_cell_pool.queue, &e); 
     101#define FUNCNAME MPID_nem_ib_finalize_cell_pool 
     102#undef FCNAME 
     103#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     104 
     105void MPID_nem_ib_finalize_cell_pool() 
     106{ 
     107    MPID_nem_ib_queue_elem_t *e; 
     108    MPID_nem_ib_cell_elem_t *ce; 
     109 
     110    while(!MPID_nem_ib_queue_empty( 
     111                MPID_nem_ib_cell_pool.queue)) { 
     112 
     113        MPID_nem_ib_queue_dequeue( 
     114                MPID_nem_ib_cell_pool.queue, &e); 
    115115 
    116116        MPIU_Free(e); 
    117117    } 
    118118 
    119     while(!MPID_nem_ib_module_queue_empty( 
     119    while(!MPID_nem_ib_queue_empty( 
    120120                alloc_cells_queue)) { 
    121121 
    122         MPID_nem_ib_module_queue_dequeue( 
     122        MPID_nem_ib_queue_dequeue( 
    123123                alloc_cells_queue, &e); 
    124124 
     
    130130 
    131131#undef FUNCNAME 
    132 #define FUNCNAME MPID_nem_ib_module_get_cell 
    133 #undef FCNAME 
    134 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    135  
    136 int MPID_nem_ib_module_get_cell( 
    137         MPID_nem_ib_module_cell_elem_t **e) 
     132#define FUNCNAME MPID_nem_ib_get_cell 
     133#undef FCNAME 
     134#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     135 
     136int MPID_nem_ib_get_cell( 
     137        MPID_nem_ib_cell_elem_t **e) 
    138138{ 
    139139    int mpi_errno = MPI_SUCCESS; 
    140     MPID_nem_ib_module_queue_elem_t *qe; 
    141  
    142     pthread_spin_lock(&MPID_nem_ib_module_cell_pool.lock); 
    143  
    144     if(!MPID_nem_ib_module_queue_empty( 
    145                 MPID_nem_ib_module_cell_pool.queue)) { 
    146  
    147         MPID_nem_ib_module_queue_dequeue( 
    148                 MPID_nem_ib_module_cell_pool.queue, 
     140    MPID_nem_ib_queue_elem_t *qe; 
     141 
     142    pthread_spin_lock(&MPID_nem_ib_cell_pool.lock); 
     143 
     144    if(!MPID_nem_ib_queue_empty( 
     145                MPID_nem_ib_cell_pool.queue)) { 
     146 
     147        MPID_nem_ib_queue_dequeue( 
     148                MPID_nem_ib_cell_pool.queue, 
    149149                &qe); 
    150150 
     
    159159        NEM_IB_DBG("Ran out of cells, allocating new ones"); 
    160160 
    161         mpi_errno = MPID_nem_ib_module_add_cells( 
     161        mpi_errno = MPID_nem_ib_add_cells( 
    162162                MPID_nem_ib_dev_param_ptr->sec_pool_size); 
    163163 
     
    168168        /* Atleast one cell is available now! */ 
    169169 
    170         MPID_nem_ib_module_queue_dequeue( 
    171                 MPID_nem_ib_module_cell_pool.queue, 
     170        MPID_nem_ib_queue_dequeue( 
     171                MPID_nem_ib_cell_pool.queue, 
    172172                &qe); 
    173173 
     
    179179    } 
    180180 
    181     pthread_spin_unlock(&MPID_nem_ib_module_cell_pool.lock); 
     181    pthread_spin_unlock(&MPID_nem_ib_cell_pool.lock); 
    182182 
    183183fn_exit: 
     
    189189 
    190190#undef FUNCNAME 
    191 #define FUNCNAME MPID_nem_ib_module_return_cell 
    192 #undef FCNAME 
    193 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    194  
    195 void MPID_nem_ib_module_return_cell( 
    196         MPID_nem_ib_module_cell_elem_t *ce) 
    197 { 
    198     pthread_spin_lock(&MPID_nem_ib_module_cell_pool.lock); 
     191#define FUNCNAME MPID_nem_ib_return_cell 
     192#undef FCNAME 
     193#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     194 
     195void MPID_nem_ib_return_cell( 
     196        MPID_nem_ib_cell_elem_t *ce) 
     197{ 
     198    pthread_spin_lock(&MPID_nem_ib_cell_pool.lock); 
    199199 
    200200    ce->vc = NULL; 
    201201    ce->nem_cell = NULL; 
    202202 
    203     MPID_nem_ib_module_queue_enqueue( 
    204             MPID_nem_ib_module_cell_pool.queue, 
     203    MPID_nem_ib_queue_enqueue( 
     204            MPID_nem_ib_cell_pool.queue, 
    205205            ce->qe); 
    206206 
    207     pthread_spin_unlock(&MPID_nem_ib_module_cell_pool.lock); 
    208 } 
    209  
    210 #undef FUNCNAME 
    211 #define FUNCNAME MPID_nem_ib_module_prep_cell_recv 
    212 #undef FCNAME 
    213 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    214  
    215 void MPID_nem_ib_module_prep_cell_recv( 
    216         MPID_nem_ib_module_cell_elem_t *ce, 
     207    pthread_spin_unlock(&MPID_nem_ib_cell_pool.lock); 
     208} 
     209 
     210#undef FUNCNAME 
     211#define FUNCNAME MPID_nem_ib_prep_cell_recv 
     212#undef FCNAME 
     213#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     214 
     215void MPID_nem_ib_prep_cell_recv( 
     216        MPID_nem_ib_cell_elem_t *ce, 
    217217        void* buf) 
    218218{ 
     
    228228 
    229229#undef FUNCNAME 
    230 #define FUNCNAME MPID_nem_ib_module_prep_cell_send 
    231 #undef FCNAME 
    232 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    233  
    234 void MPID_nem_ib_module_prep_cell_send( 
    235         MPID_nem_ib_module_cell_elem_t *ce, 
     230#define FUNCNAME MPID_nem_ib_prep_cell_send 
     231#undef FCNAME 
     232#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     233 
     234void MPID_nem_ib_prep_cell_send( 
     235        MPID_nem_ib_cell_elem_t *ce, 
    236236        void* buf, uint32_t len) 
    237237{ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_ckpt_shutdown.c

    • Property svn:mergeinfo set
    r100 r3763  
    55#include <stdio.h> 
    66 
    7 int MPID_nem_ib_module_ckpt_shutdown (void) 
     7int MPID_nem_ib_ckpt_shutdown (void) 
    88{ 
    99    fprintf(stderr,"STUB\n"); 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_cm.c

    • Property svn:mergeinfo set
    r100 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #include "ib_module_impl.h" 
     5#include "ib_impl.h" 
    66#include "mpidimpl.h" 
    7 #include "ib_module_cm.h" 
     7#include "ib_cm.h" 
    88 
    99#undef FUNCNAME 
     
    1212#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1313 
    14 MPID_nem_ib_module_queue_ptr_t MPID_nem_ib_module_qp_queue = 0; 
     14MPID_nem_ib_queue_ptr_t MPID_nem_ib_qp_queue = 0; 
    1515 
    1616static int cm_post_ud_packet( 
     
    100100    struct ibv_qp_init_attr init_attr; 
    101101    struct ibv_qp_attr attr; 
    102     MPID_nem_ib_module_queue_elem_ptr_t e; 
     102    MPID_nem_ib_queue_elem_ptr_t e; 
    103103 
    104104    memset(&init_attr, 0, sizeof(init_attr)); 
     
    114114            "**ibv_create_qp %s", "CM creating RC qp"); 
    115115 
    116     MPID_nem_ib_module_queue_alloc(MPID_nem_ib_module_qp_queue, &e); 
     116    MPID_nem_ib_queue_alloc(MPID_nem_ib_qp_queue, &e); 
    117117 
    118118    e->data = *qp; 
     
    120120    NEM_IB_DBG("Enqueing qp %p", *qp); 
    121121 
    122     MPID_nem_ib_module_queue_enqueue(MPID_nem_ib_module_qp_queue, e); 
     122    MPID_nem_ib_queue_enqueue(MPID_nem_ib_qp_queue, e); 
    123123 
    124124    memset(&attr, 0, sizeof(attr)); 
     
    672672    do { 
    673673        r_info = (MPID_nem_ib_cm_remote_id_ptr_t)  
    674             MPID_nem_ib_module_lookup_hash_table( 
     674            MPID_nem_ib_lookup_hash_table( 
    675675                    &MPID_nem_ib_cm_ctxt_ptr->hash_table, 
    676676                    msg->src_guid, msg->src_ud_qpn); 
     
    11731173    /* Initialize the QP queue */ 
    11741174 
    1175     MPID_nem_ib_module_queue_init(&MPID_nem_ib_module_qp_queue); 
     1175    MPID_nem_ib_queue_init(&MPID_nem_ib_qp_queue); 
    11761176 
    11771177    /* Initialize the Hash table */ 
    11781178 
    1179     mpi_errno = MPID_nem_ib_module_init_hash_table(&ctxt_ptr->hash_table, 
     1179    mpi_errno = MPID_nem_ib_init_hash_table(&ctxt_ptr->hash_table, 
    11801180            param_ptr->cm_hash_size); 
    11811181 
     
    12961296    int mpi_errno = MPI_SUCCESS; 
    12971297    int ret; 
    1298     MPID_nem_ib_module_queue_elem_ptr_t e; 
    1299  
    1300     while(!MPID_nem_ib_module_queue_empty( 
    1301                 MPID_nem_ib_module_qp_queue)) { 
    1302  
    1303         MPID_nem_ib_module_queue_dequeue( 
    1304                 MPID_nem_ib_module_qp_queue, &e); 
     1298    MPID_nem_ib_queue_elem_ptr_t e; 
     1299 
     1300    while(!MPID_nem_ib_queue_empty( 
     1301                MPID_nem_ib_qp_queue)) { 
     1302 
     1303        MPID_nem_ib_queue_dequeue( 
     1304                MPID_nem_ib_qp_queue, &e); 
    13051305 
    13061306        MPIU_Assert(NULL != e->data); 
     
    13171317    } 
    13181318 
    1319     MPID_nem_ib_module_queue_finalize(MPID_nem_ib_module_qp_queue); 
     1319    MPID_nem_ib_queue_finalize(MPID_nem_ib_qp_queue); 
    13201320 
    13211321fn_exit: 
     
    13871387    MPIU_Free(MPID_nem_ib_cm_ctxt_ptr->cm_buf); 
    13881388 
    1389     MPID_nem_ib_module_finalize_hash_table( 
     1389    MPID_nem_ib_finalize_hash_table( 
    13901390            &MPID_nem_ib_cm_ctxt_ptr->hash_table); 
    13911391 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_cm.h

    • Property svn:mergeinfo set
    r100 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #ifndef _IB_MODULE_CM_H 
    6 #define _IB_MODULE_CM_H 
     5#ifndef IB_CM_H 
     6#define IB_CM_H 
    77 
    88#include <infiniband/verbs.h> 
     
    104104    void                        *cm_recv_buf; 
    105105    uint32_t                    cm_recv_buf_index; 
    106     MPID_nem_ib_module_hash_table_t hash_table; 
     106    MPID_nem_ib_hash_table_t hash_table; 
    107107    int                         cm_pending_num; 
    108108    uint32_t                    cm_req_id_global; 
     
    125125 
    126126extern MPID_nem_ib_cm_ctxt_ptr_t MPID_nem_ib_cm_ctxt_ptr; 
    127 extern MPID_nem_ib_module_queue_ptr_t MPID_nem_ib_module_qp_queue; 
     127extern MPID_nem_ib_queue_ptr_t MPID_nem_ib_qp_queue; 
    128128 
    129129int MPID_nem_ib_cm_init_cm(); 
     
    137137int MPID_nem_ib_cm_finalize_rc_qps(); 
    138138 
    139 #endif  /* _IB_MODULE_CM_H */ 
     139#endif  /* IB_CM_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_connect_to_root.c

    • Property svn:mergeinfo set
    r3391 r3763  
    66 
    77#include "mpidimpl.h" 
    8 #include "ib_module_impl.h" 
     8#include "ib_impl.h" 
    99 
    10 int MPID_nem_ib_module_connect_to_root (const char *business_card,  
     10int MPID_nem_ib_connect_to_root (const char *business_card,  
    1111        MPIDI_VC_t *new_vc) 
    1212{ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_device.h

    r100 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #ifndef _IB_DEVICE_H 
    6 #define _IB_DEVICE_H 
     5#ifndef IB_DEVICE_H 
     6#define IB_DEVICE_H 
    77 
    88#include <infiniband/verbs.h> 
     
    8181 
    8282/** 
    83  * MPID_nem_ib_module_ctxt_t 
     83 * MPID_nem_ib_ctxt_t 
    8484 * 
    8585 * Defines the InfiniBand context related datastructures for any 
     
    104104void async_thread(void *context); 
    105105 
    106 #endif /* _IB_DEVICE_H */ 
     106#endif /* IB_DEVICE_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_finalize.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55#define _GNU_SOURCE 
    66#include "mpidimpl.h" 
    7 #include "ib_module_impl.h" 
     7#include "ib_impl.h" 
    88#include "ib_device.h" 
    9 #include "ib_module_cm.h" 
     9#include "ib_cm.h" 
    1010 
    1111#undef FUNCNAME 
    12 #define FUNCNAME MPID_nem_ib_module_finalize 
     12#define FUNCNAME MPID_nem_ib_finalize 
    1313#undef FCNAME 
    1414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1515 
    16 int MPID_nem_ib_module_finalize (void) 
     16int MPID_nem_ib_finalize (void) 
    1717{ 
    1818    int mpi_errno = MPI_SUCCESS; 
     
    9191    } 
    9292 
    93     MPID_nem_ib_module_finalize_cell_pool(); 
     93    MPID_nem_ib_finalize_cell_pool(); 
    9494 
    95     MPID_nem_ib_module_queue_finalize(MPID_nem_ib_module_vc_queue); 
     95    MPID_nem_ib_queue_finalize(MPID_nem_ib_vc_queue); 
    9696 
    9797fn_exit: 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_get_bus_card.c

    • Property svn:mergeinfo set
    r3391 r3763  
    66 
    77#include "mpidimpl.h" 
    8 #include "ib_module_impl.h" 
     8#include "ib_impl.h" 
    99#include "ib_utils.h" 
    10 #include "ib_module_cm.h" 
     10#include "ib_cm.h" 
    1111 
    1212 
    1313#undef FUNCNAME 
    14 #define FUNCNAME MPID_nem_ib_module_get_business_card 
     14#define FUNCNAME MPID_nem_ib_get_business_card 
    1515#undef FCNAME 
    1616#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1717 
    18 int MPID_nem_ib_module_get_business_card (int my_rank, char **bc_val_p,  
     18int MPID_nem_ib_get_business_card (int my_rank, char **bc_val_p,  
    1919        int *val_max_sz_p) 
    2020{ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_impl.h

    • Property svn:mergeinfo set
    r3391 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #ifndef _IB_MODULE_IMPL_H 
    6 #define _IB_MODULE_IMPL_H 
     5#ifndef IB_IMPL_H 
     6#define IB_IMPL_H 
    77 
    88#define _GNU_SOURCE 
     
    3333    int conn_status; 
    3434    struct ibv_qp *qp; 
    35     struct MPID_nem_ib_module_queue_t *ib_send_queue; 
    36     struct MPID_nem_ib_module_queue_t *ib_recv_queue; 
     35    struct MPID_nem_ib_queue_t *ib_send_queue; 
     36    struct MPID_nem_ib_queue_t *ib_recv_queue; 
    3737    uint32_t  avail_send_wqes; 
    3838    char   in_queue; 
    39 } MPID_nem_ib_module_vc_area; 
     39} MPID_nem_ib_vc_area; 
    4040 
    4141/* accessor macro to private fields in VC */ 
    42 #define VC_FIELD(vc, field) (((MPID_nem_ib_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     42#define VC_FIELD(vc, field) (((MPID_nem_ib_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    4343 
    4444typedef struct { 
     
    4848    } u; 
    4949    struct ibv_sge sg_list; 
    50 } MPID_nem_ib_module_descriptor_t; 
     50} MPID_nem_ib_descriptor_t; 
    5151 
    5252typedef struct { 
    5353    MPID_nem_cell_ptr_t     nem_cell; 
    5454    int                     datalen; 
    55     MPID_nem_ib_module_queue_elem_t *qe; 
     55    MPID_nem_ib_queue_elem_t *qe; 
    5656    MPIDI_VC_t              *vc; 
    57     MPID_nem_ib_module_descriptor_t desc; 
    58 } MPID_nem_ib_module_cell_elem_t; 
     57    MPID_nem_ib_descriptor_t desc; 
     58} MPID_nem_ib_cell_elem_t; 
    5959 
    6060typedef struct _ib_cell_pool { 
    61     MPID_nem_ib_module_queue_t          *queue; 
     61    MPID_nem_ib_queue_t          *queue; 
    6262    int                                 ncells; 
    6363    pthread_spinlock_t                 lock; 
    64 } MPID_nem_ib_module_cell_pool_t; 
     64} MPID_nem_ib_cell_pool_t; 
    6565 
    66 extern MPID_nem_ib_module_cell_pool_t MPID_nem_ib_module_cell_pool; 
     66extern MPID_nem_ib_cell_pool_t MPID_nem_ib_cell_pool; 
    6767 
    68 int MPID_nem_ib_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     68int MPID_nem_ib_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    6969                             MPID_nem_queue_ptr_t proc_free_queue,  
    7070                             MPID_nem_cell_ptr_t proc_elements, 
     
    7878                             char **bc_val_p,  
    7979                             int *val_max_sz_p); 
    80 int MPID_nem_ib_module_finalize (void); 
    81 int MPID_nem_ib_module_poll (MPID_nem_poll_dir_t in_or_out); 
    82 int MPID_nem_ib_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    83 int MPID_nem_ib_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    84 int MPID_nem_ib_module_ckpt_shutdown (void); 
    85 int MPID_nem_ib_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    86 int MPID_nem_ib_module_vc_init (MPIDI_VC_t *vc); 
    87 int MPID_nem_ib_module_vc_destroy(MPIDI_VC_t *vc); 
    88 int MPID_nem_ib_module_vc_terminate (MPIDI_VC_t *vc); 
     80int MPID_nem_ib_finalize (void); 
     81int MPID_nem_ib_poll (MPID_nem_poll_dir_t in_or_out); 
     82int MPID_nem_ib_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     83int MPID_nem_ib_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     84int MPID_nem_ib_ckpt_shutdown (void); 
     85int MPID_nem_ib_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     86int MPID_nem_ib_vc_init (MPIDI_VC_t *vc); 
     87int MPID_nem_ib_vc_destroy(MPIDI_VC_t *vc); 
     88int MPID_nem_ib_vc_terminate (MPIDI_VC_t *vc); 
    8989 
    9090 
    91 int MPID_nem_ib_module_init_cell_pool(int n); 
    92 int MPID_nem_ib_module_get_cell( 
    93         MPID_nem_ib_module_cell_elem_t **e); 
    94 void MPID_nem_ib_module_return_cell( 
    95         MPID_nem_ib_module_cell_elem_t *ce); 
    96 void MPID_nem_ib_module_prep_cell_recv( 
    97         MPID_nem_ib_module_cell_elem_t *ce, 
     91int MPID_nem_ib_init_cell_pool(int n); 
     92int MPID_nem_ib_get_cell( 
     93        MPID_nem_ib_cell_elem_t **e); 
     94void MPID_nem_ib_return_cell( 
     95        MPID_nem_ib_cell_elem_t *ce); 
     96void MPID_nem_ib_prep_cell_recv( 
     97        MPID_nem_ib_cell_elem_t *ce, 
    9898        void* buf); 
    99 void MPID_nem_ib_module_prep_cell_send( 
    100         MPID_nem_ib_module_cell_elem_t *ce, 
     99void MPID_nem_ib_prep_cell_send( 
     100        MPID_nem_ib_cell_elem_t *ce, 
    101101        void* buf, uint32_t len); 
    102 int MPID_nem_ib_module_add_cells(int n); 
     102int MPID_nem_ib_add_cells(int n); 
    103103 
    104 #endif /* _IB_MODULE_IMPL_H */ 
     104#endif /* IB_IMPL_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_init.c

    • Property svn:mergeinfo set
    r3391 r3763  
    99#include "ib_device.h" 
    1010#include "ib_utils.h" 
    11 #include "ib_module_cm.h" 
    12 #include "ib_module_priv.h" 
    13 #include "ib_module_impl.h" 
    14  
    15 MPID_nem_netmod_funcs_t MPIDI_nem_ib_module_funcs = { 
    16     MPID_nem_ib_module_init, 
    17     MPID_nem_ib_module_finalize, 
    18     MPID_nem_ib_module_ckpt_shutdown, 
    19     MPID_nem_ib_module_poll, 
    20     MPID_nem_ib_module_send, 
    21     MPID_nem_ib_module_get_business_card, 
    22     MPID_nem_ib_module_connect_to_root, 
    23     MPID_nem_ib_module_vc_init, 
    24     MPID_nem_ib_module_vc_destroy, 
    25     MPID_nem_ib_module_vc_terminate 
     11#include "ib_cm.h" 
     12#include "ib_priv.h" 
     13#include "ib_impl.h" 
     14 
     15MPID_nem_netmod_funcs_t MPIDI_nem_ib_funcs = { 
     16    MPID_nem_ib_init, 
     17    MPID_nem_ib_finalize, 
     18    MPID_nem_ib_ckpt_shutdown, 
     19    MPID_nem_ib_poll, 
     20    MPID_nem_ib_send, 
     21    MPID_nem_ib_get_business_card, 
     22    MPID_nem_ib_connect_to_root, 
     23    MPID_nem_ib_vc_init, 
     24    MPID_nem_ib_vc_destroy, 
     25    MPID_nem_ib_vc_terminate 
    2626}; 
    2727 
     
    4242struct ibv_mr *module_elements_mr = NULL; 
    4343 
    44 MPID_nem_ib_module_queue_ptr_t MPID_nem_ib_module_vc_queue = 0; 
    45 MPID_nem_ib_module_cell_pool_t MPID_nem_ib_module_cell_pool; 
     44MPID_nem_ib_queue_ptr_t MPID_nem_ib_vc_queue = 0; 
     45MPID_nem_ib_cell_pool_t MPID_nem_ib_cell_pool; 
    4646 
    4747MPID_nem_ib_dev_param_t *MPID_nem_ib_dev_param_ptr = 0; 
     
    109109        MPID_nem_ib_ctxt_ptr->ib_dev[i].nic = dev_list[i]; 
    110110 
    111         mpi_errno = MPID_nem_ib_module_open_hca(dev_list[i],  
     111        mpi_errno = MPID_nem_ib_open_hca(dev_list[i],  
    112112                &MPID_nem_ib_ctxt_ptr->ib_dev[i].context); 
    113113 
     
    116116        } 
    117117 
    118         mpi_errno = MPID_nem_ib_module_alloc_pd 
     118        mpi_errno = MPID_nem_ib_alloc_pd 
    119119            (MPID_nem_ib_ctxt_ptr->ib_dev[i].context, 
    120120                &MPID_nem_ib_ctxt_ptr->ib_dev[i].prot_domain, dev_list[i]); 
     
    124124        } 
    125125 
    126         mpi_errno = MPID_nem_ib_module_get_dev_attr 
     126        mpi_errno = MPID_nem_ib_get_dev_attr 
    127127            (MPID_nem_ib_ctxt_ptr->ib_dev[i].context, 
    128128                &MPID_nem_ib_ctxt_ptr->ib_dev[i].dev_attr, dev_list[i]); 
     
    142142        for(j = 1; j <= total_ports; j++) { 
    143143 
    144             if(MPID_nem_ib_module_is_port_active( 
     144            if(MPID_nem_ib_is_port_active( 
    145145                        MPID_nem_ib_ctxt_ptr->ib_dev[i].context, j)) { 
    146146                MPID_nem_ib_ctxt_ptr->ib_dev[i].n_active_ports++; 
     
    173173        for(j = 1; j <= total_ports; j++) { 
    174174 
    175             if(MPID_nem_ib_module_is_port_active( 
     175            if(MPID_nem_ib_is_port_active( 
    176176                        MPID_nem_ib_ctxt_ptr->ib_dev[i].context, j)) { 
    177177 
    178178                NEM_IB_DBG("Opening port %u", j); 
    179179 
    180                 MPID_nem_ib_module_get_port_prop( 
     180                MPID_nem_ib_get_port_prop( 
    181181                        MPID_nem_ib_ctxt_ptr->ib_dev[i].context,  
    182182                        (uint8_t) j, 
     
    196196        } 
    197197 
    198         mpi_errno = MPID_nem_ib_module_create_cq 
     198        mpi_errno = MPID_nem_ib_create_cq 
    199199            (MPID_nem_ib_ctxt_ptr->ib_dev[i].context, 
    200200                &MPID_nem_ib_ctxt_ptr->ib_dev[i].cq,  
     
    208208        } 
    209209 
    210         mpi_errno = MPID_nem_ib_module_create_srq 
     210        mpi_errno = MPID_nem_ib_create_srq 
    211211            (MPID_nem_ib_ctxt_ptr->ib_dev[i].context, 
    212212                MPID_nem_ib_ctxt_ptr->ib_dev[i].prot_domain, 
     
    381381 
    382382/** 
    383  * MPID_nem_ib_module_init - Initialize the Nemesis IB module 
     383 * MPID_nem_ib_init - Initialize the Nemesis IB module 
    384384 * 
    385385 * @proc_recv_queue: main recv queue for the process 
     
    408408 
    409409#undef FUNCNAME 
    410 #define FUNCNAME MPID_nem_ib_module_init 
     410#define FUNCNAME MPID_nem_ib_init 
    411411#undef FCNAME 
    412412#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    413413 
    414 int MPID_nem_ib_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     414int MPID_nem_ib_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    415415        MPID_nem_queue_ptr_t proc_free_queue,  
    416416        MPID_nem_cell_ptr_t proc_elements, 
     
    429429 
    430430    /* first make sure that our private fields in the vc fit into the area provided  */ 
    431     MPIU_Assert(sizeof(MPID_nem_ib_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     431    MPIU_Assert(sizeof(MPID_nem_ib_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    432432     
    433433    INIT_NEM_IB_PROC_DESC(pg_rank); 
    434434 
    435     mpi_errno = MPID_nem_ib_module_init_cm_param(); 
    436     if(mpi_errno) { 
    437         MPIU_ERR_POP(mpi_errno); 
    438     } 
    439  
    440     mpi_errno = MPID_nem_ib_module_init_dev_param(); 
     435    mpi_errno = MPID_nem_ib_init_cm_param(); 
     436    if(mpi_errno) { 
     437        MPIU_ERR_POP(mpi_errno); 
     438    } 
     439 
     440    mpi_errno = MPID_nem_ib_init_dev_param(); 
    441441    if(mpi_errno) { 
    442442        MPIU_ERR_POP(mpi_errno); 
     
    460460    } 
    461461 
    462     mpi_errno = MPID_nem_ib_module_get_business_card 
     462    mpi_errno = MPID_nem_ib_get_business_card 
    463463        (pg_rank, bc_val_p, val_max_sz_p); 
    464464    if(mpi_errno) { 
     
    472472    /* Register the process and module elements */ 
    473473 
    474     ret = MPID_nem_ib_module_reg_mem 
     474    ret = MPID_nem_ib_reg_mem 
    475475        (MPID_nem_ib_ctxt_ptr->ib_dev[0].prot_domain, 
    476476         (void *)proc_elements, 
     
    482482            "**ibv_reg_mr", "**ibv_reg_mr %d", ret); 
    483483 
    484     ret = MPID_nem_ib_module_reg_mem 
     484    ret = MPID_nem_ib_reg_mem 
    485485        (MPID_nem_ib_ctxt_ptr->ib_dev[0].prot_domain, 
    486486         (void *)module_elements, 
     
    499499    MPID_nem_queue_init(MPID_nem_module_ib_free_queue); 
    500500 
    501     mpi_errno = MPID_nem_ib_module_init_cell_pool( 
     501    mpi_errno = MPID_nem_ib_init_cell_pool( 
    502502            MPID_nem_ib_dev_param_ptr->max_cell_elem); 
    503503 
     
    520520 
    521521        MPID_nem_cell_ptr_t c; 
    522         MPID_nem_ib_module_cell_elem_t *ce; 
     522        MPID_nem_ib_cell_elem_t *ce; 
    523523 
    524524        MPID_nem_queue_dequeue(MPID_nem_module_ib_free_queue, &c); 
    525525 
    526         mpi_errno = MPID_nem_ib_module_get_cell(&ce); 
     526        mpi_errno = MPID_nem_ib_get_cell(&ce); 
    527527        if(mpi_errno) { 
    528528            MPIU_ERR_POP(mpi_errno); 
     
    531531        ce->nem_cell = c; 
    532532 
    533         MPID_nem_ib_module_prep_cell_recv(ce, (void *) MPID_NEM_CELL_TO_PACKET(c)); 
    534  
    535         ret = MPID_nem_ib_module_post_srq( 
     533        MPID_nem_ib_prep_cell_recv(ce, (void *) MPID_NEM_CELL_TO_PACKET(c)); 
     534 
     535        ret = MPID_nem_ib_post_srq( 
    536536                MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 
    537537                &ce->desc.u.r_wr); 
     
    545545    /* Enable watch for SRQ events */ 
    546546 
    547     ret = MPID_nem_ib_module_modify_srq( 
     547    ret = MPID_nem_ib_modify_srq( 
    548548            MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 
    549549            MPID_nem_ib_dev_param_ptr->max_srq_wr, 
     
    559559    *module_free_queue = MPID_nem_module_ib_free_queue; 
    560560 
    561     MPID_nem_ib_module_queue_init(&MPID_nem_ib_module_vc_queue); 
     561    MPID_nem_ib_queue_init(&MPID_nem_ib_vc_queue); 
    562562 
    563563    for(i = 0; i < MPID_nem_ib_dev_param_ptr->max_vc_queue; i++) { 
    564564 
    565         MPID_nem_ib_module_queue_elem_t *e; 
    566  
    567         mpi_errno = MPID_nem_ib_module_queue_new_elem(&e, NULL); 
     565        MPID_nem_ib_queue_elem_t *e; 
     566 
     567        mpi_errno = MPID_nem_ib_queue_new_elem(&e, NULL); 
    568568        if(mpi_errno) { 
    569569            MPIU_ERR_POP(mpi_errno); 
    570570        } 
    571571             
    572         MPID_nem_ib_module_queue_free(MPID_nem_ib_module_vc_queue, e); 
    573     } 
    574  
    575     NEM_IB_DBG("End of ib_module_init module elem %d, proc elem %d, " 
     572        MPID_nem_ib_queue_free(MPID_nem_ib_vc_queue, e); 
     573    } 
     574 
     575    NEM_IB_DBG("End of ib_init module elem %d, proc elem %d, " 
    576576            "posted SRQ %d\n", 
    577577            num_module_elements,  
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_param.c

    r100 r3763  
    66#include "mpidimpl.h" 
    77#include "ib_device.h" 
    8 #include "ib_module_cm.h" 
     8#include "ib_cm.h" 
    99 
    10 int MPID_nem_ib_module_init_dev_param(); 
    11 int MPID_nem_ib_module_init_cm_param(); 
     10int MPID_nem_ib_init_dev_param(); 
     11int MPID_nem_ib_init_cm_param(); 
    1212 
    1313#undef FUNCNAME 
    14 #define FUNCNAME MPID_nem_ib_module_init_dev_param 
     14#define FUNCNAME MPID_nem_ib_init_dev_param 
    1515#undef FCNAME 
    1616#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1717 
    18 int MPID_nem_ib_module_init_dev_param() 
     18int MPID_nem_ib_init_dev_param() 
    1919{ 
    2020    int mpi_errno = MPI_SUCCESS; 
     
    6464 
    6565#undef FUNCNAME 
    66 #define FUNCNAME MPID_nem_ib_module_init_cm_param 
     66#define FUNCNAME MPID_nem_ib_init_cm_param 
    6767#undef FCNAME 
    6868#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    6969 
    70 int MPID_nem_ib_module_init_cm_param() 
     70int MPID_nem_ib_init_cm_param() 
    7171{ 
    7272    int mpi_errno = MPI_SUCCESS; 
     
    9898 
    9999#if 0 
    100 int MPID_nem_ib_module_init_param(MPID_nem_ib_device_ptr_t dev) 
     100int MPID_nem_ib_init_param(MPID_nem_ib_device_ptr_t dev) 
    101101{ 
    102102    int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_poll.c

    • Property svn:mergeinfo set
    r3391 r3763  
    66#include "mpidimpl.h" 
    77#include "mpid_nem_impl.h" 
    8 #include "ib_module_impl.h" 
     8#include "ib_impl.h" 
    99#include "ib_device.h" 
    10 #include "ib_module_cm.h" 
     10#include "ib_cm.h" 
    1111#include "ib_utils.h" 
    1212 
    13 uint32_t MPID_nem_ib_module_refill_srq( 
     13uint32_t MPID_nem_ib_refill_srq( 
    1414        struct ibv_srq *srq, uint32_t max_post); 
    1515 
     
    6464 
    6565                MPID_nem_ib_ctxt_ptr->ib_dev[0].srq_n_posted += 
    66                     MPID_nem_ib_module_refill_srq( 
     66                    MPID_nem_ib_refill_srq( 
    6767                            MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 
    6868                            MPID_nem_ib_dev_param_ptr->max_srq_wr - 
     
    8686                    MPID_nem_ib_dev_param_ptr->srq_limit; 
    8787 
    88                 if (MPID_nem_ib_module_modify_srq( 
     88                if (MPID_nem_ib_modify_srq( 
    8989                            MPID_nem_ib_ctxt_ptr->ib_dev[0].srq,  
    9090                            MPID_nem_ib_dev_param_ptr->max_srq_wr,  
     
    105105} 
    106106 
    107 uint32_t MPID_nem_ib_module_refill_srq( 
     107uint32_t MPID_nem_ib_refill_srq( 
    108108        struct ibv_srq *srq, uint32_t max_post) 
    109109{ 
    110110    uint32_t post_count = 0; 
    111111    MPID_nem_cell_ptr_t c; 
    112     MPID_nem_ib_module_cell_elem_t *ce; 
    113     MPID_nem_ib_module_cell_elem_t *ce_root; 
    114     MPID_nem_ib_module_cell_elem_t *ce_prev; 
     112    MPID_nem_ib_cell_elem_t *ce; 
     113    MPID_nem_ib_cell_elem_t *ce_root; 
     114    MPID_nem_ib_cell_elem_t *ce_prev; 
    115115    int ret; 
    116116 
     
    122122        MPID_nem_queue_dequeue(MPID_nem_module_ib_free_queue, &c); 
    123123 
    124         MPID_nem_ib_module_get_cell(&ce); 
     124        MPID_nem_ib_get_cell(&ce); 
    125125 
    126126        ce->nem_cell = c; 
    127127 
    128         MPID_nem_ib_module_prep_cell_recv(ce,  
     128        MPID_nem_ib_prep_cell_recv(ce,  
    129129                (void *) MPID_NEM_CELL_TO_PACKET(c)); 
    130130 
     
    143143 
    144144        /* Post all of them in a list */ 
    145         ret = MPID_nem_ib_module_post_srq( 
     145        ret = MPID_nem_ib_post_srq( 
    146146                MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 
    147147                &ce_root->desc.u.r_wr); 
     
    162162 
    163163#undef FUNCNAME 
    164 #define FUNCNAME MPID_nem_ib_module_poll 
     164#define FUNCNAME MPID_nem_ib_poll 
    165165#undef FCNAME 
    166166#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    167167 
    168 int MPID_nem_ib_module_poll (MPID_nem_poll_dir_t in_or_out) 
     168int MPID_nem_ib_poll (MPID_nem_poll_dir_t in_or_out) 
    169169{ 
    170170    int mpi_errno = MPI_SUCCESS; 
    171171    int ret; 
    172     MPID_nem_ib_module_queue_elem_t *e, *sqe; 
    173     MPID_nem_ib_module_cell_elem_t *ce; 
     172    MPID_nem_ib_queue_elem_t *e, *sqe; 
     173    MPID_nem_ib_cell_elem_t *ce; 
    174174    MPIDI_VC_t *vc; 
    175175    struct ibv_wc wc; 
    176176 
    177     ret = MPID_nem_ib_module_poll_cq( 
     177    ret = MPID_nem_ib_poll_cq( 
    178178            MPID_nem_ib_ctxt_ptr->ib_dev[0].cq, &wc); 
    179179 
     
    184184 
    185185        /* Got valid completion */ 
    186         ce = (MPID_nem_ib_module_cell_elem_t *) wc.wr_id; 
     186        ce = (MPID_nem_ib_cell_elem_t *) wc.wr_id; 
    187187 
    188188        switch(wc.opcode) { 
     
    196196                VC_FIELD(ce->vc, avail_send_wqes)++; 
    197197 
    198                 MPID_nem_ib_module_return_cell(ce); 
     198                MPID_nem_ib_return_cell(ce); 
    199199 
    200200                break; 
     
    207207                        ce->nem_cell); 
    208208 
    209                 MPID_nem_ib_module_return_cell(ce); 
     209                MPID_nem_ib_return_cell(ce); 
    210210 
    211211                pthread_spin_lock( 
     
    224224 
    225225                    MPID_nem_ib_ctxt_ptr->ib_dev[0].srq_n_posted +=  
    226                         MPID_nem_ib_module_refill_srq( 
     226                        MPID_nem_ib_refill_srq( 
    227227                                MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 
    228228                            MPID_nem_ib_dev_param_ptr->max_srq_wr - 
     
    243243    } 
    244244 
    245     if(!MPID_nem_ib_module_queue_empty(MPID_nem_ib_module_vc_queue)) { 
     245    if(!MPID_nem_ib_queue_empty(MPID_nem_ib_vc_queue)) { 
    246246 
    247247        /* We got VCs to process, get busy! */ 
    248248 
    249         MPID_nem_ib_module_queue_dequeue(MPID_nem_ib_module_vc_queue, &e); 
     249        MPID_nem_ib_queue_dequeue(MPID_nem_ib_vc_queue, &e); 
    250250 
    251251        vc = (MPIDI_VC_t *) e->data; 
     
    255255            /* Connected */ 
    256256 
    257             while(!MPID_nem_ib_module_queue_empty( 
    258                         (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue)) && 
     257            while(!MPID_nem_ib_queue_empty( 
     258                        (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue)) && 
    259259                    VC_FIELD(vc, avail_send_wqes)) { 
    260260 
    261                 MPID_nem_ib_module_queue_dequeue( 
    262                         (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue), 
     261                MPID_nem_ib_queue_dequeue( 
     262                        (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue), 
    263263                        &sqe); 
    264264 
    265                 ce = (MPID_nem_ib_module_cell_elem_t *) sqe->data; 
     265                ce = (MPID_nem_ib_cell_elem_t *) sqe->data; 
    266266 
    267267                NEM_IB_DBG("Cell to send %p, Len %d", 
    268268                        ce->nem_cell, ce->datalen); 
    269269 
    270                 ret = MPID_nem_ib_module_post_send(VC_FIELD(vc, qp), 
     270                ret = MPID_nem_ib_post_send(VC_FIELD(vc, qp), 
    271271                        &ce->desc.u.s_wr); 
    272272 
     
    277277            } 
    278278 
    279             if(!MPID_nem_ib_module_queue_empty( 
    280                         (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue))) { 
     279            if(!MPID_nem_ib_queue_empty( 
     280                        (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue))) { 
    281281                /* Still needs processing. 
    282282                 * Back to the queue you go! */ 
    283                 MPID_nem_ib_module_queue_enqueue( 
    284                         MPID_nem_ib_module_vc_queue, e); 
     283                MPID_nem_ib_queue_enqueue( 
     284                        MPID_nem_ib_vc_queue, e); 
    285285            } else { 
    286286 
     
    293293            /* Not connected, so put it back on queue */ 
    294294 
    295             MPID_nem_ib_module_queue_enqueue( 
    296                     MPID_nem_ib_module_vc_queue, e); 
     295            MPID_nem_ib_queue_enqueue( 
     296                    MPID_nem_ib_vc_queue, e); 
    297297        } 
    298298    } 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_priv.c

    • Property svn:mergeinfo set
    r100 r3763  
    44 */ 
    55#include "mpidimpl.h" 
    6 #include "ib_module_priv.h" 
     6#include "ib_priv.h" 
    77#include "ib_utils.h" 
    88 
     
    1010 
    1111/** 
    12  * MPID_nem_ib_module_get_wc_err_string -  
     12 * MPID_nem_ib_get_wc_err_string -  
    1313 *     Places the correct error string 
    1414 *     according to wc->status. 
     
    1717 */ 
    1818 
    19 static void MPID_nem_ib_module_get_wc_err_string(int err_code) 
     19static void MPID_nem_ib_get_wc_err_string(int err_code) 
    2020{ 
    2121    switch(err_code) { 
     
    100100 
    101101#undef FUNCNAME 
    102 #define FUNCNAME MPID_nem_ib_module_open_hca 
    103 #undef FCNAME 
    104 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    105 int MPID_nem_ib_module_open_hca(struct ibv_device *dev,  
     102#define FUNCNAME MPID_nem_ib_open_hca 
     103#undef FCNAME 
     104#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     105int MPID_nem_ib_open_hca(struct ibv_device *dev,  
    106106        struct ibv_context **ctxt) 
    107107{ 
     
    132132 
    133133#undef FUNCNAME 
    134 #define FUNCNAME MPID_nem_ib_module_alloc_pd 
    135 #undef FCNAME 
    136 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    137 int MPID_nem_ib_module_alloc_pd(struct ibv_context *ctxt,  
     134#define FUNCNAME MPID_nem_ib_alloc_pd 
     135#undef FCNAME 
     136#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     137int MPID_nem_ib_alloc_pd(struct ibv_context *ctxt,  
    138138        struct ibv_pd **pd, 
    139139        struct ibv_device *dev) 
     
    156156 
    157157/** 
    158  * MPID_nem_ib_module_get_dev_attr - Gets IB device attributes  
     158 * MPID_nem_ib_get_dev_attr - Gets IB device attributes  
    159159 * 
    160160 * @ctxt: Context of IB device for which protection 
     
    165165 
    166166#undef FUNCNAME 
    167 #define FUNCNAME MPID_nem_ib_module_get_dev_attr 
    168 #undef FCNAME 
    169 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    170 int MPID_nem_ib_module_get_dev_attr(struct ibv_context *ctxt,  
     167#define FUNCNAME MPID_nem_ib_get_dev_attr 
     168#undef FCNAME 
     169#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     170int MPID_nem_ib_get_dev_attr(struct ibv_context *ctxt,  
    171171        struct ibv_device_attr *dev_attr, 
    172172        struct ibv_device *dev) 
     
    203203 
    204204#undef FUNCNAME 
    205 #define FUNCNAME MPID_nem_ib_module_create_cq 
    206 #undef FCNAME 
    207 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    208 int MPID_nem_ib_module_create_cq(struct ibv_context *ctxt, 
     205#define FUNCNAME MPID_nem_ib_create_cq 
     206#undef FCNAME 
     207#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     208int MPID_nem_ib_create_cq(struct ibv_context *ctxt, 
    209209        struct ibv_cq **cq, 
    210210        struct ibv_comp_channel **comp_channel, 
     
    259259 
    260260#undef FUNCNAME 
    261 #define FUNCNAME MPID_nem_ib_module_create_srq 
    262 #undef FCNAME 
    263 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    264 int MPID_nem_ib_module_create_srq(struct ibv_context *ctxt, 
     261#define FUNCNAME MPID_nem_ib_create_srq 
     262#undef FCNAME 
     263#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     264int MPID_nem_ib_create_srq(struct ibv_context *ctxt, 
    265265        struct ibv_pd *pd, 
    266266        struct ibv_srq **srq, 
     
    300300 
    301301/** 
    302  * MPID_nem_ib_module_is_port_active - Finds out if a particular 
     302 * MPID_nem_ib_is_port_active - Finds out if a particular 
    303303 *  port is active or not.  
    304304 * 
     
    311311 
    312312#undef FUNCNAME 
    313 #define FUNCNAME MPID_nem_ib_module_is_port_active 
    314 #undef FCNAME 
    315 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    316  
    317 int MPID_nem_ib_module_is_port_active(struct ibv_context *ctxt, 
     313#define FUNCNAME MPID_nem_ib_is_port_active 
     314#undef FCNAME 
     315#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     316 
     317int MPID_nem_ib_is_port_active(struct ibv_context *ctxt, 
    318318        uint8_t port_num) 
    319319{ 
     
    339339 
    340340#undef FUNCNAME 
    341 #define FUNCNAME MPID_nem_ib_module_get_port_prop 
    342 #undef FCNAME 
    343 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    344  
    345 int MPID_nem_ib_module_get_port_prop(struct ibv_context *ctxt, 
     341#define FUNCNAME MPID_nem_ib_get_port_prop 
     342#undef FCNAME 
     343#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     344 
     345int MPID_nem_ib_get_port_prop(struct ibv_context *ctxt, 
    346346        uint8_t port_num, struct ibv_port_attr *attr) 
    347347{ 
     
    354354 
    355355#undef FUNCNAME 
    356 #define FUNCNAME MPID_nem_ib_module_reg_mem 
    357 #undef FCNAME 
    358 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    359  
    360 int MPID_nem_ib_module_reg_mem(struct ibv_pd *pd, 
     356#define FUNCNAME MPID_nem_ib_reg_mem 
     357#undef FCNAME 
     358#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     359 
     360int MPID_nem_ib_reg_mem(struct ibv_pd *pd, 
    361361        void *addr, 
    362362        size_t length, 
     
    383383 
    384384#undef FUNCNAME 
    385 #define FUNCNAME MPID_nem_ib_module_post_srq 
    386 #undef FCNAME 
    387 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    388  
    389 int MPID_nem_ib_module_post_srq(struct ibv_srq *srq, 
     385#define FUNCNAME MPID_nem_ib_post_srq 
     386#undef FCNAME 
     387#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     388 
     389int MPID_nem_ib_post_srq(struct ibv_srq *srq, 
    390390        struct ibv_recv_wr *r_wr) 
    391391{ 
     
    401401 
    402402#undef FUNCNAME 
    403 #define FUNCNAME MPID_nem_ib_module_post_send 
    404 #undef FCNAME 
    405 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    406  
    407 int MPID_nem_ib_module_post_send(struct ibv_qp *qp, 
     403#define FUNCNAME MPID_nem_ib_post_send 
     404#undef FCNAME 
     405#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     406 
     407int MPID_nem_ib_post_send(struct ibv_qp *qp, 
    408408        struct ibv_send_wr *s_wr) 
    409409{ 
     
    419419 
    420420#undef FUNCNAME 
    421 #define FUNCNAME MPID_nem_ib_module_poll_cq 
    422 #undef FCNAME 
    423 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    424  
    425 int MPID_nem_ib_module_poll_cq(struct ibv_cq *cq,  
     421#define FUNCNAME MPID_nem_ib_poll_cq 
     422#undef FCNAME 
     423#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     424 
     425int MPID_nem_ib_poll_cq(struct ibv_cq *cq,  
    426426        struct ibv_wc *wc) 
    427427{ 
     
    440440        if(IBV_WC_SUCCESS != wc->status) { 
    441441 
    442             MPID_nem_ib_module_get_wc_err_string(wc->status); 
     442            MPID_nem_ib_get_wc_err_string(wc->status); 
    443443 
    444444            NEM_IB_ERR("Got completion with error, id %lu, error %s",  
     
    458458 
    459459#undef FUNCNAME 
    460 #define FUNCNAME MPID_nem_ib_module_modify_srq 
    461 #undef FCNAME 
    462 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    463  
    464 int MPID_nem_ib_module_modify_srq( 
     460#define FUNCNAME MPID_nem_ib_modify_srq 
     461#undef FCNAME 
     462#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     463 
     464int MPID_nem_ib_modify_srq( 
    465465            struct ibv_srq *srq, 
    466466            uint32_t max_wr, 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_priv.h

    • Property svn:mergeinfo set
    r100 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #ifndef _IB_MODULE_PRIV_H 
    6 #define _IB_MODULE_PRIV_H 
     5#ifndef IB_PRIV_H 
     6#define IB_PRIV_H 
    77 
    88#include <infiniband/verbs.h> 
    99 
    1010 
    11 int MPID_nem_ib_module_open_hca(struct ibv_device *dev,  
     11int MPID_nem_ib_open_hca(struct ibv_device *dev,  
    1212        struct ibv_context **ctxt); 
    1313 
    14 int MPID_nem_ib_module_alloc_pd(struct ibv_context *ctxt,  
     14int MPID_nem_ib_alloc_pd(struct ibv_context *ctxt,  
    1515        struct ibv_pd **pd, 
    1616        struct ibv_device *dev); 
    1717 
    18 int MPID_nem_ib_module_create_cq(struct ibv_context *ctxt, 
     18int MPID_nem_ib_create_cq(struct ibv_context *ctxt, 
    1919        struct ibv_cq **cq, 
    2020        struct ibv_comp_channel **comp_channel, 
     
    2222        struct ibv_device *dev); 
    2323 
    24 int MPID_nem_ib_module_create_srq(struct ibv_context *ctxt, 
     24int MPID_nem_ib_create_srq(struct ibv_context *ctxt, 
    2525        struct ibv_pd *pd, 
    2626        struct ibv_srq **srq, 
     
    2828        struct ibv_device *dev); 
    2929 
    30 int MPID_nem_ib_module_get_dev_attr(struct ibv_context *ctxt,  
     30int MPID_nem_ib_get_dev_attr(struct ibv_context *ctxt,  
    3131        struct ibv_device_attr *dev_attr, 
    3232        struct ibv_device *dev); 
    3333 
    34 int MPID_nem_ib_module_is_port_active(struct ibv_context *ctxt, 
     34int MPID_nem_ib_is_port_active(struct ibv_context *ctxt, 
    3535        uint8_t port_num); 
    3636 
    37 int MPID_nem_ib_module_get_port_prop(struct ibv_context *ctxt, 
     37int MPID_nem_ib_get_port_prop(struct ibv_context *ctxt, 
    3838        uint8_t port_num, struct ibv_port_attr *attr); 
    3939 
    40 int MPID_nem_ib_module_reg_mem(struct ibv_pd *pd, 
     40int MPID_nem_ib_reg_mem(struct ibv_pd *pd, 
    4141        void *addr, 
    4242        size_t length, 
     
    4444        struct ibv_mr **mr); 
    4545 
    46 int MPID_nem_ib_module_post_srq(struct ibv_srq *srq, 
     46int MPID_nem_ib_post_srq(struct ibv_srq *srq, 
    4747        struct ibv_recv_wr *r_wr); 
    4848 
    49 int MPID_nem_ib_module_post_send(struct ibv_qp *qp, 
     49int MPID_nem_ib_post_send(struct ibv_qp *qp, 
    5050        struct ibv_send_wr *s_wr); 
    5151 
    52 int MPID_nem_ib_module_poll_cq(struct ibv_cq *cq,  
     52int MPID_nem_ib_poll_cq(struct ibv_cq *cq,  
    5353        struct ibv_wc *wc); 
    5454 
    55 int MPID_nem_ib_module_modify_srq( 
     55int MPID_nem_ib_modify_srq( 
    5656            struct ibv_srq *srq, 
    5757            uint32_t max_wr, 
    5858            uint32_t srq_limit); 
    5959 
    60 #endif /* _IB_MODULE_PRIV_H */ 
     60#endif /* IB_PRIV_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_send.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55#define _GNU_SOURCE 
    66#include "mpidimpl.h" 
    7 #include "ib_module_impl.h" 
     7#include "ib_impl.h" 
    88#include "ib_device.h" 
    9 #include "ib_module_cm.h" 
     9#include "ib_cm.h" 
    1010#include "ib_utils.h" 
    1111 
    1212#undef FUNCNAME 
    13 #define FUNCNAME MPID_nem_ib_module_send 
     13#define FUNCNAME MPID_nem_ib_send 
    1414#undef FCNAME 
    1515#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1616 
    17 int MPID_nem_ib_module_send (MPIDI_VC_t *vc,  
     17int MPID_nem_ib_send (MPIDI_VC_t *vc,  
    1818        MPID_nem_cell_ptr_t cell,  
    1919        int datalen) 
     
    2222    int ret, i; 
    2323    MPID_nem_ib_cm_remote_id_ptr_t r_info; 
    24     MPID_nem_ib_module_queue_elem_t *vce; 
    25     MPID_nem_ib_module_queue_elem_t *sqe; 
    26     MPID_nem_ib_module_cell_elem_t *ce; 
     24    MPID_nem_ib_queue_elem_t *vce; 
     25    MPID_nem_ib_queue_elem_t *sqe; 
     26    MPID_nem_ib_cell_elem_t *ce; 
    2727 
    2828    /* Check if VC is connected already */ 
     
    3131 
    3232        /* Process queued sends */ 
    33         while(!MPID_nem_ib_module_queue_empty( 
    34                     (MPID_nem_ib_module_queue_t *)  
     33        while(!MPID_nem_ib_queue_empty( 
     34                    (MPID_nem_ib_queue_t *)  
    3535                    VC_FIELD(vc, ib_send_queue)) &&  
    3636                VC_FIELD(vc, avail_send_wqes)) { 
    3737 
    38             MPID_nem_ib_module_queue_dequeue( 
    39                     (MPID_nem_ib_module_queue_t *) VC_FIELD(vc, ib_send_queue), 
     38            MPID_nem_ib_queue_dequeue( 
     39                    (MPID_nem_ib_queue_t *) VC_FIELD(vc, ib_send_queue), 
    4040                    &sqe); 
    4141 
    42             ce = (MPID_nem_ib_module_cell_elem_t *) sqe->data; 
     42            ce = (MPID_nem_ib_cell_elem_t *) sqe->data; 
    4343 
    4444            NEM_IB_DBG("Cell to send %p, Len %d", 
    4545                    ce->nem_cell, ce->datalen); 
    4646 
    47             ret = MPID_nem_ib_module_post_send(VC_FIELD(vc, qp), 
     47            ret = MPID_nem_ib_post_send(VC_FIELD(vc, qp), 
    4848                    &ce->desc.u.s_wr); 
    4949 
     
    5454        } 
    5555 
    56         mpi_errno = MPID_nem_ib_module_get_cell(&ce); 
     56        mpi_errno = MPID_nem_ib_get_cell(&ce); 
    5757 
    5858        if(mpi_errno) { 
     
    6464        ce->vc = vc; 
    6565 
    66         MPID_nem_ib_module_prep_cell_send(ce,  
     66        MPID_nem_ib_prep_cell_send(ce,  
    6767                (void *) MPID_NEM_CELL_TO_PACKET(cell), 
    6868                (uint32_t) (datalen + MPID_NEM_MPICH2_HEAD_LEN)); 
     
    7272             * was emptied */ 
    7373 
    74             ret = MPID_nem_ib_module_post_send(VC_FIELD(vc, qp), 
     74            ret = MPID_nem_ib_post_send(VC_FIELD(vc, qp), 
    7575                    &ce->desc.u.s_wr); 
    7676 
     
    8585 
    8686                MPID_nem_ib_ctxt_ptr->ib_dev[0].srq_n_posted +=  
    87                     MPID_nem_ib_module_refill_srq( 
     87                    MPID_nem_ib_refill_srq( 
    8888                            MPID_nem_ib_ctxt_ptr->ib_dev[0].srq, 1); 
    8989            } 
     
    9393            if(!VC_FIELD(vc, in_queue)) { 
    9494 
    95                 MPID_nem_ib_module_queue_alloc( 
    96                         MPID_nem_ib_module_vc_queue, &vce); 
     95                MPID_nem_ib_queue_alloc( 
     96                        MPID_nem_ib_vc_queue, &vce); 
    9797 
    9898                vce->data = vc; 
     
    100100                VC_FIELD(vc, in_queue) = 1; 
    101101 
    102                 MPID_nem_ib_module_queue_enqueue( 
    103                         MPID_nem_ib_module_vc_queue, vce); 
     102                MPID_nem_ib_queue_enqueue( 
     103                        MPID_nem_ib_vc_queue, vce); 
    104104 
    105105            } 
    106106 
    107107            /* Add this to the channel send queue */ 
    108             MPID_nem_ib_module_queue_alloc( 
    109                     (MPID_nem_ib_module_queue_t *)(VC_FIELD(vc, ib_send_queue)), &sqe); 
     108            MPID_nem_ib_queue_alloc( 
     109                    (MPID_nem_ib_queue_t *)(VC_FIELD(vc, ib_send_queue)), &sqe); 
    110110 
    111111            sqe->data = (void *) ce; 
    112112 
    113             MPID_nem_ib_module_queue_enqueue( 
    114                     (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
     113            MPID_nem_ib_queue_enqueue( 
     114                    (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
    115115        } 
    116116 
     
    121121         * done with it */ 
    122122 
    123         mpi_errno = MPID_nem_ib_module_get_cell(&ce); 
     123        mpi_errno = MPID_nem_ib_get_cell(&ce); 
    124124 
    125125        if(mpi_errno) { 
     
    131131        ce->vc = vc; 
    132132 
    133         MPID_nem_ib_module_prep_cell_send(ce,  
     133        MPID_nem_ib_prep_cell_send(ce,  
    134134                (void *) MPID_NEM_CELL_TO_PACKET(cell), 
    135135                (uint32_t) (datalen + MPID_NEM_MPICH2_HEAD_LEN)); 
    136136 
    137137        /* Add this to the channel send queue */ 
    138         MPID_nem_ib_module_queue_alloc( 
    139                 (MPID_nem_ib_module_queue_t *)(VC_FIELD(vc, ib_send_queue)), &sqe); 
     138        MPID_nem_ib_queue_alloc( 
     139                (MPID_nem_ib_queue_t *)(VC_FIELD(vc, ib_send_queue)), &sqe); 
    140140 
    141141        sqe->data = (void *) ce; 
     
    151151        MPIU_Assert(VC_FIELD(vc, in_queue) == 1); 
    152152 
    153         MPID_nem_ib_module_queue_enqueue( 
    154                 (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
     153        MPID_nem_ib_queue_enqueue( 
     154                (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
    155155 
    156156    } else { 
     
    165165 
    166166        r_info = (MPID_nem_ib_cm_remote_id_ptr_t)  
    167             MPID_nem_ib_module_lookup_hash_table( 
     167            MPID_nem_ib_lookup_hash_table( 
    168168                &MPID_nem_ib_cm_ctxt_ptr->hash_table, 
    169169                VC_FIELD(vc, node_guid), VC_FIELD(vc, ud_qpn)); 
     
    177177        } 
    178178 
    179         MPID_nem_ib_module_queue_alloc( 
    180                 MPID_nem_ib_module_vc_queue, &vce); 
     179        MPID_nem_ib_queue_alloc( 
     180                MPID_nem_ib_vc_queue, &vce); 
    181181 
    182182        vce->data = vc; 
     
    186186        VC_FIELD(vc, in_queue) = 1; 
    187187 
    188         MPID_nem_ib_module_queue_enqueue( 
    189                 MPID_nem_ib_module_vc_queue, vce); 
     188        MPID_nem_ib_queue_enqueue( 
     189                MPID_nem_ib_vc_queue, vce); 
    190190 
    191191        /* Get an "cell" from our pool */ 
    192192 
    193         mpi_errno = MPID_nem_ib_module_get_cell(&ce); 
     193        mpi_errno = MPID_nem_ib_get_cell(&ce); 
    194194 
    195195        if(mpi_errno) { 
     
    201201        ce->vc = vc; 
    202202 
    203         MPID_nem_ib_module_prep_cell_send(ce,  
     203        MPID_nem_ib_prep_cell_send(ce,  
    204204                (void *) MPID_NEM_CELL_TO_PACKET(cell), 
    205205                (uint32_t) (datalen + MPID_NEM_MPICH2_HEAD_LEN)); 
    206206 
    207207        /* Add this to the channel send queue */ 
    208         MPID_nem_ib_module_queue_alloc( 
    209                 (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue), &sqe); 
     208        MPID_nem_ib_queue_alloc( 
     209                (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue), &sqe); 
    210210 
    211211        sqe->data = (void *) ce; 
    212212 
    213         MPID_nem_ib_module_queue_enqueue( 
    214                 (MPID_nem_ib_module_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
     213        MPID_nem_ib_queue_enqueue( 
     214                (MPID_nem_ib_queue_t *)VC_FIELD(vc, ib_send_queue), sqe); 
    215215 
    216216    } 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_utils.c

    r100 r3763  
    2222 
    2323#undef FUNCNAME 
    24 #define FUNCNAME MPID_nem_ib_module_init_hash_table 
    25 #undef FCNAME 
    26 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    27  
    28 int MPID_nem_ib_module_init_hash_table( 
    29         MPID_nem_ib_module_hash_table_ptr_t table, 
     24#define FUNCNAME MPID_nem_ib_init_hash_table 
     25#undef FCNAME 
     26#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     27 
     28int MPID_nem_ib_init_hash_table( 
     29        MPID_nem_ib_hash_table_ptr_t table, 
    3030        uint32_t nentries) 
    3131{ 
     
    3333 
    3434    table->entries = MPIU_Malloc( 
    35             sizeof(MPID_nem_ib_module_hash_elem_t) * nentries); 
     35            sizeof(MPID_nem_ib_hash_elem_t) * nentries); 
    3636    table->num_entries = nentries; 
    3737 
    3838    if(NULL == table->entries) { 
    3939        MPIU_CHKMEM_SETERR(mpi_errno,  
    40                 sizeof(MPID_nem_ib_module_hash_elem_t) * nentries,  
     40                sizeof(MPID_nem_ib_hash_elem_t) * nentries,  
    4141                "IB Module Hash Table"); 
    4242    } 
    4343 
    4444    memset(table->entries, 0, 
    45             sizeof(MPID_nem_ib_module_hash_elem_t) * nentries); 
     45            sizeof(MPID_nem_ib_hash_elem_t) * nentries); 
    4646 
    4747    pthread_mutex_init(&table->hash_table_lock, NULL); 
     
    5454 
    5555#undef FUNCNAME 
    56 #define FUNCNAME MPID_nem_ib_module_insert_hash_elem 
    57 #undef FCNAME 
    58 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    59  
    60 int MPID_nem_ib_module_insert_hash_elem( 
    61         MPID_nem_ib_module_hash_table_ptr_t table, 
     56#define FUNCNAME MPID_nem_ib_insert_hash_elem 
     57#undef FCNAME 
     58#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     59 
     60int MPID_nem_ib_insert_hash_elem( 
     61        MPID_nem_ib_hash_table_ptr_t table, 
    6262        uint64_t key, void *data, uint32_t uniq) 
    6363{ 
    6464    int mpi_errno = MPI_SUCCESS; 
    6565    uint32_t hash_index; 
    66     MPID_nem_ib_module_hash_elem_ptr_t start_elem; 
    67     MPID_nem_ib_module_hash_elem_ptr_t elem, new_elem; 
     66    MPID_nem_ib_hash_elem_ptr_t start_elem; 
     67    MPID_nem_ib_hash_elem_ptr_t elem, new_elem; 
    6868 
    6969    MPIU_Assert(NULL != table); 
     
    8787 
    8888    /* Insert the element */ 
    89     new_elem = MPIU_Malloc(sizeof(MPID_nem_ib_module_hash_elem_t)); 
     89    new_elem = MPIU_Malloc(sizeof(MPID_nem_ib_hash_elem_t)); 
    9090 
    9191    if(NULL == new_elem) { 
    9292        MPIU_CHKMEM_SETERR(mpi_errno,  
    93                 sizeof(MPID_nem_ib_module_hash_elem_t),  
     93                sizeof(MPID_nem_ib_hash_elem_t),  
    9494                "IB Module Hash Table New Element"); 
    9595    } 
    9696 
    97     memset(new_elem, 0, sizeof(MPID_nem_ib_module_hash_elem_t)); 
     97    memset(new_elem, 0, sizeof(MPID_nem_ib_hash_elem_t)); 
    9898 
    9999    new_elem->data = data; 
     
    117117 
    118118#undef FUNCNAME 
    119 #define FUNCNAME MPID_nem_ib_module_lookup_hash_table 
    120 #undef FCNAME 
    121 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    122  
    123 void* MPID_nem_ib_module_lookup_hash_table( 
    124         MPID_nem_ib_module_hash_table_ptr_t table, 
     119#define FUNCNAME MPID_nem_ib_lookup_hash_table 
     120#undef FCNAME 
     121#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     122 
     123void* MPID_nem_ib_lookup_hash_table( 
     124        MPID_nem_ib_hash_table_ptr_t table, 
    125125        uint64_t key, uint32_t unique_id) 
    126126{ 
    127127    uint32_t hash_index; 
    128128    void *data = NULL; 
    129     MPID_nem_ib_module_hash_elem_ptr_t start_elem; 
    130     MPID_nem_ib_module_hash_elem_ptr_t elem; 
     129    MPID_nem_ib_hash_elem_ptr_t start_elem; 
     130    MPID_nem_ib_hash_elem_ptr_t elem; 
    131131 
    132132    pthread_mutex_lock(&table->hash_table_lock); 
     
    159159 
    160160#undef FUNCNAME 
    161 #define FUNCNAME MPID_nem_ib_module_finalize_hash_table 
    162 #undef FCNAME 
    163 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    164  
    165 void MPID_nem_ib_module_finalize_hash_table( 
    166         MPID_nem_ib_module_hash_table_ptr_t table) 
     161#define FUNCNAME MPID_nem_ib_finalize_hash_table 
     162#undef FCNAME 
     163#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     164 
     165void MPID_nem_ib_finalize_hash_table( 
     166        MPID_nem_ib_hash_table_ptr_t table) 
    167167{ 
    168168    int i; 
    169     MPID_nem_ib_module_hash_elem_ptr_t start_elem; 
    170     MPID_nem_ib_module_hash_elem_ptr_t elem, next_elem; 
     169    MPID_nem_ib_hash_elem_ptr_t start_elem; 
     170    MPID_nem_ib_hash_elem_ptr_t elem, next_elem; 
    171171 
    172172    pthread_mutex_lock(&table->hash_table_lock); 
     
    196196 
    197197#undef FUNCNAME 
    198 #define FUNCNAME MPID_nem_ib_module_queue_init 
    199 #undef FCNAME 
    200 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    201  
    202 int MPID_nem_ib_module_queue_init( 
    203         MPID_nem_ib_module_queue_t **q) 
     198#define FUNCNAME MPID_nem_ib_queue_init 
     199#undef FCNAME 
     200#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     201 
     202int MPID_nem_ib_queue_init( 
     203        MPID_nem_ib_queue_t **q) 
    204204{ 
    205205    int mpi_errno = MPI_SUCCESS; 
     
    208208    MPIU_Assert(NULL != q); 
    209209 
    210     *q = MPIU_Malloc(sizeof(MPID_nem_ib_module_queue_t)); 
     210    *q = MPIU_Malloc(sizeof(MPID_nem_ib_queue_t)); 
    211211 
    212212    if(NULL == *q) { 
    213213        MPIU_CHKMEM_SETERR(mpi_errno,  
    214                 sizeof(MPID_nem_ib_module_queue_t),  
     214                sizeof(MPID_nem_ib_queue_t),  
    215215                "IB Module Queue"); 
    216216    } 
    217217 
    218     memset(*q, 0, sizeof(MPID_nem_ib_module_queue_t)); 
    219  
    220 fn_exit: 
    221     return mpi_errno; 
    222 fn_fail: 
    223     goto fn_exit; 
    224 } 
    225  
    226 #undef FUNCNAME 
    227 #define FUNCNAME MPID_nem_ib_module_queue_new_elem 
    228 #undef FCNAME 
    229 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    230  
    231 int MPID_nem_ib_module_queue_new_elem( 
    232         MPID_nem_ib_module_queue_elem_t **e, void *init_ptr) 
    233 { 
    234     int mpi_errno = MPI_SUCCESS; 
    235  
    236     (*e) = MPIU_Malloc(sizeof(MPID_nem_ib_module_queue_elem_t)); 
     218    memset(*q, 0, sizeof(MPID_nem_ib_queue_t)); 
     219 
     220fn_exit: 
     221    return mpi_errno; 
     222fn_fail: 
     223    goto fn_exit; 
     224} 
     225 
     226#undef FUNCNAME 
     227#define FUNCNAME MPID_nem_ib_queue_new_elem 
     228#undef FCNAME 
     229#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     230 
     231int MPID_nem_ib_queue_new_elem( 
     232        MPID_nem_ib_queue_elem_t **e, void *init_ptr) 
     233{ 
     234    int mpi_errno = MPI_SUCCESS; 
     235 
     236    (*e) = MPIU_Malloc(sizeof(MPID_nem_ib_queue_elem_t)); 
    237237 
    238238    if (NULL == *e) { 
    239239        MPIU_CHKMEM_SETERR (mpi_errno,  
    240                 sizeof(MPID_nem_ib_module_queue_elem_t),  
     240                sizeof(MPID_nem_ib_queue_elem_t),  
    241241                "IB module queue elem"); 
    242242    } 
     
    251251 
    252252#undef FUNCNAME 
    253 #define FUNCNAME MPID_nem_ib_module_queue_empty 
    254 #undef FCNAME 
    255 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    256  
    257 int MPID_nem_ib_module_queue_empty( 
    258         MPID_nem_ib_module_queue_t *q) 
     253#define FUNCNAME MPID_nem_ib_queue_empty 
     254#undef FCNAME 
     255#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     256 
     257int MPID_nem_ib_queue_empty( 
     258        MPID_nem_ib_queue_t *q) 
    259259{ 
    260260    return (NULL == q->head); 
     
    262262 
    263263#undef FUNCNAME 
    264 #define FUNCNAME MPID_nem_ib_module_queue_dequeue 
    265 #undef FCNAME 
    266 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    267  
    268 void MPID_nem_ib_module_queue_dequeue( 
    269         MPID_nem_ib_module_queue_t *q, 
    270         MPID_nem_ib_module_queue_elem_t **e) 
     264#define FUNCNAME MPID_nem_ib_queue_dequeue 
     265#undef FCNAME 
     266#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     267 
     268void MPID_nem_ib_queue_dequeue( 
     269        MPID_nem_ib_queue_t *q, 
     270        MPID_nem_ib_queue_elem_t **e) 
    271271{ 
    272272    *e = q->head; 
     
    283283 
    284284#undef FUNCNAME 
    285 #define FUNCNAME MPID_nem_ib_module_queue_enqueue 
    286 #undef FCNAME 
    287 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    288  
    289 void MPID_nem_ib_module_queue_enqueue( 
    290         MPID_nem_ib_module_queue_t *q, 
    291         MPID_nem_ib_module_queue_elem_t *e) 
     285#define FUNCNAME MPID_nem_ib_queue_enqueue 
     286#undef FCNAME 
     287#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     288 
     289void MPID_nem_ib_queue_enqueue( 
     290        MPID_nem_ib_queue_t *q, 
     291        MPID_nem_ib_queue_elem_t *e) 
    292292{ 
    293293    if(NULL == q->tail) { 
     
    302302 
    303303#undef FUNCNAME 
    304 #define FUNCNAME MPID_nem_ib_module_queue_free 
    305 #undef FCNAME 
    306 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    307  
    308 void MPID_nem_ib_module_queue_free( 
    309         MPID_nem_ib_module_queue_t *q, 
    310         MPID_nem_ib_module_queue_elem_t *e) 
     304#define FUNCNAME MPID_nem_ib_queue_free 
     305#undef FCNAME 
     306#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     307 
     308void MPID_nem_ib_queue_free( 
     309        MPID_nem_ib_queue_t *q, 
     310        MPID_nem_ib_queue_elem_t *e) 
    311311{ 
    312312    e->next = q->free_queue; 
     
    315315 
    316316#undef FUNCNAME 
    317 #define FUNCNAME MPID_nem_ib_module_queue_alloc 
    318 #undef FCNAME 
    319 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    320  
    321 int MPID_nem_ib_module_queue_alloc( 
    322         MPID_nem_ib_module_queue_t *q, 
    323         MPID_nem_ib_module_queue_elem_t **e) 
     317#define FUNCNAME MPID_nem_ib_queue_alloc 
     318#undef FCNAME 
     319#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     320 
     321int MPID_nem_ib_queue_alloc( 
     322        MPID_nem_ib_queue_t *q, 
     323        MPID_nem_ib_queue_elem_t **e) 
    324324{ 
    325325    int mpi_errno = MPI_SUCCESS; 
     
    329329        q->free_queue = q->free_queue->next; 
    330330    } else { 
    331         *e = MPIU_Malloc(sizeof(MPID_nem_ib_module_queue_elem_t)); 
     331        *e = MPIU_Malloc(sizeof(MPID_nem_ib_queue_elem_t)); 
    332332        if(NULL == *e) { 
    333333            MPIU_CHKMEM_SETERR(mpi_errno,  
    334                     sizeof(MPID_nem_ib_module_queue_elem_t),  
     334                    sizeof(MPID_nem_ib_queue_elem_t),  
    335335                    "IB Module Queue Element"); 
    336336        } 
     
    344344 
    345345#undef FUNCNAME 
    346 #define FUNCNAME MPID_nem_ib_module_queue_finalize 
    347 #undef FCNAME 
    348 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    349  
    350 void MPID_nem_ib_module_queue_finalize( 
    351         MPID_nem_ib_module_queue_t *q) 
    352 { 
    353     MPID_nem_ib_module_queue_elem_t *e; 
    354  
    355     while(!MPID_nem_ib_module_queue_empty(q)) { 
    356  
    357         MPID_nem_ib_module_queue_dequeue(q, &e); 
     346#define FUNCNAME MPID_nem_ib_queue_finalize 
     347#undef FCNAME 
     348#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     349 
     350void MPID_nem_ib_queue_finalize( 
     351        MPID_nem_ib_queue_t *q) 
     352{ 
     353    MPID_nem_ib_queue_elem_t *e; 
     354 
     355    while(!MPID_nem_ib_queue_empty(q)) { 
     356 
     357        MPID_nem_ib_queue_dequeue(q, &e); 
    358358 
    359359        MPIU_Free(e); 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_utils.h

    r3234 r3763  
    33 *      See COPYRIGHT in top-level directory. 
    44 */ 
    5 #ifndef _IB_UTILS_H 
    6 #define _IB_UTILS_H 
     5#ifndef IB_UTILS_H 
     6#define IB_UTILS_H 
    77 
    88#include <stdio.h> 
     
    2727    char            hostname[MAX_HOSTNAME_LEN]; 
    2828    int             rank; 
    29 } MPID_nem_ib_module_proc_desc_t; 
     29} MPID_nem_ib_proc_desc_t; 
    3030 
    31 MPID_nem_ib_module_proc_desc_t me; 
     31MPID_nem_ib_proc_desc_t me; 
    3232 
    3333 
     
    4343    struct _hash_elem       *prev; 
    4444    struct _hash_elem       *next; 
    45 } MPID_nem_ib_module_hash_elem_t, *MPID_nem_ib_module_hash_elem_ptr_t; 
     45} MPID_nem_ib_hash_elem_t, *MPID_nem_ib_hash_elem_ptr_t; 
    4646 
    4747typedef struct { 
    48     MPID_nem_ib_module_hash_elem_ptr_t      entries; 
     48    MPID_nem_ib_hash_elem_ptr_t      entries; 
    4949    uint32_t                                num_entries; 
    5050    pthread_mutex_t                         hash_table_lock; 
    51 } MPID_nem_ib_module_hash_table_t, *MPID_nem_ib_module_hash_table_ptr_t; 
     51} MPID_nem_ib_hash_table_t, *MPID_nem_ib_hash_table_ptr_t; 
    5252 
    5353typedef struct _ib_queue_elem { 
    5454    void                    *data; 
    5555    struct _ib_queue_elem   *next; 
    56 } MPID_nem_ib_module_queue_elem_t, *MPID_nem_ib_module_queue_elem_ptr_t; 
     56} MPID_nem_ib_queue_elem_t, *MPID_nem_ib_queue_elem_ptr_t; 
    5757 
    5858typedef struct _ib_queue { 
    59     MPID_nem_ib_module_queue_elem_t *head; 
    60     MPID_nem_ib_module_queue_elem_t *tail; 
    61     MPID_nem_ib_module_queue_elem_t *free_queue; 
    62 } MPID_nem_ib_module_queue_t, *MPID_nem_ib_module_queue_ptr_t; 
     59    MPID_nem_ib_queue_elem_t *head; 
     60    MPID_nem_ib_queue_elem_t *tail; 
     61    MPID_nem_ib_queue_elem_t *free_queue; 
     62} MPID_nem_ib_queue_t, *MPID_nem_ib_queue_ptr_t; 
    6363 
    64 extern MPID_nem_ib_module_queue_ptr_t MPID_nem_ib_module_vc_queue; 
     64extern MPID_nem_ib_queue_ptr_t MPID_nem_ib_vc_queue; 
    6565 
    66 int MPID_nem_ib_module_init_hash_table( 
    67         MPID_nem_ib_module_hash_table_ptr_t table, 
     66int MPID_nem_ib_init_hash_table( 
     67        MPID_nem_ib_hash_table_ptr_t table, 
    6868        uint32_t nentries); 
    6969 
    70 int MPID_nem_ib_module_insert_hash_elem( 
    71         MPID_nem_ib_module_hash_table_ptr_t table, 
     70int MPID_nem_ib_insert_hash_elem( 
     71        MPID_nem_ib_hash_table_ptr_t table, 
    7272        uint64_t key, 
    7373        void *data, 
    7474        uint32_t len); 
    7575 
    76 void* MPID_nem_ib_module_lookup_hash_table( 
    77         MPID_nem_ib_module_hash_table_ptr_t table, 
     76void* MPID_nem_ib_lookup_hash_table( 
     77        MPID_nem_ib_hash_table_ptr_t table, 
    7878        uint64_t key, uint32_t unique_id); 
    7979 
    80 void MPID_nem_ib_module_finalize_hash_table( 
    81         MPID_nem_ib_module_hash_table_ptr_t table); 
     80void MPID_nem_ib_finalize_hash_table( 
     81        MPID_nem_ib_hash_table_ptr_t table); 
    8282 
    83 int MPID_nem_ib_module_queue_init(MPID_nem_ib_module_queue_t**); 
     83int MPID_nem_ib_queue_init(MPID_nem_ib_queue_t**); 
    8484 
    85 int MPID_nem_ib_module_queue_new_elem( 
    86         MPID_nem_ib_module_queue_elem_t **, void *init_ptr); 
     85int MPID_nem_ib_queue_new_elem( 
     86        MPID_nem_ib_queue_elem_t **, void *init_ptr); 
    8787 
    88 int MPID_nem_ib_module_queue_empty(MPID_nem_ib_module_queue_t *q); 
     88int MPID_nem_ib_queue_empty(MPID_nem_ib_queue_t *q); 
    8989 
    90 void MPID_nem_ib_module_queue_dequeue( 
    91         MPID_nem_ib_module_queue_t *q, 
    92         MPID_nem_ib_module_queue_elem_t **e); 
     90void MPID_nem_ib_queue_dequeue( 
     91        MPID_nem_ib_queue_t *q, 
     92        MPID_nem_ib_queue_elem_t **e); 
    9393 
    94 void MPID_nem_ib_module_queue_enqueue( 
    95         MPID_nem_ib_module_queue_t *q, 
    96         MPID_nem_ib_module_queue_elem_t *e); 
     94void MPID_nem_ib_queue_enqueue( 
     95        MPID_nem_ib_queue_t *q, 
     96        MPID_nem_ib_queue_elem_t *e); 
    9797 
    98 void MPID_nem_ib_module_queue_free( 
    99         MPID_nem_ib_module_queue_t *q, 
    100         MPID_nem_ib_module_queue_elem_t *e); 
     98void MPID_nem_ib_queue_free( 
     99        MPID_nem_ib_queue_t *q, 
     100        MPID_nem_ib_queue_elem_t *e); 
    101101 
    102 int MPID_nem_ib_module_queue_alloc( 
    103         MPID_nem_ib_module_queue_t *q, 
    104         MPID_nem_ib_module_queue_elem_t **e); 
     102int MPID_nem_ib_queue_alloc( 
     103        MPID_nem_ib_queue_t *q, 
     104        MPID_nem_ib_queue_elem_t **e); 
    105105 
    106 void MPID_nem_ib_module_queue_finalize( 
    107         MPID_nem_ib_module_queue_t *q); 
     106void MPID_nem_ib_queue_finalize( 
     107        MPID_nem_ib_queue_t *q); 
    108108 
    109109#define INIT_NEM_IB_PROC_DESC(_rank) {                          \ 
     
    134134#endif 
    135135 
    136 #endif  /* _IB_UTILS_H */ 
     136#endif  /* IB_UTILS_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_vc_finalize.c

    • Property svn:mergeinfo set
    r3391 r3763  
    66#define _GNU_SOURCE 
    77#include "mpidimpl.h" 
    8 #include "ib_module_impl.h" 
     8#include "ib_impl.h" 
    99#include "ib_device.h" 
    10 #include "ib_module_cm.h" 
     10#include "ib_cm.h" 
    1111#include "ib_utils.h" 
    1212 
    1313#undef FUNCNAME 
    14 #define FUNCNAME MPID_nem_ib_module_vc_finalize 
     14#define FUNCNAME MPID_nem_ib_vc_finalize 
    1515#undef FCNAME 
    1616#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1717 
    18 int MPID_nem_ib_module_vc_terminate (MPIDI_VC_t *vc) 
     18int MPID_nem_ib_vc_terminate (MPIDI_VC_t *vc) 
    1919{ 
    2020    int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/ib/ib_vc_init.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55#define _GNU_SOURCE 
    66#include "mpidimpl.h" 
    7 #include "ib_module_impl.h" 
     7#include "ib_impl.h" 
    88#include "ib_device.h" 
    9 #include "ib_module_cm.h" 
     9#include "ib_cm.h" 
    1010#include "ib_utils.h" 
    1111 
    1212#undef FUNCNAME 
    13 #define FUNCNAME MPID_nem_ib_module_vc_init 
     13#define FUNCNAME MPID_nem_ib_vc_init 
    1414#undef FCNAME 
    1515#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1616 
    17 int MPID_nem_ib_module_vc_init (MPIDI_VC_t *vc,  
     17int MPID_nem_ib_vc_init (MPIDI_VC_t *vc,  
    1818        const char *business_card) 
    1919{ 
     
    8484    remote_info->vc = (void *) vc; 
    8585 
    86     mpi_errno = MPID_nem_ib_module_insert_hash_elem( 
     86    mpi_errno = MPID_nem_ib_insert_hash_elem( 
    8787        &MPID_nem_ib_cm_ctxt_ptr->hash_table, 
    8888        guid, (void *) remote_info, ud_qpn); 
     
    9292    } 
    9393 
    94     MPID_nem_ib_module_queue_init( 
    95             (MPID_nem_ib_module_queue_t **)(&VC_FIELD(vc, ib_send_queue))); 
     94    MPID_nem_ib_queue_init( 
     95            (MPID_nem_ib_queue_t **)(&VC_FIELD(vc, ib_send_queue))); 
    9696 
    9797    NEM_IB_DBG("VC Init called, vc->pg_rank %d, ud_qpn %u, dlid %u, GUID %lu", 
     
    105105 
    106106#undef FUNCNAME 
    107 #define FUNCNAME MPID_nem_ib_module_vc_destroy 
     107#define FUNCNAME MPID_nem_ib_vc_destroy 
    108108#undef FCNAME 
    109109#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    110 int MPID_nem_ib_module_vc_destroy(MPIDI_VC_t *vc) 
     110int MPID_nem_ib_vc_destroy(MPIDI_VC_t *vc) 
    111111{ 
    112112    int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/Makefile.sm

    r188 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   mx_module_finalize.c  mx_module_init.c  mx_module_poll.c      mx_module_send.c \ 
    5   mx_module_register.c  mx_module_test.c 
     4  mx_finalize.c  mx_init.c  mx_poll.c      mx_send.c \ 
     5  mx_register.c  mx_test.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_finalize.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "mx_module_impl.h" 
     7#include "mx_impl.h" 
    88#include "myriexpress.h" 
    99 
    1010 
    1111#undef FUNCNAME 
    12 #define FUNCNAME MPID_nem_mx_module_finalize 
     12#define FUNCNAME MPID_nem_mx_finalize 
    1313#undef FCNAME 
    1414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1515int 
    16 MPID_nem_mx_module_finalize() 
     16MPID_nem_mx_finalize() 
    1717{ 
    1818   int mpi_errno = MPI_SUCCESS; 
     
    2424        while(MPID_nem_module_mx_pendings_sends > 0) 
    2525          { 
    26              MPID_nem_mx_module_poll(MPID_NEM_POLL_OUT); 
     26             MPID_nem_mx_poll(MPID_NEM_POLL_OUT); 
    2727          } 
    2828        ret = mx_close_endpoint(MPID_nem_module_mx_local_endpoint); 
     
    4444 
    4545#undef FUNCNAME 
    46 #define FUNCNAME MPID_nem_mx_module_ckpt_shutdown 
     46#define FUNCNAME MPID_nem_mx_ckpt_shutdown 
    4747#undef FCNAME 
    4848#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    4949int 
    50 MPID_nem_mx_module_ckpt_shutdown () 
     50MPID_nem_mx_ckpt_shutdown () 
    5151{ 
    5252   int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_impl.h

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #ifndef MX_MODULE_IMPL_H 
    8 #define MX_MODULE_IMPL_H 
     7#ifndef MX_IMPL_H 
     8#define MX_IMPL_H 
    99#include <myriexpress.h> 
    1010#include "mpid_nem_impl.h" 
    1111 
    12 int MPID_nem_mx_module_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
     12int MPID_nem_mx_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
    1313                    int num_proc_elements, MPID_nem_cell_ptr_t module_elements, int num_module_elements, 
    1414                    MPID_nem_queue_ptr_t *module_free_queue, int ckpt_restart, 
    1515                    MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p); 
    16 int MPID_nem_mx_module_finalize (void); 
    17 int MPID_nem_mx_module_ckpt_shutdown (void); 
    18 int MPID_nem_mx_module_poll(MPID_nem_poll_dir_t in_or_out); 
    19 int MPID_nem_mx_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    20 int MPID_nem_mx_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    21 int MPID_nem_mx_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    22 int MPID_nem_mx_module_vc_init (MPIDI_VC_t *vc); 
    23 int MPID_nem_mx_module_vc_destroy(MPIDI_VC_t *vc); 
    24 int MPID_nem_mx_module_vc_terminate (MPIDI_VC_t *vc); 
     16int MPID_nem_mx_finalize (void); 
     17int MPID_nem_mx_ckpt_shutdown (void); 
     18int MPID_nem_mx_poll(MPID_nem_poll_dir_t in_or_out); 
     19int MPID_nem_mx_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     20int MPID_nem_mx_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     21int MPID_nem_mx_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     22int MPID_nem_mx_vc_init (MPIDI_VC_t *vc); 
     23int MPID_nem_mx_vc_destroy(MPIDI_VC_t *vc); 
     24int MPID_nem_mx_vc_terminate (MPIDI_VC_t *vc); 
    2525 
    26 int  MPID_nem_mx_module_test (void); 
     26int  MPID_nem_mx_test (void); 
    2727 
    28 int  MPID_mem_mx_module_register_mem (void *p, int len); 
    29 int  MPID_nem_mx_module_deregister_mem (void *p, int len); 
     28int  MPID_mem_mx_register_mem (void *p, int len); 
     29int  MPID_nem_mx_deregister_mem (void *p, int len); 
    3030 
    3131/* completion counter is atomically decremented when operation completes */ 
    32 int  MPID_nem_mx_module_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
    33 int  MPID_nem_mx_module_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
     32int  MPID_nem_mx_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
     33int  MPID_nem_mx_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
    3434 
    3535/* large message transfer functions */ 
    36 int  MPID_nem_mx_module_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
    37 int  MPID_nem_mx_module_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
    38 int  MPID_nem_mx_module_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    39 int  MPID_nem_mx_module_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    40 int  MPID_nem_mx_module_lmt_send_post (struct iovec cookie); 
    41 int  MPID_nem_mx_module_lmt_recv_post (struct iovec cookie); 
     36int  MPID_nem_mx_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
     37int  MPID_nem_mx_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
     38int  MPID_nem_mx_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     39int  MPID_nem_mx_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     40int  MPID_nem_mx_lmt_send_post (struct iovec cookie); 
     41int  MPID_nem_mx_lmt_recv_post (struct iovec cookie); 
    4242 
    4343#define MPID_NEM_CELL_LEN_MX          (32*1024) 
     
    6262    unsigned int       remote_endpoint_id; /* uint32_t equivalent */ 
    6363    unsigned long long remote_nic_id;      /* uint64_t equivalent */ 
    64 } MPID_nem_mx_module_vc_area; 
     64} MPID_nem_mx_vc_area; 
    6565 
    6666/* accessor macro to private fields in VC */ 
    67 #define VC_FIELD(vc, field) (((MPID_nem_mx_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     67#define VC_FIELD(vc, field) (((MPID_nem_mx_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    6868 
    6969typedef struct MPID_nem_mx_cell 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_init.c

    • Property svn:mergeinfo set
    r3391 r3763  
    77#include "myriexpress.h" 
    88#include "mpid_nem_impl.h" 
    9 #include "mx_module_impl.h" 
    10  
    11 MPID_nem_netmod_funcs_t MPIDI_nem_mx_module_funcs = { 
    12     MPID_nem_mx_module_init, 
    13     MPID_nem_mx_module_finalize, 
    14     MPID_nem_mx_module_ckpt_shutdown, 
    15     MPID_nem_mx_module_poll, 
    16     MPID_nem_mx_module_send, 
    17     MPID_nem_mx_module_get_business_card, 
    18     MPID_nem_mx_module_connect_to_root, 
    19     MPID_nem_mx_module_vc_init, 
    20     MPID_nem_mx_module_vc_destroy, 
    21     MPID_nem_mx_module_vc_terminate 
     9#include "mx_impl.h" 
     10 
     11MPID_nem_netmod_funcs_t MPIDI_nem_mx_funcs = { 
     12    MPID_nem_mx_init, 
     13    MPID_nem_mx_finalize, 
     14    MPID_nem_mx_ckpt_shutdown, 
     15    MPID_nem_mx_poll, 
     16    MPID_nem_mx_send, 
     17    MPID_nem_mx_get_business_card, 
     18    MPID_nem_mx_connect_to_root, 
     19    MPID_nem_mx_vc_init, 
     20    MPID_nem_mx_vc_destroy, 
     21    MPID_nem_mx_vc_terminate 
    2222}; 
    2323 
     
    147147/* 
    148148 int   
    149    MPID_nem_mx_module_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
     149   MPID_nem_mx_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
    150150                  MPID_nem_cell_ptr_t module_elements, int num_module_elements,  
    151151                  MPID_nem_queue_ptr_t *module_free_queue) 
     
    166166 
    167167#undef FUNCNAME 
    168 #define FUNCNAME MPID_nem_mx_module_init 
    169 #undef FCNAME 
    170 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    171 int 
    172 MPID_nem_mx_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     168#define FUNCNAME MPID_nem_mx_init 
     169#undef FCNAME 
     170#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     171int 
     172MPID_nem_mx_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    173173                MPID_nem_queue_ptr_t proc_free_queue,  
    174174                MPID_nem_cell_ptr_t proc_elements,   int num_proc_elements, 
     
    184184     { 
    185185        init_mx(pg_p); 
    186         mpi_errno = MPID_nem_mx_module_get_business_card (pg_rank, bc_val_p, val_max_sz_p); 
     186        mpi_errno = MPID_nem_mx_get_business_card (pg_rank, bc_val_p, val_max_sz_p); 
    187187        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    188188     } 
     
    209209 
    210210#undef FUNCNAME 
    211 #define FUNCNAME MPID_nem_mx_module_get_business_card 
    212 #undef FCNAME 
    213 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    214 int 
    215 MPID_nem_mx_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
     211#define FUNCNAME MPID_nem_mx_get_business_card 
     212#undef FCNAME 
     213#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     214int 
     215MPID_nem_mx_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
    216216{ 
    217217   int mpi_errno = MPI_SUCCESS; 
     
    253253 
    254254#undef FUNCNAME 
    255 #define FUNCNAME MPID_nem_mx_module_get_from_bc 
    256 #undef FCNAME 
    257 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    258 int 
    259 MPID_nem_mx_module_get_from_bc (const char *business_card, uint32_t *remote_endpoint_id, uint64_t *remote_nic_id) 
     255#define FUNCNAME MPID_nem_mx_get_from_bc 
     256#undef FCNAME 
     257#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     258int 
     259MPID_nem_mx_get_from_bc (const char *business_card, uint32_t *remote_endpoint_id, uint64_t *remote_nic_id) 
    260260{ 
    261261   int mpi_errno = MPI_SUCCESS; 
     
    285285 
    286286#undef FUNCNAME 
    287 #define FUNCNAME MPID_nem_mx_module_connect_to_root 
    288 #undef FCNAME 
    289 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    290 int 
    291 MPID_nem_mx_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
     287#define FUNCNAME MPID_nem_mx_connect_to_root 
     288#undef FCNAME 
     289#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     290int 
     291MPID_nem_mx_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
    292292{ 
    293293   int mpi_errno = MPI_SUCCESS; 
     
    299299 
    300300#undef FUNCNAME 
    301 #define FUNCNAME MPID_nem_mx_module_vc_init 
    302 #undef FCNAME 
    303 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    304 int 
    305 MPID_nem_mx_module_vc_init (MPIDI_VC_t *vc, const char *business_card) 
     301#define FUNCNAME MPID_nem_mx_vc_init 
     302#undef FCNAME 
     303#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     304int 
     305MPID_nem_mx_vc_init (MPIDI_VC_t *vc, const char *business_card) 
    306306{ 
    307307   int mpi_errno = MPI_SUCCESS; 
     
    309309    
    310310   /* first make sure that our private fields in the vc fit into the area provided  */ 
    311    MPIU_Assert(sizeof(MPID_nem_mx_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     311   MPIU_Assert(sizeof(MPID_nem_mx_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    312312 
    313313   if( MPID_nem_mem_region.ext_procs > 0) 
    314314     { 
    315         mpi_errno = MPID_nem_mx_module_get_from_bc (business_card, &VC_FIELD(vc, remote_endpoint_id), &VC_FIELD(vc, remote_nic_id)); 
     315        mpi_errno = MPID_nem_mx_get_from_bc (business_card, &VC_FIELD(vc, remote_endpoint_id), &VC_FIELD(vc, remote_nic_id)); 
    316316        /* --BEGIN ERROR HANDLING-- */    
    317317        if (mpi_errno)  
     
    337337 
    338338#undef FUNCNAME 
    339 #define FUNCNAME MPID_nem_mx_module_vc_destroy 
    340 #undef FCNAME 
    341 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    342 int MPID_nem_mx_module_vc_destroy(MPIDI_VC_t *vc) 
     339#define FUNCNAME MPID_nem_mx_vc_destroy 
     340#undef FCNAME 
     341#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     342int MPID_nem_mx_vc_destroy(MPIDI_VC_t *vc) 
    343343{ 
    344344    int mpi_errno = MPI_SUCCESS;    
     
    353353 
    354354#undef FUNCNAME 
    355 #define FUNCNAME MPID_nem_mx_module_vc_terminate 
    356 #undef FCNAME 
    357 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    358 int MPID_nem_mx_module_vc_terminate (MPIDI_VC_t *vc) 
     355#define FUNCNAME MPID_nem_mx_vc_terminate 
     356#undef FCNAME 
     357#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     358int MPID_nem_mx_vc_terminate (MPIDI_VC_t *vc) 
    359359{ 
    360360    return MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_poll.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "mx_module_impl.h" 
     7#include "mx_impl.h" 
    88#include "myriexpress.h" 
    99#include "my_papi_defs.h" 
     
    3535 
    3636#undef FUNCNAME 
    37 #define FUNCNAME MPID_nem_mx_module_send_from_queue 
     37#define FUNCNAME MPID_nem_mx_send_from_queue 
    3838#undef FCNAME 
    3939#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    4040inline int 
    41 MPID_nem_mx_module_send_from_queue() 
     41MPID_nem_mx_send_from_queue() 
    4242{ 
    4343   int         mpi_errno = MPI_SUCCESS; 
     
    7878 
    7979#undef FUNCNAME 
    80 #define FUNCNAME MPID_nem_mx_module_recv 
     80#define FUNCNAME MPID_nem_mx_recv 
    8181#undef FCNAME 
    8282#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    8383inline int  
    84 MPID_nem_mx_module_recv() 
     84MPID_nem_mx_recv() 
    8585{ 
    8686   int                 mpi_errno = MPI_SUCCESS; 
     
    168168 
    169169#undef FUNCNAME 
    170 #define FUNCNAME MPID_nem_mx_module_poll 
     170#define FUNCNAME MPID_nem_mx_poll 
    171171#undef FCNAME 
    172172#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    173173int 
    174 MPID_nem_mx_module_poll(MPID_nem_poll_dir_t in_or_out) 
     174MPID_nem_mx_poll(MPID_nem_poll_dir_t in_or_out) 
    175175{ 
    176176   int mpi_errno = MPI_SUCCESS; 
     
    178178   if (in_or_out == MPID_NEM_POLL_OUT) 
    179179     { 
    180         MPID_nem_mx_module_send_from_queue(); 
    181         MPID_nem_mx_module_recv(); 
     180        MPID_nem_mx_send_from_queue(); 
     181        MPID_nem_mx_recv(); 
    182182     } 
    183183   else 
    184184     { 
    185         MPID_nem_mx_module_recv(); 
    186         MPID_nem_mx_module_send_from_queue(); 
     185        MPID_nem_mx_recv(); 
     186        MPID_nem_mx_send_from_queue(); 
    187187     } 
    188188    
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_register.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "mx_module_impl.h" 
     7#include "mx_impl.h" 
    88#include "myriexpress.h" 
    99 
    1010int 
    11 MPID_nem_mx_module_register_mem (void *p, int len) 
     11MPID_nem_mx_register_mem (void *p, int len) 
    1212{ 
    1313   /* 
     
    2020 
    2121int 
    22 MPID_nem_mx_module_deregister_mem (void *p, int len) 
     22MPID_nem_mx_deregister_mem (void *p, int len) 
    2323{ 
    2424   /* 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_send.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "mx_module_impl.h" 
     7#include "mx_impl.h" 
    88#include "myriexpress.h" 
    99#include "my_papi_defs.h" 
    1010 
    1111#undef FUNCNAME 
    12 #define FUNCNAME MPID_nem_mx_module_send 
     12#define FUNCNAME MPID_nem_mx_send 
    1313#undef FCNAME 
    1414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1515int  
    16 MPID_nem_mx_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
     16MPID_nem_mx_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
    1717{ 
    1818   MPID_nem_mx_cell_ptr_t cell_req; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/mx/mx_test.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "mx_module_impl.h" 
     7#include "mx_impl.h" 
    88#include "myriexpress.h" 
    99 
    1010int 
    11 MPID_nem_mx_module_test() 
     11MPID_nem_mx_test() 
    1212{ 
    1313    return 0; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/none

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/none/Makefile.sm

    r3364 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   none_module.c 
     4  none.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/none/none.c

    • Property svn:mergeinfo set
    r3364 r3763  
    6767} 
    6868 
    69 MPID_nem_netmod_funcs_t MPIDI_nem_none_module_funcs = { 
     69MPID_nem_netmod_funcs_t MPIDI_nem_none_funcs = { 
    7070    nm_init, 
    7171    nm_finalize, 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/Makefile.sm

    r100 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   psm_module_finalize.c  psm_module_init.c  psm_module_poll.c      psm_module_send.c \ 
    5   psm_module_getput.c    psm_module_lmt.c   psm_module_register.c  psm_module_test.c 
     4  psm_finalize.c  psm_init.c  psm_poll.c      psm_send.c \ 
     5  psm_getput.c    psm_lmt.c   psm_register.c  psm_test.c 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_finalize.c

    • Property svn:mergeinfo set
    r100 r3763  
    55 */ 
    66 
    7 #include "psm_module_impl.h" 
     7#include "psm_impl.h" 
    88#include "psm.h" 
    99 
    1010#undef FUNCNAME 
    11 #define FUNCNAME MPID_nem_psm_module_finalize 
     11#define FUNCNAME MPID_nem_psm_finalize 
    1212#undef FCNAME 
    1313#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1414int 
    15 MPID_nem_psm_module_finalize() 
     15MPID_nem_psm_finalize() 
    1616{ 
    1717   int mpi_errno = MPI_SUCCESS; 
     
    2323        while(MPID_nem_module_psm_pendings_sends > 0) 
    2424        { 
    25               MPID_nem_psm_module_poll(MPID_NEM_POLL_OUT); 
     25              MPID_nem_psm_poll(MPID_NEM_POLL_OUT); 
    2626        } 
    2727        ret = psm_mq_finalize(MPID_nem_module_psm_mq); 
     
    4949 
    5050#undef FUNCNAME 
    51 #define FUNCNAME MPID_nem_psm_module_ckpt_shutdown 
     51#define FUNCNAME MPID_nem_psm_ckpt_shutdown 
    5252#undef FCNAME 
    5353#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    5454int 
    55 MPID_nem_psm_module_ckpt_shutdown () 
     55MPID_nem_psm_ckpt_shutdown () 
    5656{ 
    5757   int mpi_errno = MPI_SUCCESS; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_getput.c

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_impl.h

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #ifndef PSM_MODULE_IMPL_H 
    8 #define PSM_MODULE_IMPL_H 
     7#ifndef PSM_IMPL_H 
     8#define PSM_IMPL_H 
    99 
    1010#include <sys/types.h> 
     
    2121#include "mpid_nem_impl.h" 
    2222 
    23 int MPID_nem_psm_module_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
     23int MPID_nem_psm_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, 
    2424                    int num_proc_elements, MPID_nem_cell_ptr_t module_elements, int num_module_elements, 
    2525                    MPID_nem_queue_ptr_t *module_free_queue, int ckpt_restart, 
    2626                    MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p); 
    27 int MPID_nem_psm_module_finalize (void); 
    28 int MPID_nem_psm_module_ckpt_shutdown (void); 
    29 int MPID_nem_psm_module_poll(MPID_nem_poll_dir_t in_or_out); 
    30 int MPID_nem_psm_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    31 int MPID_nem_psm_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    32 int MPID_nem_psm_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    33 int MPID_nem_psm_module_vc_init (MPIDI_VC_t *vc); 
    34 int MPID_nem_psm_module_vc_destroy(MPIDI_VC_t *vc); 
    35 int MPID_nem_psm_module_vc_terminate (MPIDI_VC_t *vc); 
     27int MPID_nem_psm_finalize (void); 
     28int MPID_nem_psm_ckpt_shutdown (void); 
     29int MPID_nem_psm_poll(MPID_nem_poll_dir_t in_or_out); 
     30int MPID_nem_psm_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     31int MPID_nem_psm_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     32int MPID_nem_psm_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     33int MPID_nem_psm_vc_init (MPIDI_VC_t *vc); 
     34int MPID_nem_psm_vc_destroy(MPIDI_VC_t *vc); 
     35int MPID_nem_psm_vc_terminate (MPIDI_VC_t *vc); 
    3636 
    37 int  MPID_nem_psm_module_test (void); 
     37int  MPID_nem_psm_test (void); 
    3838 
    39 int  MPID_mem_psm_module_register_mem (void *p, int len); 
    40 int  MPID_nem_psm_module_deregister_mem (void *p, int len); 
     39int  MPID_mem_psm_register_mem (void *p, int len); 
     40int  MPID_nem_psm_deregister_mem (void *p, int len); 
    4141 
    4242/* completion counter is atomically decremented when operation completes */ 
    43 int  MPID_nem_psm_module_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
    44 int  MPID_nem_psm_module_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
     43int  MPID_nem_psm_get (void *target_p, void *source_p, int len, MPIDI_VC_t *source_vc, int *completion_ctr); 
     44int  MPID_nem_psm_put (void *target_p, void *source_p, int len, MPIDI_VC_t *target_vc, int *completion_ctr); 
    4545 
    4646/* large message transfer functions */ 
    47 int  MPID_nem_psm_module_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
    48 int  MPID_nem_psm_module_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
    49 int  MPID_nem_psm_module_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    50 int  MPID_nem_psm_module_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
    51 int  MPID_nem_psm_module_lmt_send_post (struct iovec cookie); 
    52 int  MPID_nem_psm_module_lmt_recv_post (struct iovec cookie); 
     47int  MPID_nem_psm_lmt_send_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *dest, struct iovec *cookie); 
     48int  MPID_nem_psm_lmt_recv_pre (struct iovec *iov, size_t n_iov, MPIDI_VC_t *src, struct iovec *cookie); 
     49int  MPID_nem_psm_lmt_start_send (MPIDI_VC_t *dest, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     50int  MPID_nem_psm_lmt_start_recv (MPIDI_VC_t *src, struct iovec s_cookie, struct iovec r_cookie, int *completion_ctr); 
     51int  MPID_nem_psm_lmt_send_post (struct iovec cookie); 
     52int  MPID_nem_psm_lmt_recv_post (struct iovec cookie); 
    5353 
    5454#define SEC_IN_NS   1000000000ULL 
     
    8888{ 
    8989    psm_epid_t       remote_endpoint_id;  
    90 } MPID_nem_psm_module_vc_area; 
     90} MPID_nem_psm_vc_area; 
    9191 
    9292/* accessor macro to private fields in VC */ 
    93 #define VC_FIELD(vc, field) (((MPID_nem_psm_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     93#define VC_FIELD(vc, field) (((MPID_nem_psm_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    9494 
    9595typedef struct MPID_nem_psm_cell 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_init.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "psm_module_impl.h" 
     7#include "psm_impl.h" 
    88#include "psm.h" 
    99#include "psm_mq.h" 
    1010#include "mpid_nem_impl.h" 
    1111 
    12 MPID_nem_netmod_funcs_t MPIDI_nem_psm_module_funcs = { 
    13     MPID_nem_psm_module_init, 
    14     MPID_nem_psm_module_finalize, 
    15     MPID_nem_psm_module_ckpt_shutdown, 
    16     MPID_nem_psm_module_poll, 
    17     MPID_nem_psm_module_send, 
    18     MPID_nem_psm_module_get_business_card, 
    19     MPID_nem_psm_module_connect_to_root, 
    20     MPID_nem_psm_module_vc_init, 
    21     MPID_nem_psm_module_vc_destroy, 
    22     MPID_nem_psm_module_vc_terminate 
     12MPID_nem_netmod_funcs_t MPIDI_nem_psm_funcs = { 
     13    MPID_nem_psm_init, 
     14    MPID_nem_psm_finalize, 
     15    MPID_nem_psm_ckpt_shutdown, 
     16    MPID_nem_psm_poll, 
     17    MPID_nem_psm_send, 
     18    MPID_nem_psm_get_business_card, 
     19    MPID_nem_psm_connect_to_root, 
     20    MPID_nem_psm_vc_init, 
     21    MPID_nem_psm_vc_destroy, 
     22    MPID_nem_psm_vc_terminate 
    2323}; 
    2424 
     
    229229/* 
    230230 int   
    231    MPID_nem_psm_module_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
     231   MPID_nem_psm_init(MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, 
    232232                  MPID_nem_cell_ptr_t module_elements, int num_module_elements,  
    233233                  MPID_nem_queue_ptr_t *module_free_queue) 
     
    248248 
    249249#undef FUNCNAME 
    250 #define FUNCNAME MPID_nem_psm_module_init 
     250#define FUNCNAME MPID_nem_psm_init 
    251251#undef FCNAME 
    252252#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    253253int 
    254 MPID_nem_psm_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     254MPID_nem_psm_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    255255                MPID_nem_queue_ptr_t proc_free_queue,  
    256256                MPID_nem_cell_ptr_t proc_elements,   int num_proc_elements, 
     
    295295 
    296296#undef FUNCNAME 
    297 #define FUNCNAME MPID_nem_psm_module_get_business_card 
     297#define FUNCNAME MPID_nem_psm_get_business_card 
    298298#undef FCNAME 
    299299#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    300300int 
    301 MPID_nem_psm_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
     301MPID_nem_psm_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
    302302{ 
    303303   int mpi_errno = MPI_SUCCESS; 
     
    328328 
    329329#undef FUNCNAME 
    330 #define FUNCNAME MPID_nem_psm_module_get_from_bc 
     330#define FUNCNAME MPID_nem_psm_get_from_bc 
    331331#undef FCNAME 
    332332#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    333333int 
    334 MPID_nem_psm_module_get_from_bc (const char *business_card, psm_epid_t *remote_endpoint_id) 
     334MPID_nem_psm_get_from_bc (const char *business_card, psm_epid_t *remote_endpoint_id) 
    335335{ 
    336336   int mpi_errno = MPI_SUCCESS; 
     
    352352 
    353353#undef FUNCNAME 
    354 #define FUNCNAME MPID_nem_psm_module_connect_to_root 
     354#define FUNCNAME MPID_nem_psm_connect_to_root 
    355355#undef FCNAME 
    356356#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    357357int 
    358 MPID_nem_psm_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
     358MPID_nem_psm_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
    359359{ 
    360360   int mpi_errno = MPI_SUCCESS; 
     
    366366 
    367367#undef FUNCNAME 
    368 #define FUNCNAME MPID_nem_psm_module_vc_init 
     368#define FUNCNAME MPID_nem_psm_vc_init 
    369369#undef FCNAME 
    370370#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    371371int 
    372 MPID_nem_psm_module_vc_init (MPIDI_VC_t *vc, const char *business_card) 
     372MPID_nem_psm_vc_init (MPIDI_VC_t *vc, const char *business_card) 
    373373{ 
    374374   int mpi_errno = MPI_SUCCESS; 
     
    377377    
    378378   /* first make sure that our private fields in the vc fit into the area provided  */ 
    379    MPIU_Assert(sizeof(MPID_nem_psm_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     379   MPIU_Assert(sizeof(MPID_nem_psm_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    380380 
    381381    
     
    383383/*    if( MPID_nem_mem_region.ext_procs > 0) */ 
    384384/*    { */ 
    385 /*      mpi_errno = MPID_nem_psm_module_get_from_bc (business_card, &VC_FIELD(vc, remote_endpoint_id)); */ 
     385/*      mpi_errno = MPID_nem_psm_get_from_bc (business_card, &VC_FIELD(vc, remote_endpoint_id)); */ 
    386386/*      /\* --BEGIN ERROR HANDLING-- *\/    */ 
    387387/*      if (mpi_errno)  */ 
     
    401401 
    402402#undef FUNCNAME 
    403 #define FUNCNAME MPID_nem_psm_module_vc_destroy 
    404 #undef FCNAME 
    405 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    406 int MPID_nem_psm_module_vc_destroy(MPIDI_VC_t *vc) 
     403#define FUNCNAME MPID_nem_psm_vc_destroy 
     404#undef FCNAME 
     405#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     406int MPID_nem_psm_vc_destroy(MPIDI_VC_t *vc) 
    407407{ 
    408408    int mpi_errno = MPI_SUCCESS;    
     
    418418 
    419419#undef FUNCNAME 
    420 #define FUNCNAME MPID_nem_psm_module_vc_terminate 
    421 #undef FCNAME 
    422 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    423 int MPID_nem_psm_module_vc_terminate (MPIDI_VC_t *vc) 
     420#define FUNCNAME MPID_nem_psm_vc_terminate 
     421#undef FCNAME 
     422#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     423int MPID_nem_psm_vc_terminate (MPIDI_VC_t *vc) 
    424424{ 
    425425    return MPI_SUCCESS; 
     
    428428 
    429429#undef FUNCNAME 
    430 #define FUNCNAME MPID_nem_psm_module_exchange_endpoints 
    431 #undef FCNAME 
    432 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    433 int MPID_nem_psm_module_exchange_endpoints(void) 
     430#define FUNCNAME MPID_nem_psm_exchange_endpoints 
     431#undef FCNAME 
     432#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     433int MPID_nem_psm_exchange_endpoints(void) 
    434434{ 
    435435 
     
    597597 
    598598#undef FUNCNAME 
    599 #define FUNCNAME MPID_nem_psm_module_connect 
    600 #undef FCNAME 
    601 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    602 int MPID_nem_psm_module_connect (void) 
     599#define FUNCNAME MPID_nem_psm_connect 
     600#undef FCNAME 
     601#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     602int MPID_nem_psm_connect (void) 
    603603{ 
    604604    int         mpi_errno = MPI_SUCCESS; 
     
    608608/*     if(!MPID_nem_module_psm_initialized) */ 
    609609/*     { */ 
    610 /*         ret = MPID_nem_psm_module_exchange_endpoints(); */ 
    611 /*         MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_psm_module_exchange_endpoints", "**MPID_nem_psm_module_exchange_endpoints %d", ret); */ 
     610/*         ret = MPID_nem_psm_exchange_endpoints(); */ 
     611/*         MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_psm_exchange_endpoints", "**MPID_nem_psm_exchange_endpoints %d", ret); */ 
    612612/*     } */ 
    613613 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_lmt.c

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_poll.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "psm_module_impl.h" 
     7#include "psm_impl.h" 
    88#include "psm.h" 
    99#include "my_papi_defs.h" 
     
    3535 
    3636#undef FUNCNAME 
    37 #define FUNCNAME MPID_nem_psm_module_send_from_queue 
     37#define FUNCNAME MPID_nem_psm_send_from_queue 
    3838#undef FCNAME 
    3939#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    4040inline int 
    41 MPID_nem_psm_module_send_from_queue() 
     41MPID_nem_psm_send_from_queue() 
    4242{ 
    4343   int         mpi_errno = MPI_SUCCESS; 
     
    8484 
    8585#undef FUNCNAME 
    86 #define FUNCNAME MPID_nem_psm_module_recv 
     86#define FUNCNAME MPID_nem_psm_recv 
    8787#undef FCNAME 
    8888#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    8989inline int  
    90 MPID_nem_psm_module_recv() 
     90MPID_nem_psm_recv() 
    9191{ 
    9292   int                 mpi_errno = MPI_SUCCESS; 
     
    180180 
    181181#undef FUNCNAME 
    182 #define FUNCNAME MPID_nem_psm_module_poll 
     182#define FUNCNAME MPID_nem_psm_poll 
    183183#undef FCNAME 
    184184#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    185185int 
    186 MPID_nem_psm_module_poll(MPID_nem_poll_dir_t in_or_out) 
     186MPID_nem_psm_poll(MPID_nem_poll_dir_t in_or_out) 
    187187{ 
    188188   int mpi_errno = MPI_SUCCESS; 
     
    192192   if (!MPID_nem_module_psm_connected) 
    193193   { 
    194        ret = MPID_nem_psm_module_connect(); 
    195        MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**psm_module_connect", "**psm_module_connect %d", ret); 
     194       ret = MPID_nem_psm_connect(); 
     195       MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**psm_connect", "**psm_connect %d", ret); 
    196196   } 
    197197    
     
    199199   if (in_or_out == MPID_NEM_POLL_OUT) 
    200200     { 
    201         MPID_nem_psm_module_send_from_queue(); 
    202         MPID_nem_psm_module_recv(); 
     201        MPID_nem_psm_send_from_queue(); 
     202        MPID_nem_psm_recv(); 
    203203     } 
    204204   else 
    205205     { 
    206         MPID_nem_psm_module_recv(); 
    207         MPID_nem_psm_module_send_from_queue(); 
     206        MPID_nem_psm_recv(); 
     207        MPID_nem_psm_send_from_queue(); 
    208208     } 
    209209    
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_register.c

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_send.c

    • Property svn:mergeinfo set
    r3391 r3763  
    55 */ 
    66 
    7 #include "psm_module_impl.h" 
     7#include "psm_impl.h" 
    88#include "psm.h" 
    99#include "my_papi_defs.h" 
    1010 
    1111#undef FUNCNAME 
    12 #define FUNCNAME MPID_nem_psm_module_send 
     12#define FUNCNAME MPID_nem_psm_send 
    1313#undef FCNAME 
    1414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1515int  
    16 MPID_nem_psm_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
     16MPID_nem_psm_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
    1717{ 
    1818    MPID_nem_psm_cell_ptr_t cell_req; 
     
    2929    if (!MPID_nem_module_psm_connected) 
    3030    { 
    31         ret = MPID_nem_psm_module_connect(); 
    32         MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**psm_module_connect", "**psm_module_connect %d", ret); 
     31        ret = MPID_nem_psm_connect(); 
     32        MPIU_ERR_CHKANDJUMP1 (ret != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**psm_connect", "**psm_connect %d", ret); 
    3333    } 
    3434 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/psm/psm_test.c

    • Property svn:mergeinfo set
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/Makefile.sm

    r3751 r3763  
    22           -I${top_builddir}/src/include 
    33lib${MPILIBNAME}_a_SOURCES = \ 
    4   tcp_module_finalize.c  tcp_module_init.c  tcp_module_poll.c  tcp_module_send.c tcp_module_utility.c socksm.c tcp_module_getip.c 
     4  tcp_finalize.c  tcp_init.c  tcp_poll.c  tcp_send.c tcp_utility.c socksm.c tcp_getip.c 
    55 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/socksm.c

    r3751 r3763  
    77#define SOCKSM_H_DEFGLOBALS_ 
    88 
    9 #include "tcp_module_impl.h" 
     9#include "tcp_impl.h" 
    1010#include "socksm.h" 
    1111 
     
    2626 
    2727static sockconn_t *g_sc_tbl = NULL; 
    28 pollfd_t *MPID_nem_tcp_module_plfd_tbl = NULL; 
    29  
    30 sockconn_t MPID_nem_tcp_module_g_lstn_sc = {0}; 
    31 pollfd_t MPID_nem_tcp_module_g_lstn_plfd = {0}; 
     28pollfd_t *MPID_nem_tcp_plfd_tbl = NULL; 
     29 
     30sockconn_t MPID_nem_tcp_g_lstn_sc = {0}; 
     31pollfd_t MPID_nem_tcp_g_lstn_plfd = {0}; 
    3232 
    3333/* We define this in order to trick the compiler into including 
    34    information about the MPID_nem_tcp_module_vc_area type.  This is 
     34   information about the MPID_nem_tcp_vc_area type.  This is 
    3535   needed to easily expand the VC_FIELD macro in a debugger.  The 
    3636   'unused' attribute keeps the compiler from complaining.  The 'used' 
    3737   attribute makes sure the symbol is added in the lib, even if it's 
    3838   unused */ 
    39 static MPID_nem_tcp_module_vc_area *dummy_vc_area ATTRIBUTE((unused, used)) = NULL; 
     39static MPID_nem_tcp_vc_area *dummy_vc_area ATTRIBUTE((unused, used)) = NULL; 
    4040 
    4141/* Debug function to dump the sockconn table.  This is intended to be 
     
    123123 
    124124    MPIU_Assert(g_sc_tbl == NULL); 
    125     MPIU_Assert(MPID_nem_tcp_module_plfd_tbl == NULL); 
     125    MPIU_Assert(MPID_nem_tcp_plfd_tbl == NULL); 
    126126 
    127127    MPIU_CHKPMEM_MALLOC (g_sc_tbl, sockconn_t *, g_tbl_capacity * sizeof(sockconn_t),  
    128128                         mpi_errno, "connection table"); 
    129     MPIU_CHKPMEM_MALLOC (MPID_nem_tcp_module_plfd_tbl, pollfd_t *, g_tbl_capacity * sizeof(pollfd_t),  
     129    MPIU_CHKPMEM_MALLOC (MPID_nem_tcp_plfd_tbl, pollfd_t *, g_tbl_capacity * sizeof(pollfd_t),  
    130130                         mpi_errno, "pollfd table"); 
    131131#if defined(MPICH_DEBUG_MEMINIT) 
     
    134134       remove this code if the fix ever gets into a release of valgrind. 
    135135       [goodell@ 2007-02-25] */ 
    136     memset(MPID_nem_tcp_module_plfd_tbl, 0, g_tbl_capacity * sizeof(pollfd_t)); 
     136    memset(MPID_nem_tcp_plfd_tbl, 0, g_tbl_capacity * sizeof(pollfd_t)); 
    137137#endif 
    138138 
    139139    for (i = 0; i < g_tbl_capacity; i++) { 
    140140        INIT_SC_ENTRY(((sockconn_t *)&g_sc_tbl[i]), i); 
    141         INIT_POLLFD_ENTRY(((pollfd_t *)&MPID_nem_tcp_module_plfd_tbl[i])); 
     141        INIT_POLLFD_ENTRY(((pollfd_t *)&MPID_nem_tcp_plfd_tbl[i])); 
    142142    } 
    143143    MPIU_CHKPMEM_COMMIT(); 
     
    147147 
    148148    MPIU_Assert(0 == index); /* assumed in other parts of this file */ 
    149     MPID_NEM_MEMCPY (&g_sc_tbl[index], &MPID_nem_tcp_module_g_lstn_sc, sizeof(MPID_nem_tcp_module_g_lstn_sc)); 
    150     MPID_NEM_MEMCPY (&MPID_nem_tcp_module_plfd_tbl[index], &MPID_nem_tcp_module_g_lstn_plfd, sizeof(MPID_nem_tcp_module_g_lstn_plfd)); 
    151     MPIU_Assert(MPID_nem_tcp_module_plfd_tbl[index].fd == g_sc_tbl[index].fd); 
    152     MPIU_Assert(MPID_nem_tcp_module_plfd_tbl[index].events == POLLIN); 
     149    MPID_NEM_MEMCPY (&g_sc_tbl[index], &MPID_nem_tcp_g_lstn_sc, sizeof(MPID_nem_tcp_g_lstn_sc)); 
     150    MPID_NEM_MEMCPY (&MPID_nem_tcp_plfd_tbl[index], &MPID_nem_tcp_g_lstn_plfd, sizeof(MPID_nem_tcp_g_lstn_plfd)); 
     151    MPIU_Assert(MPID_nem_tcp_plfd_tbl[index].fd == g_sc_tbl[index].fd); 
     152    MPIU_Assert(MPID_nem_tcp_plfd_tbl[index].events == POLLIN); 
    153153 
    154154 fn_exit: 
     
    169169 
    170170    MPIU_Free(g_sc_tbl); 
    171     MPIU_Free(MPID_nem_tcp_module_plfd_tbl); 
     171    MPIU_Free(MPID_nem_tcp_plfd_tbl); 
    172172    return mpi_errno; 
    173173} 
     
    200200 
    201201    MPID_NEM_MEMCPY (new_sc_tbl, g_sc_tbl, g_tbl_capacity * sizeof(sockconn_t)); 
    202     MPID_NEM_MEMCPY (new_plfd_tbl, MPID_nem_tcp_module_plfd_tbl, g_tbl_capacity * sizeof(pollfd_t)); 
     202    MPID_NEM_MEMCPY (new_plfd_tbl, MPID_nem_tcp_plfd_tbl, g_tbl_capacity * sizeof(pollfd_t)); 
    203203 
    204204    /* VCs have pointers to entries in the sc table.  These 
     
    218218 
    219219    MPIU_Free(g_sc_tbl); 
    220     MPIU_Free(MPID_nem_tcp_module_plfd_tbl); 
     220    MPIU_Free(MPID_nem_tcp_plfd_tbl); 
    221221    g_sc_tbl = new_sc_tbl; 
    222     MPID_nem_tcp_module_plfd_tbl = new_plfd_tbl; 
     222    MPID_nem_tcp_plfd_tbl = new_plfd_tbl; 
    223223    for (i = g_tbl_capacity; i < new_capacity; i++) { 
    224224        INIT_SC_ENTRY(((sockconn_t *)&g_sc_tbl[i]), i); 
    225         INIT_POLLFD_ENTRY(((pollfd_t *)&MPID_nem_tcp_module_plfd_tbl[i])); 
     225        INIT_POLLFD_ENTRY(((pollfd_t *)&MPID_nem_tcp_plfd_tbl[i])); 
    226226    } 
    227227    g_tbl_capacity = new_capacity; 
     
    234234        /* The state is only valid if the FD is valid.  The VC field is only 
    235235           valid if the state is valid and COMMRDY. */ 
    236         MPIU_Assert(MPID_nem_tcp_module_plfd_tbl[i].fd == CONN_INVALID_FD || 
     236        MPIU_Assert(MPID_nem_tcp_plfd_tbl[i].fd == CONN_INVALID_FD || 
    237237                    g_sc_tbl[i].state.cstate != CONN_STATE_TS_COMMRDY || 
    238238                    VC_FIELD(g_sc_tbl[i].vc, sc) == &g_sc_tbl[i]); 
     
    292292       assumptions. */ 
    293293    INIT_SC_ENTRY(&g_sc_tbl[*index], *index); 
    294     INIT_POLLFD_ENTRY(&MPID_nem_tcp_module_plfd_tbl[*index]); 
     294    INIT_POLLFD_ENTRY(&MPID_nem_tcp_plfd_tbl[*index]); 
    295295    return mpi_errno; 
    296296 fn_fail: 
     
    326326    { 
    327327        sockconn_t *iter_sc = &g_sc_tbl[i]; 
    328         MPID_nem_tcp_module_Conn_State_t istate = iter_sc->state.cstate; 
     328        MPID_nem_tcp_Conn_State_t istate = iter_sc->state.cstate; 
    329329 
    330330        if (iter_sc != sc && iter_sc->fd != CONN_INVALID_FD  
     
    414414{ 
    415415    int mpi_errno = MPI_SUCCESS; 
    416     MPIDI_nem_tcp_module_idinfo_t id_info; 
    417     MPIDI_nem_tcp_module_header_t hdr; 
     416    MPIDI_nem_tcp_idinfo_t id_info; 
     417    MPIDI_nem_tcp_header_t hdr; 
    418418    struct iovec iov[3]; 
    419419    int pg_id_len = 0, offset, buf_size, iov_cnt = 2; 
     
    432432/*     avoid computing the length of string everytime this function is called. */ 
    433433     
    434     hdr.pkt_type = MPIDI_NEM_TCP_MODULE_PKT_ID_INFO; 
    435     hdr.datalen = sizeof(MPIDI_nem_tcp_module_idinfo_t) + pg_id_len;     
     434    hdr.pkt_type = MPIDI_NEM_TCP_PKT_ID_INFO; 
     435    hdr.datalen = sizeof(MPIDI_nem_tcp_idinfo_t) + pg_id_len;     
    436436    id_info.pg_rank = MPIDI_Process.my_pg_rank; 
    437437 
     
    475475{ 
    476476    int mpi_errno = MPI_SUCCESS; 
    477     MPIDI_nem_tcp_module_portinfo_t port_info; 
    478     MPIDI_nem_tcp_module_header_t hdr; 
     477    MPIDI_nem_tcp_portinfo_t port_info; 
     478    MPIDI_nem_tcp_header_t hdr; 
    479479    struct iovec iov[3]; 
    480480    int offset, buf_size, iov_cnt = 2; 
     
    490490/*     avoid computing the length of string everytime this function is called. */ 
    491491     
    492     hdr.pkt_type = MPIDI_NEM_TCP_MODULE_PKT_TMPVC_INFO; 
    493     hdr.datalen = sizeof(MPIDI_nem_tcp_module_portinfo_t); 
     492    hdr.pkt_type = MPIDI_NEM_TCP_PKT_TMPVC_INFO; 
     493    hdr.datalen = sizeof(MPIDI_nem_tcp_portinfo_t); 
    494494    port_info.port_name_tag = sc->vc->port_name_tag; 
    495495 
     
    525525{ 
    526526    int mpi_errno = MPI_SUCCESS; 
    527     MPIDI_nem_tcp_module_header_t hdr; 
     527    MPIDI_nem_tcp_header_t hdr; 
    528528    int pg_id_len = 0, nread, iov_cnt = 1; 
    529     int hdr_len = sizeof(MPIDI_nem_tcp_module_header_t); 
     529    int hdr_len = sizeof(MPIDI_nem_tcp_header_t); 
    530530    struct iovec iov[2]; 
    531531    char *pg_id = NULL; 
     
    552552    MPIU_ERR_CHKANDJUMP1 (nread != hdr_len, mpi_errno, MPI_ERR_OTHER, 
    553553                          "**read", "**read %s", strerror (errno));  /* FIXME-Z1 */ 
    554     MPIU_Assert(hdr.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_INFO || 
    555                 hdr.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_INFO); 
     554    MPIU_Assert(hdr.pkt_type == MPIDI_NEM_TCP_PKT_ID_INFO || 
     555                hdr.pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_INFO); 
    556556    MPIU_Assert(hdr.datalen != 0); 
    557557     
    558     if (hdr.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_INFO) { 
     558    if (hdr.pkt_type == MPIDI_NEM_TCP_PKT_ID_INFO) { 
    559559        iov[0].iov_base = (void *) &(sc->pg_rank); 
    560560        iov[0].iov_len = sizeof(sc->pg_rank); 
    561         pg_id_len = hdr.datalen - sizeof(MPIDI_nem_tcp_module_idinfo_t); 
     561        pg_id_len = hdr.datalen - sizeof(MPIDI_nem_tcp_idinfo_t); 
    562562        if (pg_id_len != 0) { 
    563563            MPIU_CHKLMEM_MALLOC (pg_id, char *, pg_id_len, mpi_errno, "sockconn pg_id"); 
     
    573573        if (pg_id_len == 0) { 
    574574            sc->is_same_pg = TRUE; 
    575             mpi_errno = MPID_nem_tcp_module_get_vc_from_conninfo (MPIDI_Process.my_pg->id,  
     575            mpi_errno = MPID_nem_tcp_get_vc_from_conninfo (MPIDI_Process.my_pg->id,  
    576576                                                                     sc->pg_rank, &sc->vc); 
    577577            if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     
    580580        else { 
    581581            sc->is_same_pg = FALSE; 
    582             mpi_errno = MPID_nem_tcp_module_get_vc_from_conninfo (pg_id, sc->pg_rank, &sc->vc); 
     582            mpi_errno = MPID_nem_tcp_get_vc_from_conninfo (pg_id, sc->pg_rank, &sc->vc); 
    583583            if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    584584            sc->pg_id = sc->vc->pg->id; 
     
    594594        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PKT_ID_INFO: sc->fd=%d, sc->vc=%p, sc=%p", sc->fd, sc->vc, sc)); 
    595595    } 
    596     else if (hdr.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_INFO) { 
     596    else if (hdr.pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_INFO) { 
    597597        MPIDI_VC_t *vc; 
    598598 
     
    608608 
    609609        MPIDI_VC_Init(vc, NULL, 0);      
    610         ((MPIDI_CH3I_VC *)vc->channel_private)->state = MPID_NEM_TCP_MODULE_VC_STATE_CONNECTED; /* FIXME: is it needed ? */ 
     610        ((MPIDI_CH3I_VC *)vc->channel_private)->state = MPID_NEM_TCP_VC_STATE_CONNECTED; /* FIXME: is it needed ? */ 
    611611        sc->vc = vc;  
    612612        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "about to incr sc_ref_count sc=%p sc->vc=%p sc_ref_count=%d", sc, sc->vc, VC_FIELD(sc->vc, sc_ref_count))); 
     
    657657#undef FCNAME 
    658658#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    659 static int send_cmd_pkt_func(int fd, MPIDI_nem_tcp_module_pkt_type_t pkt_type) 
     659static int send_cmd_pkt_func(int fd, MPIDI_nem_tcp_pkt_type_t pkt_type) 
    660660{ 
    661661    int mpi_errno = MPI_SUCCESS, offset; 
    662     MPIDI_nem_tcp_module_header_t pkt; 
    663     int pkt_len = sizeof(MPIDI_nem_tcp_module_header_t); 
    664  
    665     MPIU_Assert(pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_ACK || 
    666                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_NAK || 
    667                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_REQ || 
    668                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_ACK || 
    669                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_NAK || 
    670                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK || 
    671                 pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_NAK); 
     662    MPIDI_nem_tcp_header_t pkt; 
     663    int pkt_len = sizeof(MPIDI_nem_tcp_header_t); 
     664 
     665    MPIU_Assert(pkt_type == MPIDI_NEM_TCP_PKT_ID_ACK || 
     666                pkt_type == MPIDI_NEM_TCP_PKT_ID_NAK || 
     667                pkt_type == MPIDI_NEM_TCP_PKT_DISC_REQ || 
     668                pkt_type == MPIDI_NEM_TCP_PKT_DISC_ACK || 
     669                pkt_type == MPIDI_NEM_TCP_PKT_DISC_NAK || 
     670                pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_ACK || 
     671                pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_NAK); 
    672672 
    673673    pkt.pkt_type = pkt_type; 
     
    695695#undef FCNAME 
    696696#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    697 static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_module_pkt_type_t *pkt_type) 
     697static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_pkt_type_t *pkt_type) 
    698698{ 
    699699    int mpi_errno = MPI_SUCCESS, nread; 
    700     MPIDI_nem_tcp_module_header_t pkt; 
    701     int pkt_len = sizeof(MPIDI_nem_tcp_module_header_t); 
     700    MPIDI_nem_tcp_header_t pkt; 
     701    int pkt_len = sizeof(MPIDI_nem_tcp_header_t); 
    702702    MPIDI_STATE_DECL(MPID_STATE_RECV_CMD_PKT); 
    703703 
     
    710710                          "**read", "**read %d %s", nread, strerror (errno)); /* FIXME-Z1 */ 
    711711    MPIU_Assert(pkt.datalen == 0); 
    712     MPIU_Assert(pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_ACK || 
    713                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_NAK || 
    714                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK || 
    715                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_NAK || 
    716                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_REQ || 
    717                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_ACK || 
    718                 pkt.pkt_type == MPIDI_NEM_TCP_MODULE_PKT_DISC_NAK); 
     712    MPIU_Assert(pkt.pkt_type == MPIDI_NEM_TCP_PKT_ID_ACK || 
     713                pkt.pkt_type == MPIDI_NEM_TCP_PKT_ID_NAK || 
     714                pkt.pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_ACK || 
     715                pkt.pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_NAK || 
     716                pkt.pkt_type == MPIDI_NEM_TCP_PKT_DISC_REQ || 
     717                pkt.pkt_type == MPIDI_NEM_TCP_PKT_DISC_ACK || 
     718                pkt.pkt_type == MPIDI_NEM_TCP_PKT_DISC_NAK); 
    719719    *pkt_type = pkt.pkt_type; 
    720720 fn_exit: 
     
    729729 
    730730#undef FUNCNAME 
    731 #define FUNCNAME MPID_nem_tcp_module_connect 
    732 #undef FCNAME 
    733 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    734 int MPID_nem_tcp_module_connect(struct MPIDI_VC *const vc)  
     731#define FUNCNAME MPID_nem_tcp_connect 
     732#undef FCNAME 
     733#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     734int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)  
    735735{ 
    736736    sockconn_t *sc = NULL; 
     
    740740    freenode_t *node; 
    741741    MPIU_CHKLMEM_DECL(1); 
    742     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT); 
    743  
    744     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT); 
     742    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_CONNECT); 
     743 
     744    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_CONNECT); 
    745745 
    746746    MPIU_Assert(vc != NULL); 
    747747 
    748     if (((MPIDI_CH3I_VC *)vc->channel_private)->state == MPID_NEM_TCP_MODULE_VC_STATE_DISCONNECTED) { 
     748    if (((MPIDI_CH3I_VC *)vc->channel_private)->state == MPID_NEM_TCP_VC_STATE_DISCONNECTED) { 
    749749        struct sockaddr_in *sock_addr; 
    750750        struct in_addr addr; 
     
    756756 
    757757        sc = &g_sc_tbl[index]; 
    758         plfd = &MPID_nem_tcp_module_plfd_tbl[index];         
     758        plfd = &MPID_nem_tcp_plfd_tbl[index];         
    759759 
    760760        /* FIXME:   
     
    762762           If a process is dynamically spawned, vc->pg is NULL. 
    763763           In that case, same procedure is done  
    764            in MPID_nem_tcp_module_connect_to_root() 
     764           in MPID_nem_tcp_connect_to_root() 
    765765        */ 
    766766        if (vc->pg != NULL) { /* VC is not a temporary one */ 
     
    778778            if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    779779 
    780             mpi_errno = MPID_nem_tcp_module_get_addr_port_from_bc(bc, &addr, &(VC_FIELD(vc, sock_id).sin_port)); 
     780            mpi_errno = MPID_nem_tcp_get_addr_port_from_bc(bc, &addr, &(VC_FIELD(vc, sock_id).sin_port)); 
    781781            VC_FIELD(vc, sock_id).sin_addr.s_addr = addr.s_addr; 
    782782            if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     
    793793        plfd->fd = sc->fd; 
    794794        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "sc->fd=%d, plfd->events=%d, plfd->revents=%d, vc=%p, sc=%p", sc->fd, plfd->events, plfd->revents, vc, sc)); 
    795         mpi_errno = MPID_nem_tcp_module_set_sockopts(sc->fd); 
     795        mpi_errno = MPID_nem_tcp_set_sockopts(sc->fd); 
    796796        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    797797 
     
    810810         
    811811/*         sc->handler = sc_state_info[sc->state.cstate].sc_state_handler; */ 
    812         ((MPIDI_CH3I_VC *)vc->channel_private)->state = MPID_NEM_TCP_MODULE_VC_STATE_CONNECTED; 
     812        ((MPIDI_CH3I_VC *)vc->channel_private)->state = MPID_NEM_TCP_VC_STATE_CONNECTED; 
    813813        sc->pg_rank = vc->pg_rank; 
    814814 
     
    836836        ++VC_FIELD(vc, sc_ref_count); 
    837837    } 
    838     else if (((MPIDI_CH3I_VC *)vc->channel_private)->state == MPID_NEM_TCP_MODULE_VC_STATE_CONNECTED) { 
     838    else if (((MPIDI_CH3I_VC *)vc->channel_private)->state == MPID_NEM_TCP_VC_STATE_CONNECTED) { 
    839839        sc = VC_FIELD(vc, sc); 
    840840        MPIU_Assert(sc != NULL); 
     
    849849 
    850850 fn_exit: 
    851     /* MPID_nem_tcp_module_connpoll(); FIXME-Imp should be called? */ 
     851    /* MPID_nem_tcp_connpoll(); FIXME-Imp should be called? */ 
    852852    MPIU_CHKLMEM_FREEALL(); 
    853     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT); 
     853    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CONNECT); 
    854854    return mpi_errno; 
    855855 fn_fail: 
    856856    if (index != -1) { 
    857857        if (sc->fd != CONN_INVALID_FD) { 
    858             MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "MPID_nem_tcp_module_connect(). closing fd = %d", sc->fd)); 
     858            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "MPID_nem_tcp_connect(). closing fd = %d", sc->fd)); 
    859859            close(sc->fd); 
    860860            sc->fd = CONN_INVALID_FD; 
     
    894894    } 
    895895     
    896     plfd = &MPID_nem_tcp_module_plfd_tbl[sc->index];  
     896    plfd = &MPID_nem_tcp_plfd_tbl[sc->index];  
    897897    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "vc=%p, sc=%p, closing fd=%d", sc->vc, sc, sc->fd)); 
    898898 
     
    905905    if (sc->vc && VC_FIELD(sc->vc, sc) == sc) /* this vc may be connecting/accepting with another sc e.g., this sc lost the tie-breaker */ 
    906906    { 
    907         ((MPIDI_CH3I_VC *)sc->vc->channel_private)->state = MPID_NEM_TCP_MODULE_VC_STATE_DISCONNECTED; 
     907        ((MPIDI_CH3I_VC *)sc->vc->channel_private)->state = MPID_NEM_TCP_VC_STATE_DISCONNECTED; 
    908908        ASSIGN_SC_TO_VC(sc->vc, NULL); 
    909909    } 
     
    932932   race for queued messages. */ 
    933933#undef FUNCNAME 
    934 #define FUNCNAME MPID_nem_tcp_module_cleanup 
    935 #undef FCNAME 
    936 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    937 int MPID_nem_tcp_module_cleanup (struct MPIDI_VC *const vc) 
     934#define FUNCNAME MPID_nem_tcp_cleanup 
     935#undef FCNAME 
     936#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     937int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc) 
    938938{ 
    939939    int mpi_errno = MPI_SUCCESS, i; 
    940     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_CLEANUP); 
    941  
    942     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_CLEANUP); 
     940    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_CLEANUP); 
     941 
     942    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_CLEANUP); 
    943943 
    944944    MPIU_Assert(vc->state == MPIDI_VC_STATE_CLOSE_ACKED); 
     
    963963 
    964964    /* cleanup_sc can technically cause a reconnect on a per-sc basis, but I 
    965        don't think that it can happen when _module_cleanup is called.  Let's 
     965       don't think that it can happen when cleanup is called.  Let's 
    966966       assert this for now and remove it if we prove that it can happen. */ 
    967967    MPIU_Assert(VC_FIELD(vc, sc_ref_count) == 0); 
    968968 
    969969 fn_exit: 
    970     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_CLEANUP); 
     970    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CLEANUP); 
    971971    return mpi_errno; 
    972972 fn_fail: 
     
    983983{ 
    984984    int mpi_errno = MPI_SUCCESS; 
    985     MPID_NEM_TCP_MODULE_SOCK_STATUS_t stat; 
     985    MPID_NEM_TCP_SOCK_STATUS_t stat; 
    986986    MPIDI_STATE_DECL(MPID_STATE_STATE_TC_C_CNTING_HANDLER); 
    987987 
    988988    MPIDI_FUNC_ENTER(MPID_STATE_STATE_TC_C_CNTING_HANDLER); 
    989989    
    990     stat = MPID_nem_tcp_module_check_sock_status(plfd); 
    991  
    992     if (stat == MPID_NEM_TCP_MODULE_SOCK_CONNECTED) { 
     990    stat = MPID_nem_tcp_check_sock_status(plfd); 
     991 
     992    if (stat == MPID_NEM_TCP_SOCK_CONNECTED) { 
    993993        CHANGE_STATE(sc, CONN_STATE_TC_C_CNTD); 
    994994    } 
    995     else if (stat == MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF) { 
     995    else if (stat == MPID_NEM_TCP_SOCK_ERROR_EOF) { 
    996996        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_tc_c_cnting_handler(): changing to " 
    997997              "quiescent")); 
     
    999999        /* FIXME: retry 'n' number of retries before signalling an error to VC layer. */ 
    10001000    } 
    1001     else { /* stat == MPID_NEM_TCP_MODULE_SOCK_NOEVENT */ 
     1001    else { /* stat == MPID_NEM_TCP_SOCK_NOEVENT */ 
    10021002        /* 
    10031003          Still connecting... let it. While still connecting, even if 
     
    10781078{ 
    10791079    int mpi_errno = MPI_SUCCESS; 
    1080     MPIDI_nem_tcp_module_pkt_type_t pkt_type; 
     1080    MPIDI_nem_tcp_pkt_type_t pkt_type; 
    10811081    MPIDI_STATE_DECL(MPID_STATE_STATE_C_RANKSENT_HANDLER); 
    10821082 
     
    10941094        } 
    10951095        else { 
    1096             MPIU_Assert(pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_ACK || 
    1097                         pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_NAK); 
    1098  
    1099             if (pkt_type == MPIDI_NEM_TCP_MODULE_PKT_ID_ACK) { 
     1096            MPIU_Assert(pkt_type == MPIDI_NEM_TCP_PKT_ID_ACK || 
     1097                        pkt_type == MPIDI_NEM_TCP_PKT_ID_NAK); 
     1098 
     1099            if (pkt_type == MPIDI_NEM_TCP_PKT_ID_ACK) { 
    11001100                CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY); 
    11011101                ASSIGN_SC_TO_VC(sc->vc, sc); 
    1102                 MPID_nem_tcp_module_conn_est (sc->vc); 
     1102                MPID_nem_tcp_conn_est (sc->vc); 
    11031103                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "c_ranksent_handler(): connection established (sc=%p, sc->vc=%p, fd=%d)", sc, sc->vc, sc->fd)); 
    11041104            } 
    1105             else { /* pkt_type must be MPIDI_NEM_TCP_MODULE_PKT_ID_NAK */ 
     1105            else { /* pkt_type must be MPIDI_NEM_TCP_PKT_ID_NAK */ 
    11061106                CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
    11071107            } 
     
    11201120{ 
    11211121    int mpi_errno = MPI_SUCCESS; 
    1122     MPIDI_nem_tcp_module_pkt_type_t pkt_type; 
     1122    MPIDI_nem_tcp_pkt_type_t pkt_type; 
    11231123    MPIDI_STATE_DECL(MPID_STATE_STATE_C_TMPVCSENT_HANDLER); 
    11241124 
     
    11341134        } 
    11351135        else { 
    1136             MPIU_Assert(pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK || 
    1137                         pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_NAK); 
    1138  
    1139             if (pkt_type == MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK) { 
     1136            MPIU_Assert(pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_ACK || 
     1137                        pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_NAK); 
     1138 
     1139            if (pkt_type == MPIDI_NEM_TCP_PKT_TMPVC_ACK) { 
    11401140                CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY); 
    11411141                ASSIGN_SC_TO_VC(sc->vc, sc); 
    1142                 MPID_nem_tcp_module_conn_est (sc->vc); 
     1142                MPID_nem_tcp_conn_est (sc->vc); 
    11431143                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "c_tmpvcsent_handler(): connection established (fd=%d, sc=%p, sc->vc=%p)", sc->fd, sc, sc->vc)); 
    11441144            } 
    1145             else { /* pkt_type must be MPIDI_NEM_TCP_MODULE_PKT_ID_NAK */ 
     1145            else { /* pkt_type must be MPIDI_NEM_TCP_PKT_ID_NAK */ 
    11461146                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_c_tmpvcsent_handler() 2: changing to quiescent")); 
    11471147                CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
     
    11611161{ 
    11621162    int mpi_errno = MPI_SUCCESS; 
    1163     MPID_NEM_TCP_MODULE_SOCK_STATUS_t stat; 
     1163    MPID_NEM_TCP_SOCK_STATUS_t stat; 
    11641164    int got_sc_eof = 0; 
    11651165    MPIDI_STATE_DECL(MPID_STATE_STATE_L_CNTD_HANDLER); 
     
    11671167    MPIDI_FUNC_ENTER(MPID_STATE_STATE_L_CNTD_HANDLER); 
    11681168 
    1169     stat = MPID_nem_tcp_module_check_sock_status(plfd); 
    1170     if (stat == MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF) { 
     1169    stat = MPID_nem_tcp_check_sock_status(plfd); 
     1170    if (stat == MPID_NEM_TCP_SOCK_ERROR_EOF) { 
    11711171        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_l_cntd_handler() 1: changing to " 
    11721172            "quiescent")); 
     
    12541254{ 
    12551255    int mpi_errno = MPI_SUCCESS; 
    1256     MPID_NEM_TCP_MODULE_SOCK_STATUS_t stat; 
     1256    MPID_NEM_TCP_SOCK_STATUS_t stat; 
    12571257    sockconn_t *fnd_sc; 
    12581258    int snd_nak = FALSE; 
     
    12611261    MPIDI_FUNC_ENTER(MPID_STATE_STATE_L_RANKRCVD_HANDLER); 
    12621262 
    1263     stat = MPID_nem_tcp_module_check_sock_status(plfd); 
    1264     if (stat == MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF) { 
     1263    stat = MPID_nem_tcp_check_sock_status(plfd); 
     1264    if (stat == MPID_NEM_TCP_SOCK_ERROR_EOF) { 
    12651265        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_l_rankrcvd_handler() 1: changing to quiescent")); 
    12661266        CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
     
    12751275    if (IS_WRITEABLE(plfd)) { 
    12761276        if (snd_nak) { 
    1277             if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_MODULE_PKT_ID_NAK) == MPI_SUCCESS) { 
     1277            if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_PKT_ID_NAK) == MPI_SUCCESS) { 
    12781278                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "state_l_rankrcvd_handler() 2: changing to quiescent")); 
    12791279                CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
     
    12901290            if (VC_FIELD(sc->vc, sc_ref_count) > 1) goto fn_exit; 
    12911291 
    1292             if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_MODULE_PKT_ID_ACK) == MPI_SUCCESS) { 
     1292            if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_PKT_ID_ACK) == MPI_SUCCESS) { 
    12931293                CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY); 
    12941294                ASSIGN_SC_TO_VC(sc->vc, sc); 
    12951295                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "connection established: sc=%p, sc->vc=%p, sc->fd=%d, is_same_pg=%s, pg_rank=%d", sc, sc->vc, sc->fd, (sc->is_same_pg ? "TRUE" : "FALSE"), sc->pg_rank)); 
    1296                 MPID_nem_tcp_module_conn_est (sc->vc); 
     1296                MPID_nem_tcp_conn_est (sc->vc); 
    12971297            } 
    12981298        } 
     
    13111311{ 
    13121312    int mpi_errno = MPI_SUCCESS; 
    1313     MPID_NEM_TCP_MODULE_SOCK_STATUS_t stat; 
     1313    MPID_NEM_TCP_SOCK_STATUS_t stat; 
    13141314    int snd_nak = FALSE; 
    13151315    MPIDI_STATE_DECL(MPID_STATE_STATE_L_TMPVCRCVD_HANDLER); 
     
    13171317    MPIDI_FUNC_ENTER(MPID_STATE_STATE_L_TMPVCRCVD_HANDLER); 
    13181318 
    1319     stat = MPID_nem_tcp_module_check_sock_status(plfd); 
    1320     if (stat == MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF) { 
     1319    stat = MPID_nem_tcp_check_sock_status(plfd); 
     1320    if (stat == MPID_NEM_TCP_SOCK_ERROR_EOF) { 
    13211321        CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
    13221322        goto fn_exit; 
     
    13251325    if (IS_WRITEABLE(plfd)) { 
    13261326        if (snd_nak) { 
    1327             if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_MODULE_PKT_TMPVC_NAK) == MPI_SUCCESS) { 
     1327            if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_PKT_TMPVC_NAK) == MPI_SUCCESS) { 
    13281328                CHANGE_STATE(sc, CONN_STATE_TS_D_QUIESCENT); 
    13291329            } 
    13301330        } 
    13311331        else { 
    1332             if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK) == MPI_SUCCESS) { 
     1332            if (send_cmd_pkt(sc->fd, MPIDI_NEM_TCP_PKT_TMPVC_ACK) == MPI_SUCCESS) { 
    13331333                CHANGE_STATE(sc, CONN_STATE_TS_COMMRDY); 
    13341334                ASSIGN_SC_TO_VC(sc->vc, sc); 
    1335                 MPID_nem_tcp_module_conn_est (sc->vc); 
     1335                MPID_nem_tcp_conn_est (sc->vc); 
    13361336                MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "fd=%d: TMPVC_ACK sent, connection established!", sc->fd)); 
    13371337            } 
     
    13451345 
    13461346#undef FUNCNAME 
    1347 #define FUNCNAME MPID_nem_tcp_module_recv_handler 
    1348 #undef FCNAME 
    1349 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1350 static int MPID_nem_tcp_module_recv_handler (struct pollfd *pfd, sockconn_t *sc) 
     1347#define FUNCNAME MPID_nem_tcp_recv_handler 
     1348#undef FCNAME 
     1349#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     1350static int MPID_nem_tcp_recv_handler (struct pollfd *pfd, sockconn_t *sc) 
    13511351{ 
    13521352    int mpi_errno = MPI_SUCCESS; 
    13531353    ssize_t bytes_recvd; 
    1354     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_RECV_HANDLER); 
    1355  
    1356     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_RECV_HANDLER); 
     1354    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_RECV_HANDLER); 
     1355 
     1356    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_RECV_HANDLER); 
    13571357 
    13581358    if (((MPIDI_CH3I_VC *)sc->vc->channel_private)->recv_active == NULL) 
    13591359    { 
    13601360        /* receive a new message */ 
    1361         CHECK_EINTR(bytes_recvd, recv(sc->fd, MPID_nem_tcp_module_recv_buf, MPID_NEM_TCP_MODULE_RECV_MAX_PKT_LEN, 0)); 
     1361        CHECK_EINTR(bytes_recvd, recv(sc->fd, MPID_nem_tcp_recv_buf, MPID_NEM_TCP_RECV_MAX_PKT_LEN, 0)); 
    13621362        if (bytes_recvd <= 0) 
    13631363        { 
     
    13971397        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "New recv %d (fd=%d, vc=%p, sc=%p)", bytes_recvd, sc->fd, sc->vc, sc)); 
    13981398 
    1399         mpi_errno = MPID_nem_handle_pkt(sc->vc, MPID_nem_tcp_module_recv_buf, bytes_recvd); 
     1399        mpi_errno = MPID_nem_handle_pkt(sc->vc, MPID_nem_tcp_recv_buf, bytes_recvd); 
    14001400        if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    14011401    } 
     
    14701470 
    14711471 fn_exit: 
    1472     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_RECV_HANDLER); 
     1472    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_RECV_HANDLER); 
    14731473    return mpi_errno; 
    14741474 fn_fail: 
     
    14891489    if (IS_READABLE(plfd)) 
    14901490    { 
    1491         mpi_errno = MPID_nem_tcp_module_recv_handler(plfd, sc); 
     1491        mpi_errno = MPID_nem_tcp_recv_handler(plfd, sc); 
    14921492        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    14931493    } 
    14941494    if (IS_WRITEABLE(plfd)) 
    14951495    { 
    1496         mpi_errno = MPID_nem_tcp_module_send_queued(sc->vc); 
     1496        mpi_errno = MPID_nem_tcp_send_queued(sc->vc); 
    14971497        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    14981498    } 
     
    15281528 
    15291529#undef FUNCNAME 
    1530 #define FUNCNAME MPID_nem_tcp_module_sm_init 
    1531 #undef FCNAME 
    1532 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1533 int MPID_nem_tcp_module_sm_init() 
     1530#define FUNCNAME MPID_nem_tcp_sm_init 
     1531#undef FCNAME 
     1532#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     1533int MPID_nem_tcp_sm_init() 
    15341534{ 
    15351535    /* Set the appropriate handlers */ 
     
    15631563 
    15641564#undef FUNCNAME 
    1565 #define FUNCNAME MPID_nem_tcp_module_sm_finalize 
    1566 #undef FCNAME 
    1567 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1568 int MPID_nem_tcp_module_sm_finalize() 
     1565#define FUNCNAME MPID_nem_tcp_sm_finalize 
     1566#undef FCNAME 
     1567#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     1568int MPID_nem_tcp_sm_finalize() 
    15691569{ 
    15701570    freenode_t *node; 
     
    15891589*/ 
    15901590#undef FUNCNAME 
    1591 #define FUNCNAME MPID_nem_tcp_module_connpoll 
    1592 #undef FCNAME 
    1593 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1594 int MPID_nem_tcp_module_connpoll() 
     1591#define FUNCNAME MPID_nem_tcp_connpoll 
     1592#undef FCNAME 
     1593#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     1594int MPID_nem_tcp_connpoll() 
    15951595{ 
    15961596    int mpi_errno = MPI_SUCCESS, n, i; 
     
    16001600    int num_polled = g_tbl_size; 
    16011601 
    1602     CHECK_EINTR(n, poll(MPID_nem_tcp_module_plfd_tbl, num_polled, 0)); 
     1602    CHECK_EINTR(n, poll(MPID_nem_tcp_plfd_tbl, num_polled, 0)); 
    16031603    MPIU_ERR_CHKANDJUMP1 (n == -1, mpi_errno, MPI_ERR_OTHER,  
    16041604                          "**poll", "**poll %s", strerror (errno)); 
     
    16061606    for(i = 0; i < num_polled; i++) 
    16071607    { 
    1608         pollfd_t *it_plfd = &MPID_nem_tcp_module_plfd_tbl[i]; 
     1608        pollfd_t *it_plfd = &MPID_nem_tcp_plfd_tbl[i]; 
    16091609        sockconn_t *it_sc = &g_sc_tbl[i]; 
    16101610 
     
    16581658#undef FCNAME 
    16591659#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    1660 int MPID_nem_tcp_module_state_listening_handler(pollfd_t *const unused_1, sockconn_t *const unused_2) 
     1660int MPID_nem_tcp_state_listening_handler(pollfd_t *const unused_1, sockconn_t *const unused_2) 
    16611661        /*  listener fd poll struct and sockconn structure */ 
    16621662{ 
     
    16671667    pollfd_t *l_plfd; 
    16681668    sockconn_t *l_sc; 
    1669     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_STATE_LISTENING_HANDLER); 
    1670  
    1671     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_STATE_LISTENING_HANDLER); 
     1669    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_STATE_LISTENING_HANDLER); 
     1670 
     1671    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_STATE_LISTENING_HANDLER); 
    16721672 
    16731673    while (1) { 
    16741674        l_sc = &g_sc_tbl[0];  /* N3 Important */ 
    1675         l_plfd = &MPID_nem_tcp_module_plfd_tbl[0]; 
     1675        l_plfd = &MPID_nem_tcp_plfd_tbl[0]; 
    16761676        len = sizeof(SA_IN); 
    16771677        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "before accept")); 
     
    16901690            sockconn_t *sc; 
    16911691 
    1692             MPID_nem_tcp_module_set_sockopts(connfd); /* (N2) */ 
     1692            MPID_nem_tcp_set_sockopts(connfd); /* (N2) */ 
    16931693            mpi_errno = find_free_entry(&index); 
    16941694            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP (mpi_errno);         
    16951695            sc = &g_sc_tbl[index]; 
    1696             plfd = &MPID_nem_tcp_module_plfd_tbl[index]; 
     1696            plfd = &MPID_nem_tcp_plfd_tbl[index]; 
    16971697             
    16981698            sc->fd = plfd->fd = connfd; 
     
    17081708 
    17091709 fn_exit: 
    1710     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_STATE_LISTENING_HANDLER); 
     1710    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_STATE_LISTENING_HANDLER); 
    17111711    return mpi_errno; 
    17121712 fn_fail: 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/socksm.h

    r3751 r3763  
    3030 
    3131typedef enum { 
    32     MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF, /* either a socket error or EOF received from peer */ 
    33     MPID_NEM_TCP_MODULE_SOCK_CONNECTED, 
    34     MPID_NEM_TCP_MODULE_SOCK_NOEVENT /*  No poll event on socket */ 
    35 }MPID_NEM_TCP_MODULE_SOCK_STATUS_t; 
     32    MPID_NEM_TCP_SOCK_ERROR_EOF, /* either a socket error or EOF received from peer */ 
     33    MPID_NEM_TCP_SOCK_CONNECTED, 
     34    MPID_NEM_TCP_SOCK_NOEVENT /*  No poll event on socket */ 
     35}MPID_NEM_TCP_SOCK_STATUS_t; 
    3636 
    3737#define M_(x) x 
     
    7171 
    7272typedef enum CONN_TYPE {CONN_TYPE_, CONN_TYPE_SIZE} Conn_type_t; 
    73 typedef enum MPID_nem_tcp_module_Listen_State {LISTEN_STATE_, LISTEN_STATE_SIZE}  
    74     MPID_nem_tcp_module_Listen_State_t ; 
     73typedef enum MPID_nem_tcp_Listen_State {LISTEN_STATE_, LISTEN_STATE_SIZE}  
     74    MPID_nem_tcp_Listen_State_t ; 
    7575 
    76 typedef enum MPID_nem_tcp_module_Conn_State {CONN_STATE_, CONN_STATE_SIZE}  
    77     MPID_nem_tcp_module_Conn_State_t; 
     76typedef enum MPID_nem_tcp_Conn_State {CONN_STATE_, CONN_STATE_SIZE}  
     77    MPID_nem_tcp_Conn_State_t; 
    7878 
    7979/* 
     
    122122    (_sc)->state.cstate = (_cstate); \ 
    123123    (_sc)->handler = sc_state_info[_cstate].sc_state_handler; \ 
    124     MPID_nem_tcp_module_plfd_tbl[(_sc)->index].events = sc_state_info[_cstate].sc_state_plfd_events; \ 
     124    MPID_nem_tcp_plfd_tbl[(_sc)->index].events = sc_state_info[_cstate].sc_state_plfd_events; \ 
    125125} while(0) 
    126126 
    127 struct MPID_nem_new_tcp_module_sockconn; 
    128 typedef struct MPID_nem_new_tcp_module_sockconn sockconn_t; 
     127struct MPID_nem_new_tcp_sockconn; 
     128typedef struct MPID_nem_new_tcp_sockconn sockconn_t; 
    129129typedef struct pollfd pollfd_t; 
    130130 
     
    132132typedef int (*handler_func_t) (pollfd_t *const plfd, sockconn_t *const conn); 
    133133 
    134 struct MPID_nem_new_tcp_module_sockconn{ 
     134struct MPID_nem_new_tcp_sockconn{ 
    135135    int fd; 
    136136    int index; 
     
    146146    char *pg_id; /*  MUST be used only if is_same_pg == FALSE */ 
    147147    union { 
    148         MPID_nem_tcp_module_Conn_State_t cstate; 
    149         MPID_nem_tcp_module_Listen_State_t lstate;  
     148        MPID_nem_tcp_Conn_State_t cstate; 
     149        MPID_nem_tcp_Listen_State_t lstate;  
    150150    }state; 
    151151    MPIDI_VC_t *vc; 
     
    154154}; 
    155155 
    156 typedef enum MPIDI_nem_tcp_module_pkt_type { 
    157     MPIDI_NEM_TCP_MODULE_PKT_ID_INFO, /*  ID = rank + pg_id */ 
    158     MPIDI_NEM_TCP_MODULE_PKT_ID_ACK, 
    159     MPIDI_NEM_TCP_MODULE_PKT_ID_NAK, 
    160     MPIDI_NEM_TCP_MODULE_PKT_DISC_REQ, 
    161     MPIDI_NEM_TCP_MODULE_PKT_DISC_ACK, 
    162     MPIDI_NEM_TCP_MODULE_PKT_DISC_NAK, 
    163     MPIDI_NEM_TCP_MODULE_PKT_TMPVC_INFO,  
    164     MPIDI_NEM_TCP_MODULE_PKT_TMPVC_ACK, 
    165     MPIDI_NEM_TCP_MODULE_PKT_TMPVC_NAK 
    166 } MPIDI_nem_tcp_module_pkt_type_t; 
     156typedef enum MPIDI_nem_tcp_pkt_type { 
     157    MPIDI_NEM_TCP_PKT_ID_INFO, /*  ID = rank + pg_id */ 
     158    MPIDI_NEM_TCP_PKT_ID_ACK, 
     159    MPIDI_NEM_TCP_PKT_ID_NAK, 
     160    MPIDI_NEM_TCP_PKT_DISC_REQ, 
     161    MPIDI_NEM_TCP_PKT_DISC_ACK, 
     162    MPIDI_NEM_TCP_PKT_DISC_NAK, 
     163    MPIDI_NEM_TCP_PKT_TMPVC_INFO,  
     164    MPIDI_NEM_TCP_PKT_TMPVC_ACK, 
     165    MPIDI_NEM_TCP_PKT_TMPVC_NAK 
     166} MPIDI_nem_tcp_pkt_type_t; 
    167167     
    168 typedef struct MPIDI_nem_tcp_module_header { 
    169     MPIDI_nem_tcp_module_pkt_type_t pkt_type; 
     168typedef struct MPIDI_nem_tcp_header { 
     169    MPIDI_nem_tcp_pkt_type_t pkt_type; 
    170170    int datalen; 
    171 } MPIDI_nem_tcp_module_header_t; 
     171} MPIDI_nem_tcp_header_t; 
    172172 
    173 typedef struct MPIDI_nem_tcp_module_idinfo { 
     173typedef struct MPIDI_nem_tcp_idinfo { 
    174174    int pg_rank; 
    175175/*      Commented intentionally */ 
     
    179179/*      in the future), datalen of header itself is enough to find the offset of pg_id      */ 
    180180/*      in the packet to be sent. */ 
    181 } MPIDI_nem_tcp_module_idinfo_t; 
     181} MPIDI_nem_tcp_idinfo_t; 
    182182 
    183183/* FIXME: bc actually contains port_name info */ 
    184 typedef struct MPIDI_nem_tcp_module_portinfo { 
     184typedef struct MPIDI_nem_tcp_portinfo { 
    185185    int port_name_tag; 
    186 } MPIDI_nem_tcp_module_portinfo_t; 
     186} MPIDI_nem_tcp_portinfo_t; 
    187187 
    188188 
    189 #define MPID_nem_tcp_module_vc_is_connected(vc) (VC_FIELD(vc, sc) && VC_FIELD(vc, sc)->state.cstate == CONN_STATE_TS_COMMRDY) 
     189#define MPID_nem_tcp_vc_is_connected(vc) (VC_FIELD(vc, sc) && VC_FIELD(vc, sc)->state.cstate == CONN_STATE_TS_COMMRDY) 
    190190 
    191191#endif 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_finalize.c

    r3751 r3763  
    55 */ 
    66 
    7 #include "tcp_module_impl.h" 
     7#include "tcp_impl.h" 
    88 
    99#undef FUNCNAME 
    10 #define FUNCNAME MPID_nem_tcp_module_finalize 
     10#define FUNCNAME MPID_nem_tcp_finalize 
    1111#undef FCNAME 
    1212#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    13 int MPID_nem_tcp_module_finalize() 
     13int MPID_nem_tcp_finalize() 
    1414{ 
    1515    int mpi_errno = MPI_SUCCESS; 
    1616    int ret; 
    17     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_FINALIZE); 
     17    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_FINALIZE); 
    1818 
    19     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_FINALIZE); 
     19    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_FINALIZE); 
    2020 
    21     mpi_errno = MPID_nem_tcp_module_poll_finalize(); 
     21    mpi_errno = MPID_nem_tcp_poll_finalize(); 
    2222    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    23     mpi_errno = MPID_nem_tcp_module_send_finalize(); 
     23    mpi_errno = MPID_nem_tcp_send_finalize(); 
    2424    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    25     mpi_errno = MPID_nem_tcp_module_sm_finalize(); 
     25    mpi_errno = MPID_nem_tcp_sm_finalize(); 
    2626    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    2727      
    28     if (MPID_nem_tcp_module_g_lstn_sc.fd) 
     28    if (MPID_nem_tcp_g_lstn_sc.fd) 
    2929    { 
    30         CHECK_EINTR (ret, close(MPID_nem_tcp_module_g_lstn_sc.fd)); 
     30        CHECK_EINTR (ret, close(MPID_nem_tcp_g_lstn_sc.fd)); 
    3131        MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**closesocket", "**closesocket %s %d", errno, strerror (errno)); 
    3232    } 
    3333         
    3434 fn_exit: 
    35     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_FINALIZE); 
     35    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_FINALIZE); 
    3636    return mpi_errno; 
    3737 fn_fail: 
     
    4040 
    4141#undef FUNCNAME 
    42 #define FUNCNAME MPID_nem_tcp_module_ckpt_shutdown 
     42#define FUNCNAME MPID_nem_tcp_ckpt_shutdown 
    4343#undef FCNAME 
    4444#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    45 int MPID_nem_tcp_module_ckpt_shutdown() 
     45int MPID_nem_tcp_ckpt_shutdown() 
    4646{ 
    47     return MPID_nem_tcp_module_finalize(); 
     47    return MPID_nem_tcp_finalize(); 
    4848} 
    4949 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_getip.c

    r3751 r3763  
    3030#endif 
    3131 
    32 #include "tcp_module_impl.h" 
     32#include "tcp_impl.h" 
    3333#include <sys/types.h> 
    3434 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_impl.h

    r3751 r3763  
    55 */ 
    66 
    7 #ifndef TCP_MODULE_IMPL_H 
    8 #define TCP_MODULE_IMPL_H 
     7#ifndef TCP_IMPL_H 
     8#define TCP_IMPL_H 
    99 
    1010#include "mpid_nem_impl.h" 
     
    1818 
    1919/* globals */ 
    20 extern pollfd_t *MPID_nem_tcp_module_plfd_tbl; 
    21 extern sockconn_t MPID_nem_tcp_module_g_lstn_sc; 
    22 extern pollfd_t MPID_nem_tcp_module_g_lstn_plfd; 
     20extern pollfd_t *MPID_nem_tcp_plfd_tbl; 
     21extern sockconn_t MPID_nem_tcp_g_lstn_sc; 
     22extern pollfd_t MPID_nem_tcp_g_lstn_plfd; 
    2323 
    24 extern char *MPID_nem_tcp_module_recv_buf; 
    25 #define MPID_NEM_TCP_MODULE_RECV_MAX_PKT_LEN 1024 
     24extern char *MPID_nem_tcp_recv_buf; 
     25#define MPID_NEM_TCP_RECV_MAX_PKT_LEN 1024 
    2626 
    2727 
    28 #define MPID_NEM_TCP_MODULE_VC_STATE_DISCONNECTED 0 
    29 #define MPID_NEM_TCP_MODULE_VC_STATE_CONNECTED 1 
     28#define MPID_NEM_TCP_VC_STATE_DISCONNECTED 0 
     29#define MPID_NEM_TCP_VC_STATE_CONNECTED 1 
    3030 
    3131/* The vc provides a generic buffer in which network modules can store 
     
    3535{ 
    3636    struct sockaddr_in sock_id; 
    37     struct MPID_nem_new_tcp_module_sockconn *sc; 
     37    struct MPID_nem_new_tcp_sockconn *sc; 
    3838    struct 
    3939    { 
     
    4444    /* this is a count of how many sc objects refer to this vc */ 
    4545    int sc_ref_count; 
    46 } MPID_nem_tcp_module_vc_area; 
     46} MPID_nem_tcp_vc_area; 
    4747 
    4848/* accessor macro to private fields in VC */ 
    49 #define VC_FIELD(vc, field) (((MPID_nem_tcp_module_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
     49#define VC_FIELD(vc, field) (((MPID_nem_tcp_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->field) 
    5050 
    5151#define ASSIGN_SC_TO_VC(vc_, sc_) \ 
     
    5555 
    5656/* functions */ 
    57 int MPID_nem_tcp_module_init (MPID_nem_queue_ptr_t proc_recv_queue,  
     57int MPID_nem_tcp_init (MPID_nem_queue_ptr_t proc_recv_queue,  
    5858                                 MPID_nem_queue_ptr_t proc_free_queue,  
    5959                                 MPID_nem_cell_ptr_t proc_elements,   int num_proc_elements, 
     
    6262                                 MPIDI_PG_t *pg_p, int pg_rank, 
    6363                                 char **bc_val_p, int *val_max_sz_p); 
    64 int MPID_nem_tcp_module_finalize (void); 
    65 int MPID_nem_tcp_module_ckpt_shutdown (void); 
    66 int MPID_nem_tcp_module_poll (MPID_nem_poll_dir_t in_or_out); 
    67 int MPID_nem_tcp_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
    68 int MPID_nem_tcp_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
    69 int MPID_nem_tcp_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
    70 int MPID_nem_tcp_module_vc_init (MPIDI_VC_t *vc); 
    71 int MPID_nem_tcp_module_vc_destroy(MPIDI_VC_t *vc); 
    72 int MPID_nem_tcp_module_vc_terminate (MPIDI_VC_t *vc); 
     64int MPID_nem_tcp_finalize (void); 
     65int MPID_nem_tcp_ckpt_shutdown (void); 
     66int MPID_nem_tcp_poll (MPID_nem_poll_dir_t in_or_out); 
     67int MPID_nem_tcp_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen); 
     68int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p); 
     69int MPID_nem_tcp_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc); 
     70int MPID_nem_tcp_vc_init (MPIDI_VC_t *vc); 
     71int MPID_nem_tcp_vc_destroy(MPIDI_VC_t *vc); 
     72int MPID_nem_tcp_vc_terminate (MPIDI_VC_t *vc); 
    7373 
    7474/* completion counter is atomically decremented when operation completes */ 
    75 int MPID_nem_tcp_module_get (void *target_p, void *source_p, int source_node, int len, int *completion_ctr); 
    76 int MPID_nem_tcp_module_put (void *target_p, int target_node, void *source_p, int len, int *completion_ctr); 
     75int MPID_nem_tcp_get (void *target_p, void *source_p, int source_node, int len, int *completion_ctr); 
     76int MPID_nem_tcp_put (void *target_p, int target_node, void *source_p, int len, int *completion_ctr); 
    7777 
    78 int MPID_nem_tcp_module_send_init(void); 
    79 int MPID_nem_tcp_module_poll_init(void); 
    80 int MPID_nem_tcp_module_connect(struct MPIDI_VC *const vc); 
    81 int MPID_nem_tcp_module_connpoll(void); 
    82 int MPID_nem_tcp_module_sm_init(void); 
    83 int MPID_nem_tcp_module_sm_finalize(void); 
    84 int MPID_nem_tcp_module_set_sockopts(int fd); 
    85 MPID_NEM_TCP_MODULE_SOCK_STATUS_t MPID_nem_tcp_module_check_sock_status(const pollfd_t *const plfd); 
    86 int MPID_nem_tcp_module_poll_finalize(void); 
    87 int MPID_nem_tcp_module_send_finalize(void); 
    88 int MPID_nem_tcp_module_bind(int sockfd); 
    89 int MPID_nem_tcp_module_conn_est(MPIDI_VC_t *vc); 
    90 int MPID_nem_tcp_module_get_conninfo(struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank); 
    91 int MPID_nem_tcp_module_get_vc_from_conninfo(char *pg_id, int pg_rank, struct MPIDI_VC **vc); 
    92 int MPID_nem_tcp_module_is_sock_connected(int fd); 
    93 int MPID_nem_tcp_module_disconnect(struct MPIDI_VC *const vc); 
    94 int MPID_nem_tcp_module_cleanup (struct MPIDI_VC *const vc); 
    95 int MPID_nem_tcp_module_state_listening_handler(pollfd_t *const l_plfd, sockconn_t *const l_sc); 
    96 int MPID_nem_tcp_module_send_queued(MPIDI_VC_t *vc); 
     78int MPID_nem_tcp_send_init(void); 
     79int MPID_nem_tcp_poll_init(void); 
     80int MPID_nem_tcp_connect(struct MPIDI_VC *const vc); 
     81int MPID_nem_tcp_connpoll(void); 
     82int MPID_nem_tcp_sm_init(void); 
     83int MPID_nem_tcp_sm_finalize(void); 
     84int MPID_nem_tcp_set_sockopts(int fd); 
     85MPID_NEM_TCP_SOCK_STATUS_t MPID_nem_tcp_check_sock_status(const pollfd_t *const plfd); 
     86int MPID_nem_tcp_poll_finalize(void); 
     87int MPID_nem_tcp_send_finalize(void); 
     88int MPID_nem_tcp_bind(int sockfd); 
     89int MPID_nem_tcp_conn_est(MPIDI_VC_t *vc); 
     90int MPID_nem_tcp_get_conninfo(struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank); 
     91int MPID_nem_tcp_get_vc_from_conninfo(char *pg_id, int pg_rank, struct MPIDI_VC **vc); 
     92int MPID_nem_tcp_is_sock_connected(int fd); 
     93int MPID_nem_tcp_disconnect(struct MPIDI_VC *const vc); 
     94int MPID_nem_tcp_cleanup (struct MPIDI_VC *const vc); 
     95int MPID_nem_tcp_state_listening_handler(pollfd_t *const l_plfd, sockconn_t *const l_sc); 
     96int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc); 
    9797 
    9898int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz); 
     
    100100                                    MPID_Request **sreq_ptr); 
    101101int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz); 
    102 int MPID_nem_tcp_module_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port); 
     102int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port); 
    103103 
    104 void MPID_nem_tcp_module_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc); 
     104void MPID_nem_tcp_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc); 
    105105 
    106 int MPID_nem_tcp_module_socksm_finalize(void); 
    107 int MPID_nem_tcp_module_socksm_init(void); 
     106int MPID_nem_tcp_socksm_finalize(void); 
     107int MPID_nem_tcp_socksm_init(void); 
    108108 
    109109 
     
    143143#define VC_L_EMPTY(q) GENERIC_L_EMPTY (q) 
    144144#define VC_L_HEAD(q) GENERIC_L_HEAD (q) 
    145 #define SET_PLFD(ep)   MPID_nem_tcp_module_plfd_tbl[VC_FIELD(ep, sc)->index].events |= POLLOUT 
    146 #define UNSET_PLFD(ep) MPID_nem_tcp_module_plfd_tbl[VC_FIELD(ep, sc)->index].events &= ~POLLOUT 
     145#define SET_PLFD(ep)   MPID_nem_tcp_plfd_tbl[VC_FIELD(ep, sc)->index].events |= POLLOUT 
     146#define UNSET_PLFD(ep) MPID_nem_tcp_plfd_tbl[VC_FIELD(ep, sc)->index].events &= ~POLLOUT 
    147147 
    148148/* stack macros */ 
     
    167167int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found ); 
    168168 
    169 #endif /* TCP_MODULE_IMPL_H */ 
     169#endif /* TCP_IMPL_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_init.c

    r3751 r3763  
    55 */ 
    66 
    7 #include "tcp_module_impl.h" 
     7#include "tcp_impl.h" 
    88#include <sys/types.h> 
    99#include <sys/socket.h> 
     
    1212#define DBG_IFNAME 0 
    1313 
    14 MPID_nem_netmod_funcs_t MPIDI_nem_tcp_module_funcs = { 
    15     MPID_nem_tcp_module_init, 
    16     MPID_nem_tcp_module_finalize, 
    17     MPID_nem_tcp_module_ckpt_shutdown, 
    18     MPID_nem_tcp_module_poll, 
    19     MPID_nem_tcp_module_send, 
    20     MPID_nem_tcp_module_get_business_card, 
    21     MPID_nem_tcp_module_connect_to_root, 
    22     MPID_nem_tcp_module_vc_init, 
    23     MPID_nem_tcp_module_vc_destroy, 
    24     MPID_nem_tcp_module_vc_terminate 
     14MPID_nem_netmod_funcs_t MPIDI_nem_tcp_funcs = { 
     15    MPID_nem_tcp_init, 
     16    MPID_nem_tcp_finalize, 
     17    MPID_nem_tcp_ckpt_shutdown, 
     18    MPID_nem_tcp_poll, 
     19    MPID_nem_tcp_send, 
     20    MPID_nem_tcp_get_business_card, 
     21    MPID_nem_tcp_connect_to_root, 
     22    MPID_nem_tcp_vc_init, 
     23    MPID_nem_tcp_vc_destroy, 
     24    MPID_nem_tcp_vc_terminate 
    2525}; 
    2626 
     
    3030 
    3131#undef FUNCNAME 
    32 #define FUNCNAME MPID_nem_tcp_module_init 
    33 #undef FCNAME 
    34 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    35 int MPID_nem_tcp_module_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, 
     32#define FUNCNAME MPID_nem_tcp_init 
     33#undef FCNAME 
     34#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     35int MPID_nem_tcp_init (MPID_nem_queue_ptr_t proc_recv_queue, MPID_nem_queue_ptr_t proc_free_queue, 
    3636                                 MPID_nem_cell_ptr_t proc_elements, int num_proc_elements, MPID_nem_cell_ptr_t module_elements, 
    3737                                 int num_module_elements, MPID_nem_queue_ptr_t *module_free_queue, 
     
    4040    int mpi_errno = MPI_SUCCESS; 
    4141    int ret; 
    42     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_INIT); 
    43  
    44     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_INIT); 
    45  
    46     MPID_nem_net_module_vc_dbg_print_sendq = MPID_nem_tcp_module_vc_dbg_print_sendq; 
     42    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_INIT); 
     43 
     44    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_INIT); 
     45 
     46    MPID_nem_net_module_vc_dbg_print_sendq = MPID_nem_tcp_vc_dbg_print_sendq; 
    4747 
    4848    /* first make sure that our private fields in the vc fit into the area provided  */ 
    49     MPIU_Assert(sizeof(MPID_nem_tcp_module_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
     49    MPIU_Assert(sizeof(MPID_nem_tcp_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN); 
    5050 
    5151    /* set up listener socket */ 
    5252/*     fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */ 
    53     MPID_nem_tcp_module_g_lstn_plfd.fd = MPID_nem_tcp_module_g_lstn_sc.fd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); 
    54     MPIU_ERR_CHKANDJUMP2 (MPID_nem_tcp_module_g_lstn_sc.fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror (errno), errno); 
    55  
    56     mpi_errno = MPID_nem_tcp_module_set_sockopts (MPID_nem_tcp_module_g_lstn_sc.fd); 
     53    MPID_nem_tcp_g_lstn_plfd.fd = MPID_nem_tcp_g_lstn_sc.fd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); 
     54    MPIU_ERR_CHKANDJUMP2 (MPID_nem_tcp_g_lstn_sc.fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror (errno), errno); 
     55 
     56    mpi_errno = MPID_nem_tcp_set_sockopts (MPID_nem_tcp_g_lstn_sc.fd); 
    5757    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    5858 
    59     MPID_nem_tcp_module_g_lstn_plfd.events = POLLIN; 
    60     mpi_errno = MPID_nem_tcp_module_bind (MPID_nem_tcp_module_g_lstn_sc.fd); 
     59    MPID_nem_tcp_g_lstn_plfd.events = POLLIN; 
     60    mpi_errno = MPID_nem_tcp_bind (MPID_nem_tcp_g_lstn_sc.fd); 
    6161    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    6262 
    63     ret = listen (MPID_nem_tcp_module_g_lstn_sc.fd, SOMAXCONN);              
     63    ret = listen (MPID_nem_tcp_g_lstn_sc.fd, SOMAXCONN);             
    6464    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**listen", "**listen %s %d", errno, MPIU_Strerror (errno));   
    65     MPID_nem_tcp_module_g_lstn_sc.state.lstate = LISTEN_STATE_LISTENING; 
    66     MPID_nem_tcp_module_g_lstn_sc.handler = MPID_nem_tcp_module_state_listening_handler; 
     65    MPID_nem_tcp_g_lstn_sc.state.lstate = LISTEN_STATE_LISTENING; 
     66    MPID_nem_tcp_g_lstn_sc.handler = MPID_nem_tcp_state_listening_handler; 
    6767 
    6868    /* create business card */ 
    69     mpi_errno = MPID_nem_tcp_module_get_business_card(pg_rank, bc_val_p, val_max_sz_p); 
     69    mpi_errno = MPID_nem_tcp_get_business_card(pg_rank, bc_val_p, val_max_sz_p); 
    7070    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    7171 
    7272    *module_free_queue = NULL; 
    7373 
    74     mpi_errno = MPID_nem_tcp_module_sm_init(); 
    75     if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    76     mpi_errno = MPID_nem_tcp_module_send_init(); 
    77     if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    78     mpi_errno = MPID_nem_tcp_module_poll_init(); 
    79     if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    80  
    81  
    82  fn_exit: 
    83     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_INIT); 
     74    mpi_errno = MPID_nem_tcp_sm_init(); 
     75    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     76    mpi_errno = MPID_nem_tcp_send_init(); 
     77    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     78    mpi_errno = MPID_nem_tcp_poll_init(); 
     79    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     80 
     81 
     82 fn_exit: 
     83    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_INIT); 
    8484/*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */ 
    8585    return mpi_errno; 
     
    186186 
    187187#undef FUNCNAME 
    188 #define FUNCNAME MPID_nem_tcp_module_get_business_card 
    189 #undef FCNAME 
    190 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    191 int MPID_nem_tcp_module_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
     188#define FUNCNAME MPID_nem_tcp_get_business_card 
     189#undef FCNAME 
     190#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     191int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p) 
    192192{ 
    193193    int mpi_errno = MPI_SUCCESS; 
     
    197197    struct sockaddr_in sock_id; 
    198198    socklen_t len; 
    199     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_GET_BUSINESS_CARD); 
    200  
    201     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_GET_BUSINESS_CARD); 
     199    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD); 
     200 
     201    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD); 
    202202     
    203203    mpi_errno = GetSockInterfaceAddr(my_rank, ifname, sizeof(ifname), &ifaddr); 
     
    219219 
    220220    len = sizeof(sock_id); 
    221     ret = getsockname (MPID_nem_tcp_module_g_lstn_sc.fd, (struct sockaddr *)&sock_id, &len); 
     221    ret = getsockname (MPID_nem_tcp_g_lstn_sc.fd, (struct sockaddr *)&sock_id, &len); 
    222222    MPIU_ERR_CHKANDJUMP1 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**getsockname", "**getsockname %s", MPIU_Strerror (errno)); 
    223223 
     
    258258    } 
    259259 
    260     /*     printf("MPID_nem_tcp_module_get_business_card. port=%d\n", sock_id.sin_port); */ 
    261  
    262  fn_exit: 
    263 /*     fprintf(stdout, "MPID_nem_tcp_module_get_business_card Exit, mpi_errno=%d\n", mpi_errno); fflush(stdout); */ 
    264     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_GET_BUSINESS_CARD); 
    265     return mpi_errno; 
    266  fn_fail: 
    267     goto fn_exit; 
    268 } 
    269  
    270 #undef FUNCNAME 
    271 #define FUNCNAME MPID_nem_tcp_module_connect_to_root 
    272 #undef FCNAME 
    273 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    274 int MPID_nem_tcp_module_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
     260    /*     printf("MPID_nem_tcp_get_business_card. port=%d\n", sock_id.sin_port); */ 
     261 
     262 fn_exit: 
     263/*     fprintf(stdout, "MPID_nem_tcp_get_business_card Exit, mpi_errno=%d\n", mpi_errno); fflush(stdout); */ 
     264    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD); 
     265    return mpi_errno; 
     266 fn_fail: 
     267    goto fn_exit; 
     268} 
     269 
     270#undef FUNCNAME 
     271#define FUNCNAME MPID_nem_tcp_connect_to_root 
     272#undef FCNAME 
     273#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     274int MPID_nem_tcp_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc) 
    275275{ 
    276276    int mpi_errno = MPI_SUCCESS; 
    277277    struct in_addr addr; 
    278     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT_TO_ROOT); 
    279  
    280     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT_TO_ROOT); 
     278    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_CONNECT_TO_ROOT); 
     279 
     280    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_CONNECT_TO_ROOT); 
    281281 
    282282    /* vc is already allocated before reaching this point */ 
    283283 
    284     mpi_errno = MPID_nem_tcp_module_get_addr_port_from_bc(business_card, &addr, &(VC_FIELD(new_vc, sock_id).sin_port)); 
     284    mpi_errno = MPID_nem_tcp_get_addr_port_from_bc(business_card, &addr, &(VC_FIELD(new_vc, sock_id).sin_port)); 
    285285    VC_FIELD(new_vc, sock_id).sin_addr.s_addr = addr.s_addr; 
    286286    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     
    288288    mpi_errno = MPIDI_GetTagFromPort(business_card, &new_vc->port_name_tag); 
    289289    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    290     MPID_nem_tcp_module_connect(new_vc);  
    291  
    292  fn_exit: 
    293     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_CONNECT_TO_ROOT); 
    294     return mpi_errno; 
    295  
    296  fn_fail: 
    297     goto fn_exit; 
    298 } 
    299  
    300 #undef FUNCNAME 
    301 #define FUNCNAME MPID_nem_tcp_module_vc_init 
    302 #undef FCNAME 
    303 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    304 int MPID_nem_tcp_module_vc_init (MPIDI_VC_t *vc) 
     290    MPID_nem_tcp_connect(new_vc);  
     291 
     292 fn_exit: 
     293    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CONNECT_TO_ROOT); 
     294    return mpi_errno; 
     295 
     296 fn_fail: 
     297    goto fn_exit; 
     298} 
     299 
     300#undef FUNCNAME 
     301#define FUNCNAME MPID_nem_tcp_vc_init 
     302#undef FCNAME 
     303#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     304int MPID_nem_tcp_vc_init (MPIDI_VC_t *vc) 
    305305{ 
    306306    int mpi_errno = MPI_SUCCESS; 
    307307    MPIDI_CH3I_VC *vc_ch = (MPIDI_CH3I_VC *)vc->channel_private; 
    308     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_VC_INIT); 
    309  
    310     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_VC_INIT); 
    311  
    312     vc_ch->state = MPID_NEM_TCP_MODULE_VC_STATE_DISCONNECTED; 
     308    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_VC_INIT); 
     309 
     310    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_VC_INIT); 
     311 
     312    vc_ch->state = MPID_NEM_TCP_VC_STATE_DISCONNECTED; 
    313313     
    314314    vc->sendNoncontig_fn      = MPID_nem_tcp_SendNoncontig; 
     
    326326    VC_FIELD(vc, sc_ref_count) = 0; 
    327327 
    328     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_VC_INIT); 
    329     return mpi_errno; 
    330 } 
    331  
    332 #undef FUNCNAME 
    333 #define FUNCNAME MPID_nem_tcp_module_vc_destroy 
    334 #undef FCNAME 
    335 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    336 int MPID_nem_tcp_module_vc_destroy(MPIDI_VC_t *vc) 
     328    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_VC_INIT); 
     329    return mpi_errno; 
     330} 
     331 
     332#undef FUNCNAME 
     333#define FUNCNAME MPID_nem_tcp_vc_destroy 
     334#undef FCNAME 
     335#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     336int MPID_nem_tcp_vc_destroy(MPIDI_VC_t *vc) 
    337337{ 
    338338    int mpi_errno = MPI_SUCCESS; 
     
    347347        goto fn_exit; 
    348348 
    349     plfd = &MPID_nem_tcp_module_plfd_tbl[sc->index];  
     349    plfd = &MPID_nem_tcp_plfd_tbl[sc->index];  
    350350#endif 
    351351 
     
    360360    
    361361#undef FUNCNAME 
    362 #define FUNCNAME MPID_nem_tcp_module_get_addr_port_from_bc 
    363 #undef FCNAME 
    364 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    365 int MPID_nem_tcp_module_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port) 
     362#define FUNCNAME MPID_nem_tcp_get_addr_port_from_bc 
     363#undef FCNAME 
     364#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     365int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port) 
    366366{ 
    367367    int mpi_errno = MPI_SUCCESS; 
     
    370370    /*char desc_str[256];*/ 
    371371    char ifname[256]; 
    372     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_GET_ADDR_PORT_FROM_BC); 
    373  
    374     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_GET_ADDR_PORT_FROM_BC); 
     372    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC); 
     373 
     374    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC); 
    375375     
    376376    /*     fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */ 
     
    398398 fn_exit: 
    399399/*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */ 
    400     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_GET_ADDR_PORT_FROM_BC); 
     400    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC); 
    401401    return mpi_errno; 
    402402 fn_fail: 
     
    406406} 
    407407 
    408 /* MPID_nem_tcp_module_bind -- if MPICH_PORT_RANGE is set, this 
     408/* MPID_nem_tcp_bind -- if MPICH_PORT_RANGE is set, this 
    409409   binds the socket to an available port number in the range. 
    410410   Otherwise, it binds it to any addr and any port */ 
    411411#undef FUNCNAME 
    412 #define FUNCNAME MPID_nem_tcp_module_bind 
    413 #undef FCNAME 
    414 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    415 int MPID_nem_tcp_module_bind (int sockfd) 
     412#define FUNCNAME MPID_nem_tcp_bind 
     413#undef FCNAME 
     414#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     415int MPID_nem_tcp_bind (int sockfd) 
    416416{ 
    417417    int mpi_errno = MPI_SUCCESS; 
     
    419419    struct sockaddr_in sin; 
    420420    int port, low_port, high_port; 
    421     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_BIND); 
    422  
    423     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_BIND); 
     421    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_BIND); 
     422 
     423    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_BIND); 
    424424    
    425425    low_port = 0; 
     
    453453/*         fprintf(stdout, "sockfd=%d  port=%d bound\n", sockfd, port); */ 
    454454/*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */ 
    455     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_BIND); 
     455    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_BIND); 
    456456    return mpi_errno; 
    457457 fn_fail: 
     
    463463 
    464464#undef FUNCNAME 
    465 #define FUNCNAME MPID_nem_tcp_module_vc_terminate 
    466 #undef FCNAME 
    467 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    468 int MPID_nem_tcp_module_vc_terminate (MPIDI_VC_t *vc) 
    469 { 
    470     int mpi_errno = MPI_SUCCESS; 
    471     MPIDI_STATE_DECL(MPID_NEM_TCP_MODULE_VC_TERMINATE); 
    472  
    473     MPIDI_FUNC_ENTER(MPID_NEM_TCP_MODULE_VC_TERMINATE); 
    474  
    475     mpi_errno = MPID_nem_tcp_module_cleanup(vc); 
    476     if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    477      
    478  fn_exit: 
    479     MPIDI_FUNC_EXIT(MPID_NEM_TCP_MODULE_VC_TERMINATE); 
     465#define FUNCNAME MPID_nem_tcp_vc_terminate 
     466#undef FCNAME 
     467#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     468int MPID_nem_tcp_vc_terminate (MPIDI_VC_t *vc) 
     469{ 
     470    int mpi_errno = MPI_SUCCESS; 
     471    MPIDI_STATE_DECL(MPID_NEM_TCP_VC_TERMINATE); 
     472 
     473    MPIDI_FUNC_ENTER(MPID_NEM_TCP_VC_TERMINATE); 
     474 
     475    mpi_errno = MPID_nem_tcp_cleanup(vc); 
     476    if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     477     
     478 fn_exit: 
     479    MPIDI_FUNC_EXIT(MPID_NEM_TCP_VC_TERMINATE); 
    480480    return mpi_errno; 
    481481 fn_fail: 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_poll.c

    r3751 r3763  
    55 */ 
    66 
    7 #include "tcp_module_impl.h" 
     7#include "tcp_impl.h" 
    88#include "socksm.h" 
    99#include <errno.h> 
    1010 
    11 char *MPID_nem_tcp_module_recv_buf = NULL; /* avoid common symbol */ 
     11char *MPID_nem_tcp_recv_buf = NULL; /* avoid common symbol */ 
    1212 
    1313#undef FUNCNAME 
    14 #define FUNCNAME MPID_nem_tcp_module_poll_init 
     14#define FUNCNAME MPID_nem_tcp_poll_init 
    1515#undef FCNAME 
    1616#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    17 int MPID_nem_tcp_module_poll_init() 
     17int MPID_nem_tcp_poll_init() 
    1818{ 
    1919    int mpi_errno = MPI_SUCCESS; 
    2020    MPIU_CHKPMEM_DECL(1); 
    2121 
    22     MPIU_CHKPMEM_MALLOC(MPID_nem_tcp_module_recv_buf, char*, MPID_NEM_TCP_MODULE_RECV_MAX_PKT_LEN, mpi_errno, "TCP temporary buffer"); 
     22    MPIU_CHKPMEM_MALLOC(MPID_nem_tcp_recv_buf, char*, MPID_NEM_TCP_RECV_MAX_PKT_LEN, mpi_errno, "TCP temporary buffer"); 
    2323    MPIU_CHKPMEM_COMMIT(); 
    2424 
     
    3131 
    3232 
    33 int MPID_nem_tcp_module_poll_finalize() 
     33int MPID_nem_tcp_poll_finalize() 
    3434{ 
    35     MPIU_Free(MPID_nem_tcp_module_recv_buf); 
     35    MPIU_Free(MPID_nem_tcp_recv_buf); 
    3636    return MPI_SUCCESS; 
    3737} 
     
    3939 
    4040#undef FUNCNAME 
    41 #define FUNCNAME MPID_nem_tcp_module_poll 
     41#define FUNCNAME MPID_nem_tcp_poll 
    4242#undef FCNAME 
    4343#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    44 int MPID_nem_tcp_module_poll (MPID_nem_poll_dir_t in_or_out) 
     44int MPID_nem_tcp_poll (MPID_nem_poll_dir_t in_or_out) 
    4545{ 
    4646    int mpi_errno = MPI_SUCCESS; 
    4747 
    48     mpi_errno = MPID_nem_tcp_module_connpoll(); 
     48    mpi_errno = MPID_nem_tcp_connpoll(); 
    4949    if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    5050 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_queue.h

    r3751 r3763  
    55 */ 
    66 
    7 #ifndef TCP_MODULE_QUEUE_H 
    8 #define TCP_MODULE_QUEUE_H 
     7#ifndef TCP_QUEUE_H 
     8#define TCP_QUEUE_H 
    99 
    1010/* Generic queue macros -- "next_field" should be set to the name of 
     
    132132        (sp)->top = (*(ep))->next_field;        \ 
    133133    } while (0) 
    134 #endif /* TCP_MODULE_QUEUE_H */ 
     134#endif /* TCP_QUEUE_H */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_send.c

    r3751 r3763  
    55 */ 
    66 
    7 #include "tcp_module_impl.h" 
     7#include "tcp_impl.h" 
    88 
    99#define NUM_PREALLOC_SENDQ 10 
     
    1616 
    1717 
    18 typedef struct MPID_nem_tcp_module_send_q_element 
    19 { 
    20     struct MPID_nem_tcp_module_send_q_element *next; 
     18typedef struct MPID_nem_tcp_send_q_element 
     19{ 
     20    struct MPID_nem_tcp_send_q_element *next; 
    2121    size_t len;                        /* number of bytes left to send */ 
    2222    char *start;                       /* pointer to next byte to send */ 
    2323    MPID_nem_cell_ptr_t cell; 
    2424    /*     char buf[MPID_NEM_MAX_PACKET_LEN];*/ /* data to be sent */ 
    25 } MPID_nem_tcp_module_send_q_element_t; 
    26  
    27 struct {MPID_nem_tcp_module_send_q_element_t *top;} free_buffers = {0}; 
     25} MPID_nem_tcp_send_q_element_t; 
     26 
     27struct {MPID_nem_tcp_send_q_element_t *top;} free_buffers = {0}; 
    2828 
    2929#define ALLOC_Q_ELEMENT(e) do {                                                                                                         \ 
    3030        if (S_EMPTY (free_buffers))                                                                                                     \ 
    3131        {                                                                                                                               \ 
    32             MPIU_CHKPMEM_MALLOC (*(e), MPID_nem_tcp_module_send_q_element_t *, sizeof(MPID_nem_tcp_module_send_q_element_t),      \ 
     32            MPIU_CHKPMEM_MALLOC (*(e), MPID_nem_tcp_send_q_element_t *, sizeof(MPID_nem_tcp_send_q_element_t),      \ 
    3333                                 mpi_errno, "send queue element");                                                                      \ 
    3434        }                                                                                                                               \ 
     
    4646 
    4747#undef FUNCNAME 
    48 #define FUNCNAME MPID_nem_tcp_module_send_init 
    49 #undef FCNAME 
    50 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    51 int MPID_nem_tcp_module_send_init() 
     48#define FUNCNAME MPID_nem_tcp_send_init 
     49#undef FCNAME 
     50#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     51int MPID_nem_tcp_send_init() 
    5252{ 
    5353    int mpi_errno = MPI_SUCCESS; 
     
    5858    for (i = 0; i < NUM_PREALLOC_SENDQ; ++i) 
    5959    { 
    60         MPID_nem_tcp_module_send_q_element_t *e; 
    61          
    62         MPIU_CHKPMEM_MALLOC (e, MPID_nem_tcp_module_send_q_element_t *, 
    63                              sizeof(MPID_nem_tcp_module_send_q_element_t), mpi_errno, "send queue element"); 
     60        MPID_nem_tcp_send_q_element_t *e; 
     61         
     62        MPIU_CHKPMEM_MALLOC (e, MPID_nem_tcp_send_q_element_t *, 
     63                             sizeof(MPID_nem_tcp_send_q_element_t), mpi_errno, "send queue element"); 
    6464        S_PUSH (&free_buffers, e); 
    6565    } 
     
    7373 
    7474#undef FUNCNAME 
    75 #define FUNCNAME MPID_nem_tcp_module_send 
    76 #undef FCNAME 
    77 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    78 int MPID_nem_tcp_module_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
     75#define FUNCNAME MPID_nem_tcp_send 
     76#undef FCNAME 
     77#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     78int MPID_nem_tcp_send (MPIDI_VC_t *vc, MPID_nem_cell_ptr_t cell, int datalen) 
    7979{ 
    8080    int mpi_errno = MPI_SUCCESS; 
     
    8585 
    8686#undef FUNCNAME 
    87 #define FUNCNAME MPID_nem_tcp_module_send_queued 
    88 #undef FCNAME 
    89 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    90 int MPID_nem_tcp_module_send_queued (MPIDI_VC_t *vc) 
     87#define FUNCNAME MPID_nem_tcp_send_queued 
     88#undef FCNAME 
     89#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     90int MPID_nem_tcp_send_queued (MPIDI_VC_t *vc) 
    9191{ 
    9292    int mpi_errno = MPI_SUCCESS; 
     
    9595    MPID_IOV *iov; 
    9696    int complete; 
    97     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_SEND_QUEUED); 
    98  
    99     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_SEND_QUEUED); 
     97    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_SEND_QUEUED); 
     98 
     99    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_SEND_QUEUED); 
    100100 
    101101    MPIU_Assert(vc != NULL); 
     
    177177     
    178178 fn_exit: 
    179     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_SEND_QUEUED); 
     179    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_SEND_QUEUED); 
    180180    return mpi_errno; 
    181181 fn_fail: 
     
    184184 
    185185#undef FUNCNAME 
    186 #define FUNCNAME MPID_nem_tcp_module_send_finalize 
    187 #undef FCNAME 
    188 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    189 int MPID_nem_tcp_module_send_finalize() 
     186#define FUNCNAME MPID_nem_tcp_send_finalize 
     187#undef FCNAME 
     188#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     189int MPID_nem_tcp_send_finalize() 
    190190{ 
    191191    int mpi_errno = MPI_SUCCESS; 
     
    193193    while (!S_EMPTY (free_buffers)) 
    194194    { 
    195         MPID_nem_tcp_module_send_q_element_t *e; 
     195        MPID_nem_tcp_send_q_element_t *e; 
    196196        S_POP (&free_buffers, &e); 
    197197        MPIU_Free (e); 
     
    200200} 
    201201 
    202 /* MPID_nem_tcp_module_conn_est -- this function is called when the 
     202/* MPID_nem_tcp_conn_est -- this function is called when the 
    203203   connection is finally established to send any pending sends */ 
    204204#undef FUNCNAME 
    205 #define FUNCNAME MPID_nem_tcp_module_conn_est 
    206 #undef FCNAME 
    207 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    208 int MPID_nem_tcp_module_conn_est (MPIDI_VC_t *vc) 
    209 { 
    210     int mpi_errno = MPI_SUCCESS; 
    211     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_CONN_EST); 
    212  
    213     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_CONN_EST); 
     205#define FUNCNAME MPID_nem_tcp_conn_est 
     206#undef FCNAME 
     207#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     208int MPID_nem_tcp_conn_est (MPIDI_VC_t *vc) 
     209{ 
     210    int mpi_errno = MPI_SUCCESS; 
     211    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_CONN_EST); 
     212 
     213    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_CONN_EST); 
    214214 
    215215    if (!SENDQ_EMPTY (VC_FIELD(vc, send_queue))) 
    216216    { 
    217217        SET_PLFD(vc); 
    218         mpi_errno = MPID_nem_tcp_module_send_queued (vc); 
     218        mpi_errno = MPID_nem_tcp_send_queued (vc); 
    219219        if (mpi_errno) MPIU_ERR_POP (mpi_errno); 
    220220    } 
    221221 
    222222 fn_fail:     
    223     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_CONN_EST); 
     223    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_CONN_EST); 
    224224    return mpi_errno; 
    225225} 
     
    245245    MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tcp_iStartContigMsg"); 
    246246    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr); 
    247     if (MPID_nem_tcp_module_vc_is_connected(vc)) 
     247    if (MPID_nem_tcp_vc_is_connected(vc)) 
    248248    { 
    249249        if (SENDQ_EMPTY(VC_FIELD(vc, send_queue))) 
     
    277277    else 
    278278    { 
    279         mpi_errno = MPID_nem_tcp_module_connect(vc); 
     279        mpi_errno = MPID_nem_tcp_connect(vc); 
    280280        if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    281281    } 
     
    317317    MPIU_Assert(sreq->dev.iov_count >= 1 && sreq->dev.iov[0].MPID_IOV_LEN > 0); 
    318318 
    319     if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_module_vc_is_connected(vc)) 
     319    if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_vc_is_connected(vc)) 
    320320        SET_PLFD(vc); 
    321321    SENDQ_ENQUEUE(&VC_FIELD(vc, send_queue), sreq); 
     
    349349 
    350350    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr); 
    351     if (MPID_nem_tcp_module_vc_is_connected(vc)) 
     351    if (MPID_nem_tcp_vc_is_connected(vc)) 
    352352    { 
    353353        if (SENDQ_EMPTY(VC_FIELD(vc, send_queue))) 
     
    405405    else 
    406406    { 
    407         mpi_errno = MPID_nem_tcp_module_connect(vc); 
     407        mpi_errno = MPID_nem_tcp_connect(vc); 
    408408        if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    409409    } 
     
    440440    sreq->dev.iov_offset = 0; 
    441441 
    442     if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_module_vc_is_connected(vc)) 
     442    if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_vc_is_connected(vc)) 
    443443        SET_PLFD(vc); 
    444444    SENDQ_ENQUEUE(&VC_FIELD(vc, send_queue), sreq); 
     
    479479    offset = 0; 
    480480 
    481     if (MPID_nem_tcp_module_vc_is_connected(vc)) 
     481    if (MPID_nem_tcp_vc_is_connected(vc)) 
    482482    { 
    483483        if (SENDQ_EMPTY(VC_FIELD(vc, send_queue))) 
     
    497497    else 
    498498    { 
    499         mpi_errno = MPID_nem_tcp_module_connect(vc); 
     499        mpi_errno = MPID_nem_tcp_connect(vc); 
    500500        if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    501501    } 
     
    557557    sreq->dev.iov_offset = 0; 
    558558         
    559     if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_module_vc_is_connected(vc)) 
     559    if (SENDQ_EMPTY(VC_FIELD(vc, send_queue)) && MPID_nem_tcp_vc_is_connected(vc)) 
    560560        SET_PLFD(vc); 
    561561    SENDQ_ENQUEUE(&VC_FIELD(vc, send_queue), sreq); 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/net_mod/tcp/tcp_utility.c

    r3751 r3763  
    55 */ 
    66 
    7 #include "tcp_module_impl.h" 
    8  
    9 /* MPID_nem_tcp_module_get_conninfo -- This function takes a VC 
     7#include "tcp_impl.h" 
     8 
     9/* MPID_nem_tcp_get_conninfo -- This function takes a VC 
    1010   pointer as input and outputs the sockaddr, pg_id, and pg_rank of 
    1111   the remote process associated with this VC.  [NOTE: I'm not sure 
     
    1313   avoid a copy on this.] */ 
    1414#undef FUNCNAME 
    15 #define FUNCNAME MPID_nem_tcp_module_get_conninfo 
    16 #undef FCNAME 
    17 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    18 int MPID_nem_tcp_module_get_conninfo (struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank) 
     15#define FUNCNAME MPID_nem_tcp_get_conninfo 
     16#undef FCNAME 
     17#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     18int MPID_nem_tcp_get_conninfo (struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank) 
    1919{ 
    2020    int mpi_errno = MPI_SUCCESS; 
     
    2727} 
    2828 
    29 /* MPID_nem_tcp_module_get_vc_from_conninfo -- This function takes 
     29/* MPID_nem_tcp_get_vc_from_conninfo -- This function takes 
    3030   the pg_id and pg_rank and returns the corresponding VC. */ 
    3131#undef FUNCNAME 
    32 #define FUNCNAME MPID_nem_tcp_module_get_vc_from_conninfo 
    33 #undef FCNAME 
    34 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    35 int MPID_nem_tcp_module_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC **vc) 
     32#define FUNCNAME MPID_nem_tcp_get_vc_from_conninfo 
     33#undef FCNAME 
     34#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     35int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC **vc) 
    3636{ 
    3737    int mpi_errno = MPI_SUCCESS; 
    3838    MPIDI_PG_t *pg; 
    39     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_MODULE_GET_VC_FROM_CONNINFO); 
    40  
    41     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_MODULE_GET_VC_FROM_CONNINFO); 
     39    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); 
     40 
     41    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); 
    4242 
    4343    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank)); 
     
    5252     
    5353 fn_exit: 
    54     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_MODULE_GET_VC_FROM_CONNINFO); 
     54    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); 
    5555    return mpi_errno; 
    5656 fn_fail: 
     
    6262#undef FCNAME 
    6363#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    64 int MPID_nem_tcp_module_set_sockopts (int fd) 
     64int MPID_nem_tcp_set_sockopts (int fd) 
    6565{ 
    6666    int mpi_errno = MPI_SUCCESS; 
     
    110110 
    111111/* 
    112   MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF : connection failed 
    113   MPID_NEM_TCP_MODULE_SOCK_CONNECTED : socket connected (connection success) 
    114   MPID_NEM_TCP_MODULE_SOCK_NOEVENT   : No event on socket 
     112  MPID_NEM_TCP_SOCK_ERROR_EOF : connection failed 
     113  MPID_NEM_TCP_SOCK_CONNECTED : socket connected (connection success) 
     114  MPID_NEM_TCP_SOCK_NOEVENT   : No event on socket 
    115115 
    116116N1: some implementations do not set POLLERR when there is a pending error on socket. 
     
    128128before doing any read/write at least in the connection establishment state machine code. 
    129129 
    130 N3: return code MPID_NEM_TCP_MODULE_SOCK_NOEVENT is used only by the code that wants to 
     130N3: return code MPID_NEM_TCP_SOCK_NOEVENT is used only by the code that wants to 
    131131know whether the connect is still not complete after a non-blocking connect is issued. 
    132132 
     
    137137 
    138138#undef FUNCNAME 
    139 #define FUNCNAME MPID_nem_tcp_module_check_sock_status 
    140 #undef FCNAME 
    141 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    142 MPID_NEM_TCP_MODULE_SOCK_STATUS_t  
    143 MPID_nem_tcp_module_check_sock_status(const pollfd_t *const plfd) 
    144 { 
    145     int rc = MPID_NEM_TCP_MODULE_SOCK_NOEVENT; 
     139#define FUNCNAME MPID_nem_tcp_check_sock_status 
     140#undef FCNAME 
     141#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     142MPID_NEM_TCP_SOCK_STATUS_t  
     143MPID_nem_tcp_check_sock_status(const pollfd_t *const plfd) 
     144{ 
     145    int rc = MPID_NEM_TCP_SOCK_NOEVENT; 
    146146 
    147147    if (plfd->revents & POLLERR)  
    148148    { 
    149         rc = MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF; 
     149        rc = MPID_NEM_TCP_SOCK_ERROR_EOF; 
    150150        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "POLLERR on socket")); 
    151151        goto fn_exit; 
     
    159159        if (getsockopt(plfd->fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0)  
    160160        { 
    161             rc = MPID_NEM_TCP_MODULE_SOCK_ERROR_EOF; /*  (N1) */ 
     161            rc = MPID_NEM_TCP_SOCK_ERROR_EOF; /*  (N1) */ 
    162162            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, strerror(error))); 
    163163            goto fn_exit; 
    164164        } 
    165         rc = MPID_NEM_TCP_MODULE_SOCK_CONNECTED; 
     165        rc = MPID_NEM_TCP_SOCK_CONNECTED; 
    166166    } 
    167167 fn_exit: 
     
    172172 */ 
    173173#undef FUNCNAME 
    174 #define FUNCNAME MPID_nem_tcp_module_is_sock_connected 
    175 #undef FCNAME 
    176 #define FCNAME MPIDI_QUOTE(FUNCNAME) 
    177 int MPID_nem_tcp_module_is_sock_connected(int fd) 
     174#define FUNCNAME MPID_nem_tcp_is_sock_connected 
     175#undef FCNAME 
     176#define FCNAME MPIDI_QUOTE(FUNCNAME) 
     177int MPID_nem_tcp_is_sock_connected(int fd) 
    178178{ 
    179179    int rc = FALSE; 
     
    205205#undef FCNAME 
    206206#define FCNAME MPIDI_QUOTE(FUNCNAME) 
    207 void MPID_nem_tcp_module_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc) 
     207void MPID_nem_tcp_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc) 
    208208{ 
    209209    int i;