~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/mpid/pamid/src/mpid_request.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
 
40
40
extern MPIU_Object_alloc_t MPID_Request_mem;
41
 
 
 
41
#if TOKEN_FLOW_CONTROL
 
42
extern void MPIDI_mm_free(void *,size_t);
 
43
#endif
 
44
typedef enum {mpiuMalloc=1,mpidiBufMM} MPIDI_mallocType;
42
45
 
43
46
void    MPIDI_Request_uncomplete(MPID_Request *req);
44
47
#if (MPIU_HANDLE_ALLOCATION_METHOD == MPIU_HANDLE_ALLOCATION_THREAD_LOCAL) && defined(__BGQ__)
132
135
 
133
136
#endif
134
137
 
 
138
#ifdef HAVE_DEBUGGER_SUPPORT
 
139
#define MPIDI_Request_clear_dbg(req_) ((req_)->dbg_next = NULL)
 
140
#else
 
141
#define MPIDI_Request_clear_dbg(req_)
 
142
#endif
135
143
 
136
144
/**
137
145
 * \brief Create a very generic request
154
162
  memset(&req->mpid, 0xFFFFFFFF, sizeof(struct MPIDI_Request));
155
163
#endif
156
164
  req->mpid.next = NULL;
 
165
  MPIDI_Request_clear_dbg(req);
157
166
 
158
167
  return req;
159
168
}
181
190
{
182
191
  req->greq_fns          = NULL;
183
192
 
184
 
  req->status.count      = 0;
185
 
  req->status.cancelled  = FALSE;
 
193
  MPIR_STATUS_SET_COUNT(req->status, 0);
 
194
  MPIR_STATUS_SET_CANCEL_BIT(req->status, FALSE);
186
195
  req->status.MPI_SOURCE = MPI_UNDEFINED;
187
196
  req->status.MPI_TAG    = MPI_UNDEFINED;
188
197
  req->status.MPI_ERROR  = MPI_SUCCESS;
200
209
  mpid->nextR            = NULL;
201
210
  mpid->oo_peer          = NULL;
202
211
#endif
 
212
  mpid->win_req          = NULL;
203
213
  MPIDI_Request_setCA(req, MPIDI_CA_COMPLETE);
204
214
}
205
215
 
256
266
  MPIU_Object_release_ref(req, &count);
257
267
  MPID_assert(count >= 0);
258
268
 
 
269
 
259
270
  if (count == 0)
260
271
  {
261
272
    MPID_assert(MPID_cc_is_complete(&req->cc));
263
274
    if (req->comm)              MPIR_Comm_release(req->comm, 0);
264
275
    if (req->greq_fns)          MPIU_Free(req->greq_fns);
265
276
    if (req->mpid.datatype_ptr) MPID_Datatype_release(req->mpid.datatype_ptr);
266
 
    if (req->mpid.uebuf_malloc) MPIU_Free(req->mpid.uebuf);
 
277
    if (req->mpid.uebuf_malloc== mpiuMalloc) {
 
278
        MPIU_Free(req->mpid.uebuf);
 
279
    }
 
280
    if(req->mpid.win_req)       MPIU_Free(req->mpid.win_req);
 
281
#if TOKEN_FLOW_CONTROL
 
282
    else if (req->mpid.uebuf_malloc == mpidiBufMM) {
 
283
        MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
 
284
        MPIDI_mm_free(req->mpid.uebuf,req->mpid.uebuflen);
 
285
        MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
 
286
    }
 
287
#endif
267
288
    MPIDI_Request_tls_free(req);
268
289
  }
269
290
}
273
294
static inline void
274
295
MPID_Request_discard_inline(MPID_Request *req)
275
296
{
276
 
    if (req->mpid.uebuf_malloc) MPIU_Free(req->mpid.uebuf);
 
297
    if (req->mpid.uebuf_malloc == mpiuMalloc) {
 
298
        MPIU_Free(req->mpid.uebuf);
 
299
    }
 
300
#if TOKEN_FLOW_CONTROL
 
301
    else if (req->mpid.uebuf_malloc == mpidiBufMM) {
 
302
        MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
 
303
        MPIDI_mm_free(req->mpid.uebuf,req->mpid.uebuflen);
 
304
        MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
 
305
    }
 
306
#endif
277
307
    MPIDI_Request_tls_free(req);
278
308
}
279
309
 
280
310
#define MPID_REQUEST_SET_COMPLETED(req_) \
281
 
  MPIDI_Request_complete_inline(req_)
 
311
  MPIDI_Request_complete_norelease_inline(req_)
282
312
 
283
313
static inline void
284
314
MPIDI_Request_complete_inline(MPID_Request *req)