File: spml_base_request.h

package info (click to toggle)
openmpi 5.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,692 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (85 lines) | stat: -rw-r--r-- 3,038 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2013      Mellanox Technologies, Inc.
 *                         All rights reserved.
 * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
 *                         reserved.
 * Copyright (c) 2015-2016 Research Organization for Information Science
 *                         and Technology (RIST). All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */
/**
 * @file
 */
#ifndef MCA_SPML_BASE_REQUEST_H
#define MCA_SPML_BASE_REQUEST_H

#include "oshmem_config.h"
#include "oshmem/request/request.h" /* TODO: define */

#include "opal/datatype/opal_convertor.h"

#include "opal/class/opal_free_list.h"

BEGIN_C_DECLS

/**
 * External list for the requests. They are declared as lists of
 * the basic request type, which will allow all SPML to overload
 * the list. Beware these free lists have to be initialized
 * directly by the SPML who win the SPML election.
 */
OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_put_requests;
OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_get_requests;
OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_send_requests;
OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_recv_requests;
OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_atomic_requests;

/* TODO: Consider to add requests lists
 * 1. List of Non blocking requests with NULL handle.
 * 2. List of Non blocking request with Non-NULL handle.
 * 3. List of non completed puts (for small msgs).
 */

/**
 * Types of one sided requests.
 */
typedef enum {
    MCA_SPML_REQUEST_NULL,
    MCA_SPML_REQUEST_PUT, /* Put request */
    MCA_SPML_REQUEST_GET, /* Get Request */
    MCA_SPML_REQUEST_SEND, /* Send Request */
    MCA_SPML_REQUEST_RECV, /* Receive Request */
    MCA_SPML_REQUEST_ATOMIC_CAS, /* Atomic Compare-And-Swap request */
    MCA_SPML_REQUEST_ATOMIC_FAAD /* Atomic Fatch-And-Add request */
} mca_spml_base_request_type_t;

/**
 *  Base type for SPML one sided requests
 */
struct mca_spml_base_request_t {

    oshmem_request_t req_oshmem; /**< base request */
    volatile bool req_spml_complete; /**< flag indicating if the one sided layer is done with this request */
    mca_spml_base_request_type_t req_type; /**< SHMEM request type */
    volatile bool req_free_called; /**< flag indicating if the user has freed this request */
    opal_convertor_t req_convertor; /**< always need the convertor */

    void *req_addr; /**< pointer to application buffer */
    size_t req_count; /**< count of user datatype elements *//* TODO: Need to remove since we are going to remove datatype*/
    int32_t req_peer; /**< peer process - rank of process executing the parallel program */
    ompi_proc_t* req_proc; /**< peer process */
    uint64_t req_sequence; /**< sequence number for shmem one sided ordering */
};
typedef struct mca_spml_base_request_t mca_spml_base_request_t;

OSHMEM_DECLSPEC OBJ_CLASS_DECLARATION(mca_spml_base_request_t);

END_C_DECLS

#endif