Changeset 3217

Show
Ignore:
Timestamp:
10/01/08 19:02:02 (18 months ago)
Author:
balaji
Message:

#ifdef out zero-length arrays to ensure strict compilers don't complain about it.

Location:
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_datatypes.h

    r2927 r3217  
    101101*/ 
    102102 
    103 #define MPID_NEM_CELL_HEAD_LEN sizeof(double) 
     103#define MPID_NEM_CELL_HEAD_LEN    8 /* We use this to keep elements 64-bit aligned */ 
    104104#define MPID_NEM_CELL_PAYLOAD_LEN (MPID_NEM_CELL_LEN - MPID_NEM_CELL_HEAD_LEN) 
    105105 
     
    166166 * convert between relative and absolute pointers. */ 
    167167 
     168/* This should always be exactly the size of a pointer */ 
    168169typedef struct MPID_nem_cell_rel_ptr 
    169170{ 
     
    181182{ 
    182183    MPID_nem_cell_rel_ptr_t next; 
     184#if MPID_NEM_CELL_HEAD_LEN != SIZEOF_VOID_P 
    183185    char padding[MPID_NEM_CELL_HEAD_LEN - sizeof(MPID_nem_cell_rel_ptr_t)]; 
     186#endif 
    184187    MPID_nem_pkt_t pkt; 
    185188} MPID_nem_cell_t; 
     
    189192{ 
    190193    struct MPID_nem_abs_cell *next; 
     194#if MPID_NEM_CELL_HEAD_LEN != SIZEOF_VOID_P 
    191195    char padding[MPID_NEM_CELL_HEAD_LEN - sizeof(struct MPID_nem_abs_cell*)]; 
     196#endif 
    192197    volatile MPID_nem_pkt_t pkt; 
    193198} MPID_nem_abs_cell_t; 
     
    214219    volatile MPID_nem_cell_rel_ptr_t head; 
    215220    volatile MPID_nem_cell_rel_ptr_t tail; 
     221#if MPID_NEM_CACHE_LINE_LEN != (2 * SIZEOF_VOID_P) 
    216222    char padding1[MPID_NEM_CACHE_LINE_LEN - 2 * sizeof(MPID_nem_cell_rel_ptr_t)]; 
     223#endif 
    217224    MPID_nem_cell_rel_ptr_t my_head; 
     225#if MPID_NEM_CACHE_LINE_LEN != SIZEOF_VOID_P 
    218226    char padding2[MPID_NEM_CACHE_LINE_LEN - sizeof(MPID_nem_cell_rel_ptr_t)]; 
     227#endif 
    219228} MPID_nem_queue_t, *MPID_nem_queue_ptr_t; 
    220229 
     
    223232{ 
    224233    volatile int value; 
     234#if MPID_NEM_CACHE_LINE_LEN != 0 
    225235    char padding[MPID_NEM_CACHE_LINE_LEN]; 
     236#endif 
    226237} 
    227238MPID_nem_opt_volint_t; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_defs.h

    r3189 r3217  
    9797    volatile int usage_cnt; 
    9898    volatile int cnt; 
     99#if MPID_NEM_CACHE_LINE_LEN != SIZEOF_INT 
    99100    char padding0[MPID_NEM_CACHE_LINE_LEN - sizeof(int)]; 
     101#endif 
    100102    volatile int sig0; 
    101103    volatile int sig; 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_init.c

    r3189 r3217  
    7474    MPIU_Assert(sizeof(MPIDI_CH3_nem_pkt_t) <= sizeof(MPIDI_CH3_PktGeneric_t)); 
    7575 
     76    /* The MPID_nem_cell_rel_ptr_t defined in mpid_nem_datatypes.h 
     77     * should only contain a pointer. Also, we don't support compilers 
     78     * which add random padding to the start of the structure. The 
     79     * below assert should blow up if any of these happens. */ 
     80    MPIU_Assert(sizeof(MPID_nem_cell_rel_ptr_t) == SIZEOF_VOID_P); 
     81 
    7682    /* Make sure the cell structure looks like it should */ 
    7783    MPIU_Assert(MPID_NEM_CELL_PAYLOAD_LEN + MPID_NEM_CELL_HEAD_LEN == sizeof(MPID_nem_cell_t));