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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/src-portals/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
/* ---------------------------------------------------------------------------------------------- *\
 
2
   portals.h header
 
3
\* ---------------------------------------------------------------------------------------------- */
 
4
 # ifndef _PORTALS_H_
 
5
 # define _PORTALS_H_
 
6
 
 
7
 # define PORTALS_INDEX    1
 
8
 
 
9
 # define ONE_KB 1024
 
10
 # define ONE_MB 1048576
 
11
 
 
12
 # define MAX_DS_MSG_SIZE ONE_MB
 
13
 
 
14
 # define PORTALS_MAX_DESCRIPTORS (MAX_BUFS+MAX_SMALL_BUFS)
 
15
 # define PORTALS_MAX_BUFS        MAX_BUFS
 
16
 # define PORTALS_MAX_SMALL_BUFS  MAX_SMALL_BUFS
 
17
 # define PORTALS_BUF_SIZE        MSG_BUFLEN                 /* defined in requesh.h */
 
18
 
 
19
/* define small buf length here - formerly request.h */
 
20
 # ifdef PORTALS_USE_RENDEZ_VOUS
 
21
 #  define PORTALS_SMALL_BUF_SIZE   1024 /* for use with nwchem only -- will not pass armci test.x */
 
22
 #  define PORTALS_MAX_EAGER_MESSAGE_SIZE PORTALS_SMALL_BUF_SIZE
 
23
 # else
 
24
 #  define PORTALS_SMALL_BUF_SIZE  1024
 
25
 #  define PORTALS_MAX_EAGER_MESSAGE_SIZE PORTALS_BUF_SIZE
 
26
 # endif
 
27
 
 
28
 # define PORTALS_NREQUEST_BUFFERS 40
 
29
 # define PORTALS_REQUEST_BUFFER_SIZE_WARNING (128*ONE_MB)
 
30
 
 
31
 # define PORTALS_READ_ACCESS     1
 
32
 # define PORTALS_WRITE_ACCESS 1000
 
33
 
 
34
 # define MATCH_ALL_MBITS     0x8000000000000000 /* should be set for all data requests */
 
35
 # define MATCH_ALL_IBITS     ~MATCH_ALL_MBITS   /* used to mask out all other bits, but MATCH_ALL */
 
36
 
 
37
 
 
38
 # define STATE_SEND_START        0x1
 
39
 # define STATE_SEND_END          0x2
 
40
 # define STATE_REPLY_START       0x4
 
41
 # define STATE_REPLY_END         0x8
 
42
 # define STATE_ACK               0x10
 
43
 # define STATE_PUT_START         0x20
 
44
 # define STATE_PUT_END           0x40
 
45
 # define STATE_GET_START         0x80
 
46
 # define STATE_GET_END           0x100
 
47
 # define STATE_UNLINK            0x200
 
48
 
 
49
 
 
50
 # define DS_RESPONSE_ACK         0x100000000000000
 
51
 # define DS_RESPONSE_PUT         0x200000000000000
 
52
 # define DS_RESPONSE_GET         0x400000000000000
 
53
 
 
54
 # define PORTALS_ALLOW_NBGETS
 
55
 # define PORTALS_USE_ARMCI_CLIENT_BUFFERS
 
56
 
 
57
 # define PORTALS_PUT_USE_ACK_TURNED_OFF
 
58
 # define PORTALS_PUT_USE_START_TURNED_OFF
 
59
 # define PORTALS_GET_USE_START_TURNED_OFF
 
60
 
 
61
/* ---------------------------------------------------------------------------------------------- *\
 
62
   portals types
 
63
\* ---------------------------------------------------------------------------------------------- */
 
64
   typedef struct portals_desc_s {
 
65
      void*             buffer; // used for the md
 
66
      ptl_size_t        length; // used for the md
 
67
      ptl_process_id_t  id;     // on whom the operation is acting on
 
68
      ptl_match_bits_t  mbits;  // operations destination mbits
 
69
      ptl_hdr_data_t    hdr;    // used for puts/unique counter value
 
70
 
 
71
      ptl_handle_ni_t   nih;    // network interface handle
 
72
      ptl_handle_eq_t   eqh;    // event handler
 
73
      ptl_handle_me_t   meh;    // me handle (if necessary)
 
74
      ptl_handle_md_t   mdh;    // md handle (if necessary)
 
75
 
 
76
      int               state;  // track outstanding events remaining on the descriptor
 
77
      int               done;   // flag to test whether all work on the descriptor is finished
 
78
      int               noperations; // the number of remote operations allowed on buffer
 
79
                                     // this is only used when preposting/pinning CP memory
 
80
                                     // for remote operations initiated by the data server
 
81
   } portals_desc_t;
 
82
 
 
83
 
 
84
   typedef struct portals_ds_req_s {
 
85
      portals_desc_t req_desc;
 
86
      portals_desc_t ack_desc;
 
87
      portals_desc_t data_desc;
 
88
      ptl_process_id_t dsid;
 
89
      size_t unique_msg_id;
 
90
      int active;
 
91
      int remote_node;
 
92
   } portals_ds_req_t;
 
93
 
 
94
 
 
95
/* ---------------------------------------------------------------------------------------------- *\
 
96
   portals global variables
 
97
\* ---------------------------------------------------------------------------------------------- */
 
98
   /*ptl_handle_ni_t   cp_nih;*/
 
99
   /*ptl_handle_ni_t   ds_nih;*/
 
100
   /*ptl_handle_eq_t   cp_eqh;*/
 
