~ubuntu-branches/ubuntu/hardy/openmpi/hardy-updates

« back to all changes in this revision

Viewing changes to orte/mca/pls/base/base.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-10-15 00:46:11 UTC
  • Revision ID: james.westby@ubuntu.com-20061015004611-uuhxnaxyjmuxfd5h
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
 
3
 *                         University Research and Technology
 
4
 *                         Corporation.  All rights reserved.
 
5
 * Copyright (c) 2004-2005 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
/** @file:
 
19
 */
 
20
 
 
21
#ifndef MCA_PLS_BASE_H
 
22
#define MCA_PLS_BASE_H
 
23
 
 
24
/*
 
25
 * includes
 
26
 */
 
27
#include "orte_config.h"
 
28
#include "opal/mca/mca.h"
 
29
#include "orte/mca/pls/pls.h"
 
30
#include "orte/mca/ras/base/ras_base_node.h"
 
31
 
 
32
 
 
33
#if defined(c_plusplus) || defined(__cplusplus)
 
34
extern "C" {
 
35
#endif
 
36
 
 
37
    /**
 
38
     * Struct to hold data globale to the pls framework
 
39
     */
 
40
    typedef struct orte_pls_base_t {
 
41
        /** Verbose/debug output stream */
 
42
        int pls_output;
 
43
        /** List of opened components */
 
44
        opal_list_t pls_opened;
 
45
        /** Whether the list of opened components is valid */
 
46
        bool pls_opened_valid;
 
47
        /** Sorted list of available components (highest priority first) */
 
48
        opal_list_t pls_available;
 
49
        /** Whether the list of available components is valid */
 
50
        bool pls_available_valid;
 
51
    } orte_pls_base_t;
 
52
    
 
53
    /**
 
54
     * Global instance of pls-wide framework data
 
55
     */
 
56
    OMPI_DECLSPEC extern orte_pls_base_t orte_pls_base;
 
57
 
 
58
    /**
 
59
     * pls component/module/priority tuple
 
60
     */
 
61
    struct orte_pls_base_cmp_t {
 
62
        /** Base object */
 
63
        opal_list_item_t super;
 
64
        /** pls component */
 
65
        orte_pls_base_component_t *component;
 
66
        /** pls module */
 
67
        orte_pls_base_module_t* module;
 
68
        /** This component's priority */
 
69
        int priority;
 
70
    };
 
71
    /** Convenience typedef */
 
72
    typedef struct orte_pls_base_cmp_t orte_pls_base_cmp_t;
 
73
    /** Class declaration */
 
74
    OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_pls_base_cmp_t);
 
75
 
 
76
    /*
 
77
     * Global functions for MCA overall collective open and close
 
78
     */
 
79
 
 
80
    /**
 
81
     * Open the pls framework
 
82
     */
 
83
    OMPI_DECLSPEC int orte_pls_base_open(void);
 
84
    /**
 
85
     * Select a pls module
 
86
     */
 
87
    OMPI_DECLSPEC orte_pls_base_module_t *orte_pls_base_select(char *preferred);
 
88
    /**
 
89
     * Close the pls framework
 
90
     */
 
91
    OMPI_DECLSPEC int orte_pls_base_finalize(void);
 
92
    OMPI_DECLSPEC int orte_pls_base_close(void);
 
93
    /**
 
94
     * Utility routine to get/set procesS pid
 
95
     */
 
96
    OMPI_DECLSPEC int orte_pls_base_set_proc_pid(const orte_process_name_t*, pid_t);
 
97
    OMPI_DECLSPEC int orte_pls_base_get_proc_pid(const orte_process_name_t*, pid_t*);
 
98
    /**
 
99
     * Utility routine to retreive all process pids w/in a specified job.
 
100
     */
 
101
    OMPI_DECLSPEC int orte_pls_base_get_proc_pids(orte_jobid_t jobid, pid_t** pids, size_t* num_pids);
 
102
    /**
 
103
     * Utility routine to get/set daemon pid
 
104
     */
 
105
    OMPI_DECLSPEC int orte_pls_base_set_node_pid(orte_cellid_t cellid, char* node_name, orte_jobid_t jobid, pid_t pid);
 
106
    OMPI_DECLSPEC int orte_pls_base_get_node_pids(orte_jobid_t jobid, pid_t** pids, size_t* num_pids);
 
107
  
 
108
    /**
 
109
     * Utility routine to set progress engine schedule
 
110
     */
 
111
    OMPI_DECLSPEC int orte_pls_base_set_progress_sched(int sched);
 
112
 
 
113
 
 
114
    /**
 
115
     * Utilities for pls components that use proxy daemons
 
116
     */
 
117
    int orte_pls_base_proxy_set_node_name(orte_ras_node_t* node, 
 
118
                                          orte_jobid_t jobid, 
 
119
                                          orte_process_name_t* name);
 
120
    int orte_pls_base_proxy_mca_argv(int *argc, char ***argv);
 
121
    int orte_pls_base_proxy_terminate_job(orte_jobid_t jobid);
 
122
    int orte_pls_base_proxy_terminate_proc(const orte_process_name_t *proc);
 
123
 
 
124
    /**
 
125
     * Check that the cwd in an app context exists and is accessible.
 
126
     * If the user specified the cwd and we can chdir to it, print an
 
127
     * error and fail.  If the user didn't specify it (i.e., it's a
 
128
     * default), then see if chdir($HOME) would succeed.
 
129
     *
 
130
     * If either chdir() would succeed and do_chdir is true, then
 
131
     * actually do the chdir().
 
132
     *
 
133
     * If we fall back to the chdir($HOME), set context->cwd to be a
 
134
     * string pointing to the home directory name (owned by the
 
135
     * context; safe to free at destruction).
 
136
     */
 
137
    int orte_pls_base_check_context_cwd(orte_app_context_t *context,
 
138
                                        bool do_chdir);
 
139
 
 
140
    /**
 
141
     * Check that the app exists and is executable.  If it is not,
 
142
     * print and error and fail.  If it is, and if the app was a naked
 
143
     * executable (i.e., no relative or absolute path), replace the
 
144
     * app with the string containing the absolute pathname to the
 
145
     * exectuable (owned by the context; safe to free at destruction).
 
146
     */
 
147
    int orte_pls_base_check_context_app(orte_app_context_t *context);
 
148
#if defined(c_plusplus) || defined(__cplusplus)
 
149
}
 
150
#endif
 
151
#endif