File: base.h

package info (click to toggle)
openmpi 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 99,912 kB
  • ctags: 55,589
  • sloc: ansic: 525,999; f90: 18,307; makefile: 12,062; sh: 6,583; java: 6,278; asm: 3,515; cpp: 2,227; perl: 2,136; python: 1,350; lex: 734; fortran: 52; tcl: 12
file content (89 lines) | stat: -rw-r--r-- 2,247 bytes parent folder | download
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
86
87
88
89
/*
 * Copyright (c) 2012-2013 Los Alamos National Security, Inc.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */
/** @file:
 */

#ifndef ORTE_MCA_DFS_BASE_H
#define ORTE_MCA_DFS_BASE_H

/*
 * includes
 */
#include "orte_config.h"
#include "orte/types.h"
#include "orte/constants.h"

#include "opal/class/opal_list.h"
#include "opal/mca/event/event.h"

#include "orte/mca/mca.h"
#include "orte/mca/dfs/dfs.h"


BEGIN_C_DECLS

/*
 * MCA Framework
 */
ORTE_DECLSPEC extern mca_base_framework_t orte_dfs_base_framework;
/* select a component */
ORTE_DECLSPEC    int orte_dfs_base_select(void);

/* tracker for active files */
typedef struct {
    opal_list_item_t super;
    orte_process_name_t requestor;
    orte_process_name_t host_daemon;
    char *uri;
    char *scheme;
    char *filename;
    int local_fd;
    int remote_fd;
    size_t location;
} orte_dfs_tracker_t;
OBJ_CLASS_DECLARATION(orte_dfs_tracker_t);

/* requests */
typedef struct {
    opal_list_item_t super;
    opal_event_t ev;
    uint64_t id;
    orte_dfs_cmd_t cmd;
    orte_process_name_t target;
    char *uri;
    int local_fd;
    int remote_fd;
    uint8_t *read_buffer;
    long read_length;
    opal_buffer_t *bptr;
    opal_buffer_t bucket;
    orte_dfs_open_callback_fn_t  open_cbfunc;
    orte_dfs_close_callback_fn_t close_cbfunc;
    orte_dfs_size_callback_fn_t  size_cbfunc;
    orte_dfs_seek_callback_fn_t  seek_cbfunc;
    orte_dfs_read_callback_fn_t  read_cbfunc;
    orte_dfs_post_callback_fn_t  post_cbfunc;
    orte_dfs_fm_callback_fn_t    fm_cbfunc;
    orte_dfs_load_callback_fn_t  load_cbfunc;
    orte_dfs_purge_callback_fn_t purge_cbfunc;
    void *cbdata;
} orte_dfs_request_t;
OBJ_CLASS_DECLARATION(orte_dfs_request_t);

#define ORTE_DFS_POST_REQUEST(d, cb)                                    \
    do {                                                                \
        opal_event_set(orte_event_base, &((d)->ev),                     \
                   -1, OPAL_EV_WRITE, (cb), (d));                       \
        opal_event_set_priority(&((d)->ev), ORTE_SYS_PRI);              \
        opal_event_active(&((d)->ev), OPAL_EV_WRITE, 1);                \
    } while(0);

END_C_DECLS

#endif