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

« back to all changes in this revision

Viewing changes to src/mpi/debugger/dbginit.c

  • 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:
11
11
#include <unistd.h>
12
12
#endif
13
13
 
 
14
/*
 
15
=== BEGIN_MPI_T_CVAR_INFO_BLOCK ===
 
16
 
 
17
cvars:
 
18
    - name        : MPIR_CVAR_PROCTABLE_SIZE
 
19
      category    : DEBUGGER
 
20
      type        : int
 
21
      default     : 64
 
22
      class       : device
 
23
      verbosity   : MPI_T_VERBOSITY_USER_BASIC
 
24
      scope       : MPI_T_SCOPE_ALL_EQ
 
25
      description : >-
 
26
        Size of the "MPIR" debugger interface proctable (process table).
 
27
 
 
28
    - name        : MPIR_CVAR_PROCTABLE_PRINT
 
29
      category    : DEBUGGER
 
30
      type        : boolean
 
31
      default     : false
 
32
      class       : device
 
33
      verbosity   : MPI_T_VERBOSITY_USER_BASIC
 
34
      scope       : MPI_T_SCOPE_ALL_EQ
 
35
      description : >-
 
36
        If true, dump the proctable entries at MPIR_WaitForDebugger-time.
 
37
 
 
38
=== END_MPI_T_CVAR_INFO_BLOCK ===
 
39
*/
 
40
 
14
41
/* There are two versions of the debugger startup:
15
42
   1. The debugger starts mpiexec - then mpiexec provides the MPIR_proctable
16
43
      information
170
197
       to access this. */
171
198
    /* Also, to avoid scaling problems, we only populate the first 64
172
199
       entries (default) */
173
 
    maxsize = MPIR_PARAM_PROCTABLE_SIZE;
 
200
    maxsize = MPIR_CVAR_PROCTABLE_SIZE;
174
201
    if (maxsize > size) maxsize = size;
175
202
 
176
203
    if (rank == 0) {
203
230
        }
204
231
 
205
232
        MPIR_proctable_size               = size;
206
 
#if 0
207
233
        /* Debugging hook */
208
 
        if (MPIR_PARAM_PROCTABLE_PRINT) {
 
234
        if (MPIR_CVAR_PROCTABLE_PRINT) {
209
235
            for (i=0; i<maxsize; i++) {
210
236
                printf( "PT[%d].pid = %d, .host_name = %s\n", 
211
237
                        i, MPIR_proctable[i].pid, MPIR_proctable[i].host_name );
212
238
            }
213
239
            fflush( stdout );
214
240
        }
215
 
#endif
216
241
        MPIR_Add_finalize( MPIR_FreeProctable, MPIR_proctable, 0 );
217
242
    }
218
243
    else {
296
321
 * (more specifically, requests created with MPI_Isend, MPI_Issend, or 
297
322
 * MPI_Irsend).
298
323
 *
299
 
 * FIXME: We need to add MPI_Ibsend and the persistent send requests to
300
 
 * the known send requests.
301
324
 * FIXME: We should exploit this to allow Finalize to report on 
302
325
 * send requests that were never completed.
303
326
 */
309
332
    MPID_Request *sreq;
310
333
    int tag, rank, context_id;
311
334
    struct MPIR_Sendq *next;
 
335
    struct MPIR_Sendq *prev;
312
336
} MPIR_Sendq;
313
337
 
314
338
MPIR_Sendq *MPIR_Sendq_head = 0;
333
357
        p = (MPIR_Sendq *)MPIU_Malloc( sizeof(MPIR_Sendq) );
334
358
        if (!p) {
335
359
            /* Just ignore it */
 
360
            req->dbg_next = NULL;
336
361
            goto fn_exit;
337
362
        }
338
363
    }
341
366
    p->rank       = rank;
342
367
    p->context_id = context_id;
343
368
    p->next       = MPIR_Sendq_head;
 
369
    p->prev       = NULL;
344
370
    MPIR_Sendq_head = p;
 
371
    if (p->next) p->next->prev = p;
 
372
    req->dbg_next = p;
345
373
fn_exit:
346
374
    MPIU_THREAD_CS_EXIT(HANDLE,req);
347
375
}
351
379
    MPIR_Sendq *p, *prev;
352
380
 
353
381
    MPIU_THREAD_CS_ENTER(HANDLE,req);
354
 
    p    = MPIR_Sendq_head;
355
 
    prev = 0;
356
 
 
357
 
    while (p) {
358
 
        if (p->sreq == req) {
359
 
            if (prev) prev->next = p->next;
360
 
            else MPIR_Sendq_head = p->next;
361
 
            /* Return this element to the pool */
362
 
            p->next = pool;
363
 
            pool    = p;
364
 
            break;
365
 
        }
366
 
        prev = p;
367
 
        p    = p->next;
 
382
    p    = req->dbg_next;
 
383
    if (!p) {
 
384
        /* Just ignore it */
 
385
        MPIU_THREAD_CS_EXIT(HANDLE,req);
 
386
        return;
368
387
    }
369
 
    /* If we don't find the request, just ignore it */
 
388
    prev = p->prev;
 
389
    if (prev != NULL) prev->next = p->next;
 
390
    else MPIR_Sendq_head = p->next;
 
391
    if (p->next != NULL) p->next->prev = prev;
 
392
    /* Return this element to the pool */
 
393
    p->next = pool;
 
394
    pool    = p;
370
395
    MPIU_THREAD_CS_EXIT(HANDLE,req);
371
396
}
372
397