~james-page/ubuntu/precise/openmpi1.5/new

« back to all changes in this revision

Viewing changes to ompi/mca/pml/csum/pml_csum_progress.c

  • Committer: Bazaar Package Importer
  • Author(s): Manuel Prinz
  • Date: 2009-04-23 14:01:21 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090423140121-vsi3pqa6g30j4qiy
Tags: 1.3.2-1
* New upstream release. (Closes: #520597, #515116)
  - Manpage and VampirTrace patches removed, included upstream.
* Fixed build issues on Alpha. Huge thanks to Arthur Loiret for providing
  access to his machines for testing! (Closes: #510845, #517543)
* Fixed build issues on Sparc. (Closes: #519725)
* Fixed manpage-has-errors-from-man lintian warnings.
* Faked SONAME change by renaming library package. (Closes: #512616)
* Made libopenmpi-dev depend on libibverbs-dev. (Closes: #522153)
* Support for "nocheck" build option in debian/rules.
* Updated Standards-Version in debian/control.
* Changed section of libopenmpi-dbg to "debug".
* Updated debian/copyright.

* Dirk Eddelbuettel removed himself from Uploaders. The team thanks Dirk
  for his long-term contribution and effort to get Open MPI back to life.
  I personally thank Dirk for encouraging me to become a Debian Developer
  and his support and mentoring on that way and beyond.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 
3
 *                         University Research and Technology
 
4
 *                         Corporation.  All rights reserved.
 
5
 * Copyright (c) 2004-2008 The University of Tennessee and The University
 
6
 *                         of Tennessee Research Foundation.  All rights
 
7
 *                         reserved.
 
8
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
 
9
 *                         University of Stuttgart.  All rights reserved.
 
10
 * Copyright (c) 2004-2005 The Regents of the University of California.
 
11
 *                         All rights reserved.
 
12
 * $COPYRIGHT$
 
13
 * 
 
14
 * Additional copyrights may follow
 
15
 * 
 
16
 * $HEADER$
 
17
 */
 
18
 
 
19
#include "ompi_config.h"
 
20
 
 
21
#include "pml_csum.h"
 
22
#include "pml_csum_sendreq.h"
 
23
#include "ompi/mca/bml/base/base.h" 
 
24
 
 
25
int mca_pml_csum_progress(void)
 
26
{
 
27
    int i, queue_length = opal_list_get_size(&mca_pml_csum.send_pending);
 
28
    int j, completed_requests = 0;
 
29
    bool send_succedded;
 
30
 
 
31
    if( OPAL_LIKELY(0 == queue_length) )
 
32
        return 0;
 
33
 
 
34
    for( i = 0; i < queue_length; i++ ) {
 
35
        mca_pml_csum_send_pending_t pending_type = MCA_PML_CSUM_SEND_PENDING_NONE;
 
36
        mca_pml_csum_send_request_t* sendreq;
 
37
        mca_bml_base_endpoint_t* endpoint;
 
38
 
 
39
        sendreq = get_request_from_send_pending(&pending_type);
 
40
        if(OPAL_UNLIKELY(NULL == sendreq))
 
41
            break;
 
42
 
 
43
        switch(pending_type) {
 
44
        case MCA_PML_CSUM_SEND_PENDING_NONE:
 
45
            assert(0);
 
46
            return 0;
 
47
        case MCA_PML_CSUM_SEND_PENDING_SCHEDULE:
 
48
            if( mca_pml_csum_send_request_schedule_exclusive(sendreq) ==
 
49
                OMPI_ERR_OUT_OF_RESOURCE ) {
 
50
                return 0;
 
51
            }
 
52
            completed_requests++;
 
53
            break;
 
54
        case MCA_PML_CSUM_SEND_PENDING_START:
 
55
            endpoint = sendreq->req_endpoint;
 
56
            send_succedded = false;
 
57
            for(j = 0; j < (int)mca_bml_base_btl_array_get_size(&endpoint->btl_eager); j++) {
 
58
                mca_bml_base_btl_t* bml_btl;
 
59
                int rc;
 
60
                
 
61
                /* select a btl */
 
62
                bml_btl = mca_bml_base_btl_array_get_next(&endpoint->btl_eager);
 
63
                rc = mca_pml_csum_send_request_start_btl(sendreq, bml_btl);
 
64
                if( OPAL_LIKELY(OMPI_SUCCESS == rc) ) {
 
65
                    send_succedded = true;
 
66
                    completed_requests++;
 
67
                    break;
 
68
                }
 
69
            }
 
70
            if( false == send_succedded ) {
 
71
                add_request_to_send_pending(sendreq, MCA_PML_CSUM_SEND_PENDING_START, true);
 
72
            }
 
73
        }
 
74
    }
 
75
    return completed_requests;
 
76
}
 
77