~ubuntu-branches/ubuntu/saucy/nwchem/saucy

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/src-portals/armci_portals.h

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2012-02-09 20:02:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120209200241-jgk03qfsphal4ug2
Tags: 6.1-1
* New upstream release.

[ Michael Banck ]
* debian/patches/02_makefile_flags.patch: Updated.
* debian/patches/02_makefile_flags.patch: Use internal blas and lapack code.
* debian/patches/02_makefile_flags.patch: Define GCC4 for LINUX and LINUX64
  (Closes: #632611 and LP: #791308).
* debian/control (Build-Depends): Added openssh-client.
* debian/rules (USE_SCALAPACK, SCALAPACK): Removed variables (Closes:
  #654658).
* debian/rules (LIBDIR, USE_MPIF4, ARMCI_NETWORK): New variables.
* debian/TODO: New file.
* debian/control (Build-Depends): Removed libblas-dev, liblapack-dev and
  libscalapack-mpi-dev.
* debian/patches/04_show_testsuite_diff_output.patch: New patch, shows the
  diff output for failed tests.
* debian/patches/series: Adjusted.
* debian/testsuite: Optionally run all tests if "all" is passed as option.
* debian/rules: Run debian/testsuite with "all" if DEB_BUILD_OPTIONS
  contains "checkall".

[ Daniel Leidert ]
* debian/control: Used wrap-and-sort. Added Vcs-Svn and Vcs-Browser fields.
  (Priority): Moved to extra according to policy section 2.5.
  (Standards-Version): Bumped to 3.9.2.
  (Description): Fixed a typo.
* debian/watch: Added.
* debian/patches/03_hurd-i386_define_path_max.patch: Added.
  - Define MAX_PATH if not defines to fix FTBFS on hurd.
* debian/patches/series: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ARMCI_PORTALS_H
 
2
#define ARMCI_PORTALS_H
 
3
 
 
4
/* portals header file */
 
5
 
 
6
#include <portals/portals3.h>
 
7
#include <portals/nal.h>
 
8
#include <mpi.h>
 
9
 
 
10
#define NUM_COMP_DSCR 4
 
11
 
 
12
#define ARMCI_PORTALS_PTL_NUMBER 37
 
13
 
 
14
#define HAS_RDMA_GET
 
15
#define NUM_SERV_BUFS 1
 
16
 
 
17
/*corresponds to num of different armci mem regions*/
 
18
#define MAX_MEM_REGIONS 10
 
19
 
 
20
#define VBUF_DLEN_ORG 4*64*1024
 
21
#define VBUF_DLEN 16*1024
 
22
#define MSG_BUFLEN_DBL_VT ((VBUF_DLEN)>>3)
 
23
 
 
24
/* VBUF_DLEN are only used in Vinod's code */
 
25
 
 
26
#ifdef PORTALS_USE_RENDEZ_VOUS
 
27
#  define MSG_BUFLEN_DBL   262144 /* for rendez-vous, this can go bigger i think */ 
 
28
#else
 
29
#  define MSG_BUFLEN_DBL     1280 /* this is smaller when rendez-vous is off */
 
30
#endif
 
31
 
 
32
 
 
33
 
 
34
#define ARMCI_NET_ERRTOSTR(__ARMCI_ERC_) ptl_err_str[__ARMCI_ERC_]
 
35
 
 
36
typedef enum op {
 
37
        ARMCI_PORTALS_PUT,
 
38
        ARMCI_PORTALS_NBPUT,
 
39
        ARMCI_PORTALS_GET, 
 
40
        ARMCI_PORTALS_NBGET, 
 
41
        ARMCI_PORTALS_ACC,
 
42
        ARMCI_PORTALS_NBACC,
 
43
        ARMCI_PORTALS_GETPUT,
 
44
        ARMCI_PORTALS_NBGETPUT
 
45
} armci_portals_optype;
 
46
 
 
47
typedef struct {
 
48
    void *data_ptr;         /* pointer where the data should go */
 
49
    long ack;               /* header ack */
 
50
    void *ack_ptr;          /* pointer where the data should go */
 
51
    void *user_ptr;
 
52
#if defined(SERV_QUEUE)
 
53
    int imm_msg;
 
54
    size_t data_len;
 
55
#endif
 
56
} msg_tag_t;
 
57
 
 
58
typedef struct armci_portals_desc{
 
59
       int active;
 
60
       int tag;
 
61
       int dest_id;
 
62
       armci_portals_optype type;
 
63
       ptl_md_t mem_dsc;
 
64
       ptl_handle_md_t mem_dsc_hndl;
 
65
       char *bufptr;
 
66
}comp_desc;
 
67
 
 
68
/*for buffers*/
 
69
extern char *armci_portals_client_buf_allocate(int);
 
70
#define BUF_ALLOCATE armci_portals_client_buf_allocate
 
71
#define BUF_EXTRA_FIELD_T comp_desc* 
 
72
 
 
73
#define INIT_SEND_BUF(_field,_snd,_rcv) _snd=1;_rcv=1;_field=NULL
 
74
 
 
75
#define GET_SEND_BUFFER _armci_buf_get
 
76
#define FREE_SEND_BUFFER _armci_buf_release
 
77
 
 
78
#define CLEAR_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op) if((_op==UNLOCK || _op==PUT || ARMCI_ACC(_op)) && _field!=NULL)x_buf_wait_ack((request_header_t *)((void **)&(_field)+1),((char *)&(_field)-sizeof(BUF_INFO_T)));_field=NULL;
 
79
#define TEST_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op,_ret)
 
80
#define COMPLETE_HANDLE _armci_buf_complete_nb_request
 
81
 
 
82
#define NB_CMPL_T comp_desc*
 
83
#define ARMCI_NB_WAIT(_cntr) if(_cntr){\
 
84
        int rc;\
 
85
        if(nb_handle->tag)\
 
86
          if(nb_handle->tag==_cntr->tag)\
 
87
          rc = armci_client_complete(0,nb_handle->proc,nb_handle->tag,_cntr);\
 
88
} else{\
 
89
printf("\n%d:wait null ctr\n",armci_me);}
 
90
 
 
91
#ifndef MAX_DS
 
92
#define MAX_DS 16
 
93
#endif
 
94
 
 
95
/* structure of computing process */
 
96
typedef struct {
 
97
  ptl_pt_index_t ptl;
 
98
  ptl_process_id_t  rank;
 
99
  ptl_handle_ni_t   ni_h; 
 
100
  ptl_handle_eq_t   eq_h;
 
101
  ptl_process_id_t  Srank;
 
102
  ptl_handle_ni_t   Sni_h; 
 
103
  ptl_handle_eq_t   Seq_h;
 
104
  int               outstanding_puts;
 
105
  int               outstanding_gets;
 
106
  ptl_process_id_t  *procid_map;  
 
107
  ptl_process_id_t  *servid_map;  
 
108
  int               free_comp_desc_index;
 
109
  caddr_t           dsbase[MAX_DS];
 
110
  size_t            dssizes[MAX_DS];
 
111
  ptl_match_bits_t  heap_mb[MAX_DS];
 
112
  ptl_md_t          heap_md[MAX_DS];
 
113
  ptl_handle_me_t   heap_me_h[MAX_DS];
 
114
  ptl_handle_md_t   heap_md_h[MAX_DS];
 
115
  void              *brval[MAX_DS];
 
116
  long              serv_offs[MAX_DS];
 
117
  int               cur_ds;
 
118
}armci_portals_proc_t;
 
119
 
 
120
typedef struct {
 
121
  ptl_match_bits_t  mb;
 
122
  ptl_md_t          md;
 
123
  ptl_handle_me_t   me_h;
 
124
  ptl_handle_md_t   md_h;
 
125
}armci_portals_serv_mem_t;
 
126
 
 
127
typedef struct {
 
128
  int               reg_count;
 
129
  int               outstanding_puts;
 
130
  int               outstanding_gets;
 
131
  armci_portals_serv_mem_t meminfo[MAX_MEM_REGIONS];
 
132
}armci_portals_serv_t;
 
133
 
 
134
 
 
135
extern void print_mem_desc_table(void);
 
136
extern int armci_init_portals(caddr_t);
 
137
extern void armci_fini_portals(void);
 
138
extern int armci_post_descriptor(ptl_md_t *md); 
 
139
extern int armci_prepost_descriptor(void* start, long bytes);
 
140
extern ptl_size_t armci_get_offset(ptl_md_t md, void *ptr,int proc);
 
141
extern int armci_get_md(void * start, int bytes , ptl_md_t * md, ptl_match_bits_t * mb);
 
142
extern void armci_portals_put(int,void *,void *,int,void **,int );
 
143
extern void armci_portals_get(int,void *,void *,int,void **,int );
 
144
extern void comp_desc_init();
 
145
extern int armci_client_complete(ptl_event_kind_t evt,int proc_id, int nb_tag ,comp_desc * cdesc);
 
146
extern void armci_portals_memsetup(long);
 
147
 
 
148
extern MPI_Comm portals_smp_comm;
 
149
 
 
150
#endif /* ARMCI_PORTALS_H */