101
   /*ptl_handle_eq_t   ds_eqh;*/
 
102
   ptl_process_id_t *portals_id_map;
 
103
   ptl_process_id_t *portals_cloned_id_map;
 
104
 
 
105
   int portals_ds_ready;
 
106
   int portals_cp_finished;
 
107
 
 
108
   size_t portalsMaxEagerMessageSize;
 
109
 
 
110
 
 
111
/* ---------------------------------------------------------------------------------------------- *\
 
112
   portals prototypes
 
113
\* ---------------------------------------------------------------------------------------------- */
 
114
   int portals_init(ptl_handle_ni_t*);
 
115
   int portals_finalize(ptl_handle_ni_t);
 
116
   int portals_getid(ptl_handle_ni_t,ptl_process_id_t *);
 
117
   int portals_free_eq(ptl_handle_eq_t);
 
118
   int portals_create_eq(ptl_handle_ni_t, ptl_size_t, ptl_handle_eq_t*);
 
119
   int portals_create_matchall_me(ptl_handle_me_t*);
 
120
   int portals_me_attach(ptl_handle_ni_t,ptl_process_id_t,ptl_match_bits_t,ptl_match_bits_t,ptl_handle_me_t*);
 
121
   int portals_me_insert(ptl_handle_me_t,ptl_process_id_t,ptl_match_bits_t,ptl_match_bits_t,ptl_handle_me_t*);
 
122
   int portals_me_unlink(ptl_handle_me_t);
 
123
   int portals_md_attach(ptl_handle_me_t,ptl_md_t,ptl_unlink_t,ptl_handle_md_t*);
 
124
   int portals_md_bind(ptl_handle_ni_t,ptl_md_t,ptl_unlink_t,ptl_handle_md_t*);
 
125
 
 
126
   int portals_eqwait(ptl_handle_eq_t,ptl_event_t*);
 
127
   int portals_put(portals_desc_t*);
 
128
   int portals_get(portals_desc_t*);
 
129
   int portals_wait(portals_desc_t*);
 
130
 
 
131
 
 
132
   void* portalsCloneDataServer(void *(*func)(void*));
 
133
   void  portalsSpinLockOnInt(volatile int*, int, int);
 
134
 
 
135
   void portals_print_event_details(ptl_event_t *ev);
 
136
 
 
137
   void Fatal_error(int);
 
138
   const char *Portals_ID();
 
139
 
 
140
   void bit_print(const char *,int);
 
141
   void hex_print(const char *,int);
 
142
   void portals_print_summary();
 
143
 
 
144
/* ---------------------------------------------------------------------------------------------- *\
 
145
   portals data server prototypes
 
146
\* ---------------------------------------------------------------------------------------------- */
 
147
   void* portals_ds_thread(void* args);
 
148
   int portals_ds_init(void);
 
149
   int portals_ds(void);
 
150
   int portal_send_test_ack(int to,int val);
 
151
   int portals_ds_requeue_md(int);
 
152
 
 
153
   void portals_ds_get_from_cp(void*,ptl_size_t,ptl_process_id_t,ptl_match_bits_t);
 
154
 
 
155
   //void ds_handler(DDI_Patch*,ptl_process_id_t);
 
156
 
 
157
/* ---------------------------------------------------------------------------------------------- *\
 
158
   portals compute process prototypes
 
159
\* ---------------------------------------------------------------------------------------------- */
 
160
   int portals_cp_init(void);
 
161
   int portals_cp_getid(ptl_process_id_t *id);
 
162
 
 
163
   void portals_req_send(void *buffer, size_t size, portals_ds_req_t *req);
 
164
   void portals_req_nbsend(void *buffer, size_t size, portals_ds_req_t *req);
 
165
   void portals_req_wait(portals_ds_req_t *req);
 
166
 
 
167
   void portals_remote_get(void *buffer, request_header_t *msginfo, int remote_node);
 
168
   void portals_remote_put(void *buffer, request_header_t *msginfo, int remote_node);
 
169
   void portals_remote_acc(void *buffer, request_header_t *msginfo, int remote_node);
 
170
   void portals_remote_rmw(void *buffer, request_header_t *msginfo, int remote_node, portals_ds_req_t *req);
 
171
   void portals_remote_nbget(void *buffer, request_header_t *msginfo, int remote_node, portals_ds_req_t *req);
 
172
   void portals_remote_nbput(void *buffer, request_header_t *msginfo, int remote_node, portals_ds_req_t *req);
 
173
   void portals_remote_nbacc(void *buffer, request_header_t *msginfo, int remote_node, portals_ds_req_t *req);
 
174
 
 
175
 
 
176
   void portalsRemoteOperation(void*,size_t,ptl_process_id_t,portals_ds_req_t*);
 
177
   void portalsRemoteOperationToRank(void*,size_t,int,portals_ds_req_t*);
 
178
   void portalsRemoteOperationToNode(void*,size_t,int,portals_ds_req_t*);
 
179
 
 
180
   void portalsBlockingRemoteOperationToNode(void*,size_t,int);
 
181
 
 
182
 
 
183
static inline unsigned int cpuid_ebx(unsigned int op)
 
184
{
 
185
        unsigned int eax, ebx;
 
186
 
 
187
        __asm__("cpuid"
 
188
                : "=a" (eax), "=b" (ebx)
 
189
                : "0" (op)
 
190
                : "cx", "dx" );
 
191
        return ebx;
 
192
}
 
193
 
 
194
 # endif