Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_init.c
Go to the documentation of this file.
1
12/*
13 * Keywords:
14 * Maintainer: Jörg Behrens <behrens@dkrz.de>
15 * Moritz Hanke <hanke@dkrz.de>
16 * Thomas Jahns <jahns@dkrz.de>
17 * URL: https://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are
21 * met:
22 *
23 * Redistributions of source code must retain the above copyright notice,
24 * this list of conditions and the following disclaimer.
25 *
26 * Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * Neither the name of the DKRZ GmbH nor the names of its contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
35 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
36 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
37 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
38 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46#ifdef HAVE_CONFIG_H
47#include <config.h>
48#endif
49
50#include <stdlib.h>
51
52#include "core/core.h"
53#include "xt_init_internal.h"
54#include "xt_config_internal.h"
55#include "xt_idxlist_internal.h"
59#include "xt_exchanger.h"
60#include "xt_mpi_internal.h"
61#include "instr.h"
62#include "xt_gpu.h"
63
64INSTR_DEF(instr,"YAXT_lifetime")
65
66int xt_lib_state __attribute__((aligned(FC_ALIGN_C_INT),common));
67
68
69void
71{
72 Xt_set_default_comm(default_comm);
79#ifdef INSTR_WITH_SCT
80 sct_init(32, "YAXT", Xt_default_comm);
81 setenv("SCT_PROC_CHOICE", "SCT_REDUCE_ALL", 0);
82 setenv("SCT_CALLSTATS", "0", 0);
83 INSTR_START(instr);
84#endif
85#ifdef XT_ENABLE_DDT_EXCHANGER
87#endif
88 xt_lib_state = xt_lib_initialized;
89}
90
91void
93{
94 if (xt_lib_state == xt_lib_initialized)
95 {
100#ifdef INSTR_WITH_SCT
101 INSTR_STOP(instr);
102 INSTR_REPORT(SCT_GETENV, SCT_GETENV, SCT_GETENV);
104#endif
105 xt_lib_state = xt_lib_finalized;
106 }
107}
108
109int
111{
112 return xt_lib_state > xt_lib_pre_init;
113}
114
115int
117{
118 return xt_lib_state == xt_lib_finalized;
119}
120
121
122#if !defined PIC && defined XT_WORKAROUND_MPI_SYMBIND
123
124#include <stdint.h>
125extern int yaksa_type_create_indexed(int, const int *,
126 const int *, uint64_t,
127 void *, uint64_t *);
128struct opal_datatype_t;
129extern int32_t opal_datatype_commit(struct opal_datatype_t *);
130extern int32_t opal_datatype_add(struct opal_datatype_t *,
131 const struct opal_datatype_t *,
132 uint32_t, ptrdiff_t, ptrdiff_t);
133
134#define XT_SYM(sym) ((void(*)(void))(sym)),
135void (*xt_sym_bind[])(void) = { XT_WORKAROUND_MPI_SYMBIND };
136
137#endif
138
139/*
140 * Local Variables:
141 * c-basic-offset: 2
142 * coding: utf-8
143 * indent-tabs-mode: nil
144 * show-trailing-whitespace: t
145 * require-trailing-newline: t
146 * End:
147 */
int MPI_Comm
Definition core.h:64
#define __attribute__(x)
Definition core.h:82
#define INSTR_STOP(T)
Definition instr.h:69
#define INSTR_DEF(T, S)
Definition instr.h:66
#define INSTR_START(T)
Definition instr.h:68
#define INSTR_FINALIZE()
Definition instr.h:70
void xt_config_defaults_init(void)
Definition xt_config.c:525
implementation of configuration object
void xt_initialize(MPI_Comm default_comm)
Definition xt_init.c:70
exchanging of data based on information provided by redist's
void xt_gpu_init(void)
Definition xt_gpu.c:126
routines for using GPU devices
void xt_idxempty_finalize(void)
void xt_idxempty_init(void)
Provide non-public declarations common to all index lists.
PPM_DSO_INTERNAL void xt_idxlist_intersection_init(void)
void xt_idxsection_initialize(void)
void xt_idxsection_finalize(void)
void xt_idxstripes_initialize(void)
void xt_idxstripes_finalize(void)
int xt_finalized(void)
Definition xt_init.c:116
int xt_initialized(void)
Definition xt_init.c:110
void xt_finalize(void)
Definition xt_init.c:92
void xt_mpi_init(void)
Definition xt_mpi.c:246
void xt_mpi_finalize(void)
Definition xt_mpi.c:261