Yet Another eXchange Tool  DO_NOT_EDIT_HERE
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://doc.redmine.dkrz.de/yaxt/html/
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 #include "core/core.h"
52 #include "xt_idxlist_internal.h"
53 #include "xt_idxstripes_internal.h"
54 #include "xt_idxsection_internal.h"
55 #include "xt_idxempty_internal.h"
56 #include "xt_exchanger.h"
57 #include "xt_mpi_internal.h"
58 #include "instr.h"
59 
60 INSTR_DEF(instr,"YAXT_lifetime")
61 
62 static enum {
67 
68 void
69 xt_initialize(MPI_Comm default_comm)
70 {
71  Xt_default_comm = default_comm;
72  xt_mpi_init();
77 #ifdef INSTR_WITH_SCT
78  sct_init(32, "YAXT", Xt_default_comm);
79  setenv("SCT_PROC_CHOICE", "SCT_REDUCE_ALL", 0);
80  setenv("SCT_CALLSTATS", "0", 0);
81  INSTR_START(instr);
82 #endif
84 }
85 
86 void
88 {
90  {
95 #ifdef INSTR_WITH_SCT
96  INSTR_STOP(instr);
97  INSTR_REPORT(SCT_GETENV, SCT_GETENV, SCT_GETENV);
99 #endif
101  }
102 }
103 
104 int
106 {
107  return xt_lib_state > xt_lib_pre_init;
108 }
109 
110 int
112 {
113  return xt_lib_state == xt_lib_finalized;
114 }
115 
116 /*
117  * Local Variables:
118  * c-basic-offset: 2
119  * coding: utf-8
120  * indent-tabs-mode: nil
121  * show-trailing-whitespace: t
122  * require-trailing-newline: t
123  * End:
124  */
void xt_finalize(void)
Definition: xt_init.c:87
void xt_initialize(MPI_Comm default_comm)
Definition: xt_init.c:69
void xt_idxempty_init(void)
Definition: xt_idxempty.c:155
#define INSTR_START(T)
Definition: instr.h:68
int xt_initialized(void)
Definition: xt_init.c:105
void xt_mpi_init(void)
Definition: xt_mpi.c:776
static enum @3 xt_lib_state
#define INSTR_FINALIZE()
Definition: instr.h:70
Provide non-public declarations common to all index lists.
void xt_idxsection_finalize(void)
#define INSTR_DEF(T, S)
Definition: instr.h:66
void xt_idxlist_intersection_init(void)
void xt_mpi_finalize(void)
Definition: xt_mpi.c:790
void xt_idxstripes_initialize(void)
int xt_finalized(void)
Definition: xt_init.c:111
exchanging of data based on information provided by redist&#39;s
void xt_idxstripes_finalize(void)
#define INSTR_STOP(T)
Definition: instr.h:69
void xt_idxsection_initialize(void)
void xt_idxempty_finalize(void)
Definition: xt_idxempty.c:161
int MPI_Comm
Definition: core.h:64