Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yaxt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dkrz-sw
yaxt
Commits
a3b990a2
Commit
a3b990a2
authored
3 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Enable PURE implementation by exposing variable.
parent
942b674a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/Makefile.am
+1
-0
1 addition, 0 deletions
src/Makefile.am
src/xt_core_f.f90
+11
-18
11 additions, 18 deletions
src/xt_core_f.f90
src/xt_init.c
+4
-5
4 additions, 5 deletions
src/xt_init.c
src/xt_init_internal.h
+77
-0
77 additions, 0 deletions
src/xt_init_internal.h
with
93 additions
and
23 deletions
src/Makefile.am
+
1
−
0
View file @
a3b990a2
...
...
@@ -124,6 +124,7 @@ libyaxt_c_la_SOURCES = \
xt_xmap_intersection.c
\
xt_xmap_intersection_common.h
\
xt_xmap_intersection_ext.c
\
xt_init_internal.h
\
xt_init.c
\
core/core.c
\
core/core.h
\
...
...
This diff is collapsed.
Click to expand it.
src/xt_core_f.f90
+
11
−
18
View file @
a3b990a2
...
...
@@ -148,6 +148,13 @@ MODULE xt_core
PUBLIC
::
set_abort_handler
,
xt_restore_default_abort_hndl
ENUM
,
BIND
(
C
)
ENUMERATOR
::
xt_lib_pre_init
,
&
xt_lib_initialized
,
&
xt_lib_finalized
END
ENUM
INTEGER
(
c_int
),
PUBLIC
,
BIND
(
c
,
name
=
'xt_lib_state'
)
::
xt_lib_state
CONTAINS
SUBROUTINE
xt_abort4
(
comm
,
msg
,
source
,
line
)
...
...
@@ -174,28 +181,14 @@ CONTAINS
stripe
%
stride
,
', '
,
stripe
%
nstrides
,
')'
END
FUNCTION
xt_stripe2char
FUNCTION
xt_initialized
()
RESULT
(
is_initialized
)
PURE
FUNCTION
xt_initialized
()
RESULT
(
is_initialized
)
LOGICAL
::
is_initialized
INTERFACE
FUNCTION
xt_initialized_c
()
BIND
(
c
,
name
=
'xt_initialized'
)
&
RESULT
(
is_initialized
)
IMPORT
::
c_int
INTEGER
(
c_int
)
::
is_initialized
END
FUNCTION
xt_initialized_c
END
INTERFACE
is_initialized
=
xt_initialized_c
()
/
=
0
is_initialized
=
xt_lib_state
>
xt_lib_pre_init
END
FUNCTION
xt_initialized
FUNCTION
xt_finalized
()
RESULT
(
is_finalized
)
PURE
FUNCTION
xt_finalized
()
RESULT
(
is_finalized
)
LOGICAL
::
is_finalized
INTERFACE
FUNCTION
xt_finalized_c
()
BIND
(
c
,
name
=
'xt_finalized'
)
&
RESULT
(
is_finalized
)
IMPORT
::
c_int
INTEGER
(
c_int
)
::
is_finalized
END
FUNCTION
xt_finalized_c
END
INTERFACE
is_finalized
=
xt_finalized_c
()
/
=
0
is_finalized
=
xt_lib_state
==
xt_lib_finalized
END
FUNCTION
xt_finalized
ELEMENTAL
FUNCTION
xt_pos_ext_eq
(
a
,
b
)
RESULT
(
p
)
...
...
This diff is collapsed.
Click to expand it.
src/xt_init.c
+
4
−
5
View file @
a3b990a2
...
...
@@ -48,7 +48,9 @@
#endif
#include
<stdlib.h>
#include
"core/core.h"
#include
"xt_init_internal.h"
#include
"xt_config_internal.h"
#include
"xt_idxlist_internal.h"
#include
"xt_idxstripes_internal.h"
...
...
@@ -60,11 +62,8 @@
INSTR_DEF
(
instr
,
"YAXT_lifetime"
)
static
enum
{
xt_lib_pre_init
,
xt_lib_initialized
,
xt_lib_finalized
,
}
xt_lib_state
=
xt_lib_pre_init
;
int
xt_lib_state
__attribute__
((
aligned
(
16
),
common
));
void
xt_initialize
(
MPI_Comm
default_comm
)
...
...
This diff is collapsed.
Click to expand it.
src/xt_init_internal.h
0 → 100644
+
77
−
0
View file @
a3b990a2
/**
* @file xt_init_internal.h
*
* @copyright Copyright (C) 2021 Jörg Behrens <behrens@dkrz.de>
* Moritz Hanke <hanke@dkrz.de>
* Thomas Jahns <jahns@dkrz.de>
*
* @author Jörg Behrens <behrens@dkrz.de>
* Moritz Hanke <hanke@dkrz.de>
* Thomas Jahns <jahns@dkrz.de>
*/
/*
* Keywords:
* Maintainer: Jörg Behrens <behrens@dkrz.de>
* Moritz Hanke <hanke@dkrz.de>
* Thomas Jahns <jahns@dkrz.de>
* URL: https://doc.redmine.dkrz.de/yaxt/html/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XT_INIT_INTERNAL_H
#define XT_INIT_INTERNAL_H
#ifdef HAVE_CONFIG_H
#include
<config.h>
#endif
/* must be kept in sync with Fortran declaration in xt_core_f.f90 */
enum
xt_init_states
{
xt_lib_pre_init
=
0
,
/* this entry must be zero so that
* xt_lib_state in common matches that */
xt_lib_initialized
,
xt_lib_finalized
,
};
#ifndef __GNUC__
#define __attribute__(att)
#endif
extern
int
xt_lib_state
__attribute__
((
aligned
(
16
),
common
));
#endif
/*
* Local Variables:
* c-basic-offset: 2
* coding: utf-8
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment