Skip to content

Commit 926356a

Browse files
authored
Update shroud wrappers (LLNL#558)
1 parent 04c4d91 commit 926356a

22 files changed

+247
-197
lines changed

examples/apps/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (CALIPER_HAVE_MPI)
4040
target_link_libraries(${app} caliper ${MPI_CXX_LIBRARIES})
4141
endforeach()
4242
endif()
43-
43+
4444
if (WITH_FORTRAN)
4545
foreach(app ${CALIPER_Fortran_EXAMPLE_APPS})
4646
add_executable(${app} ${app}.f)

examples/apps/fortran-example.f

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ program fortran_example
3535
! A scope annotation. Start region 'main'
3636
call cali_begin_region('main')
3737

38+
call cali_begin_phase('init')
3839
count = 4
40+
call cali_end_phase('init')
3941

4042
! Annotate a loop. We'll have to find Caliper's built-in "loop"
4143
! attribute first and create a loop iteration attribute, using the region
@@ -45,17 +47,16 @@ program fortran_example
4547
iter_attribute = cali_make_loop_iteration_attribute('mainloop')
4648

4749
call cali_begin_string(loop_attribute, 'mainloop')
48-
4950
do i = 1, count
5051
call cali_begin_int(iter_attribute, i)
5152

5253
! ...
5354

5455
call cali_end(iter_attribute)
5556
end do
56-
5757
call cali_end(loop_attribute)
5858

59+
5960
! End 'main'
6061
call cali_end_region('main')
6162

scripts/radiuss-spack-configs

src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ if (CALIPER_HAVE_FORTRAN)
3737
target_include_directories(
3838
caliper
3939
PUBLIC
40+
"$<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}>"
4041
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/caliper/fortran>"
4142
)
4243
endif()

src/interface/c_fortran/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ set(CALIPER_INTERFACE_SOURCES
22
BufferedRegionProfile.cpp
33
wrapAnnotation.cpp
44
wrapBufferedRegionProfile.cpp
5-
wrapCaliper.cpp
65
wrapConfigManager.cpp
76
wrapScopeAnnotation.cpp
87
utilCaliper.cpp)

src/interface/c_fortran/typesCaliper.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
// typesCaliper.h
2-
// This file is generated by Shroud 0.12.2. Do not edit.
2+
// This file is generated by Shroud 0.13.0. Do not edit.
33
// For C users and C++ implementation
44

55
#ifndef TYPESCALIPER_H
66
#define TYPESCALIPER_H
77

88
#include <stddef.h>
99

10+
// splicer begin types.CXX_declarations
11+
// splicer end types.CXX_declarations
1012

1113
#ifdef __cplusplus
1214
extern "C" {
1315
#endif
1416

17+
// splicer begin types.C_declarations
18+
// splicer end types.C_declarations
19+
1520
// helper capsule_data_helper
1621
struct s_cali_SHROUD_capsule_data {
1722
void *addr; /* address of C++ memory */

src/interface/c_fortran/utilCaliper.cpp

+59-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// utilCaliper.cpp
2-
// This file is generated by Shroud 0.12.2. Do not edit.
2+
// This file is generated by Shroud 0.13.0. Do not edit.
33

4+
#include "caliper/cali.h"
5+
#include "caliper/ConfigManager.h"
6+
#include <string>
7+
#include "BufferedRegionProfile.h"
48
#include "typesCaliper.h"
59
#include <cstddef>
610
#include <cstring>
@@ -22,6 +26,60 @@ void cali_ShroudCopyStringAndFree(cali_SHROUD_array *data, char *c_var, size_t c
2226
}
2327

2428

29+
// Release library allocated memory.
30+
void cali_SHROUD_memory_destructor(cali_SHROUD_capsule_data *cap)
31+
{
32+
void *ptr = cap->addr;
33+
switch (cap->idtor) {
34+
case 0: // --none--
35+
{
36+
// Nothing to delete
37+
break;
38+
}
39+
case 1: // cali::ScopeAnnotation
40+
{
41+
cali::ScopeAnnotation *cxx_ptr =
42+
reinterpret_cast<cali::ScopeAnnotation *>(ptr);
43+
delete cxx_ptr;
44+
break;
45+
}
46+
case 2: // cali::Annotation
47+
{
48+
cali::Annotation *cxx_ptr =
49+
reinterpret_cast<cali::Annotation *>(ptr);
50+
delete cxx_ptr;
51+
break;
52+
}
53+
case 3: // cali::ConfigManager
54+
{
55+
cali::ConfigManager *cxx_ptr =
56+
reinterpret_cast<cali::ConfigManager *>(ptr);
57+
delete cxx_ptr;
58+
break;
59+
}
60+
case 4: // new_string
61+
{
62+
std::string *cxx_ptr = reinterpret_cast<std::string *>(ptr);
63+
delete cxx_ptr;
64+
break;
65+
}
66+
case 5: // cali::BufferedRegionProfile
67+
{
68+
cali::BufferedRegionProfile *cxx_ptr =
69+
reinterpret_cast<cali::BufferedRegionProfile *>(ptr);
70+
delete cxx_ptr;
71+
break;
72+
}
73+
default:
74+
{
75+
// Unexpected case in destructor
76+
break;
77+
}
78+
}
79+
cap->addr = nullptr;
80+
cap->idtor = 0; // avoid deleting again
81+
}
82+
2583
#ifdef __cplusplus
2684
}
2785
#endif

src/interface/c_fortran/wrapAnnotation.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// wrapAnnotation.cpp
2-
// This file is generated by Shroud 0.12.2. Do not edit.
3-
#include "wrapAnnotation.h"
2+
// This file is generated by Shroud 0.13.0. Do not edit.
43

54
#include "caliper/cali.h"
65
#include <cstddef>
6+
#include "wrapAnnotation.h"
77

88
// splicer begin class.Annotation.CXX_definitions
99
// splicer end class.Annotation.CXX_definitions
@@ -14,24 +14,24 @@ extern "C" {
1414
// splicer end class.Annotation.C_definitions
1515

1616
cali_Annotation * cali_Annotation_new(const char * key,
17-
cali_Annotation * SHadow_rv)
17+
cali_Annotation * SHC_rv)
1818
{
1919
// splicer begin class.Annotation.method.new
2020
cali::Annotation *SHCXX_rv = new cali::Annotation(key);
21-
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
22-
SHadow_rv->idtor = 2;
23-
return SHadow_rv;
21+
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
22+
SHC_rv->idtor = 2;
23+
return SHC_rv;
2424
// splicer end class.Annotation.method.new
2525
}
2626

2727
cali_Annotation * cali_Annotation_new_with_properties(const char * key,
28-
int properties, cali_Annotation * SHadow_rv)
28+
int properties, cali_Annotation * SHC_rv)
2929
{
3030
// splicer begin class.Annotation.method.new_with_properties
3131
cali::Annotation *SHCXX_rv = new cali::Annotation(key, properties);
32-
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
33-
SHadow_rv->idtor = 2;
34-
return SHadow_rv;
32+
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
33+
SHC_rv->idtor = 2;
34+
return SHC_rv;
3535
// splicer end class.Annotation.method.new_with_properties
3636
}
3737

src/interface/c_fortran/wrapAnnotation.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// wrapAnnotation.h
2-
// This file is generated by Shroud 0.12.2. Do not edit.
2+
// This file is generated by Shroud 0.13.0. Do not edit.
33
/**
44
* \file wrapAnnotation.h
55
* \brief Shroud generated wrapper for Annotation class
@@ -22,10 +22,10 @@ extern "C" {
2222
// splicer end class.Annotation.C_declarations
2323

2424
cali_Annotation * cali_Annotation_new(const char * key,
25-
cali_Annotation * SHadow_rv);
25+
cali_Annotation * SHC_rv);
2626

2727
cali_Annotation * cali_Annotation_new_with_properties(const char * key,
28-
int properties, cali_Annotation * SHadow_rv);
28+
int properties, cali_Annotation * SHC_rv);
2929

3030
void cali_Annotation_delete(cali_Annotation * self);
3131

src/interface/c_fortran/wrapBufferedRegionProfile.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// wrapBufferedRegionProfile.cpp
2-
// This file is generated by Shroud 0.12.2. Do not edit.
3-
#include "wrapBufferedRegionProfile.h"
2+
// This file is generated by Shroud 0.13.0. Do not edit.
43

54
#include "BufferedRegionProfile.h"
65
#include <cstddef>
6+
#include "wrapBufferedRegionProfile.h"
77

88
// splicer begin class.BufferedRegionProfile.CXX_definitions
99
// splicer end class.BufferedRegionProfile.CXX_definitions
@@ -14,14 +14,14 @@ extern "C" {
1414
// splicer end class.BufferedRegionProfile.C_definitions
1515

1616
cali_BufferedRegionProfile * cali_BufferedRegionProfile_new(
17-
cali_BufferedRegionProfile * SHadow_rv)
17+
cali_BufferedRegionProfile * SHC_rv)
1818
{
1919
// splicer begin class.BufferedRegionProfile.method.new
2020
cali::BufferedRegionProfile *SHCXX_rv =
2121
new cali::BufferedRegionProfile();
22-
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
23-
SHadow_rv->idtor = 5;
24-
return SHadow_rv;
22+
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
23+
SHC_rv->idtor = 5;
24+
return SHC_rv;
2525
// splicer end class.BufferedRegionProfile.method.new
2626
}
2727

src/interface/c_fortran/wrapBufferedRegionProfile.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// wrapBufferedRegionProfile.h
2-
// This file is generated by Shroud 0.12.2. Do not edit.
2+
// This file is generated by Shroud 0.13.0. Do not edit.
33
/**
44
* \file wrapBufferedRegionProfile.h
55
* \brief Shroud generated wrapper for BufferedRegionProfile class
@@ -22,7 +22,7 @@ extern "C" {
2222
// splicer end class.BufferedRegionProfile.C_declarations
2323

2424
cali_BufferedRegionProfile * cali_BufferedRegionProfile_new(
25-
cali_BufferedRegionProfile * SHadow_rv);
25+
cali_BufferedRegionProfile * SHC_rv);
2626

2727
void cali_BufferedRegionProfile_delete(
2828
cali_BufferedRegionProfile * self);

src/interface/c_fortran/wrapCaliper.cpp

-73
This file was deleted.

src/interface/c_fortran/wrapCaliper.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// wrapCaliper.h
2-
// This file is generated by Shroud 0.12.2. Do not edit.
2+
// This file is generated by Shroud 0.13.0. Do not edit.
33
/**
44
* \file wrapCaliper.h
55
* \brief Shroud generated wrapper for cali namespace
@@ -18,6 +18,11 @@
1818
extern "C" {
1919
#endif
2020

21+
// typedef cali::cali_id_t
22+
// splicer begin typedef.cali_id_t
23+
typedef uint64_t cali_cali_id_t;
24+
// splicer end typedef.cali_id_t
25+
2126
// cali::cali_attr_properties
2227
enum cali_cali_attr_properties {
2328
cali_CALI_ATTR_DEFAULT = 0,
@@ -30,7 +35,8 @@ enum cali_cali_attr_properties {
3035
cali_CALI_ATTR_HIDDEN = 128,
3136
cali_CALI_ATTR_NESTED = 256,
3237
cali_CALI_ATTR_GLOBAL = 512,
33-
cali_CALI_ATTR_UNALIGNED = 1024
38+
cali_CALI_ATTR_UNALIGNED = 1024,
39+
cali_CALI_ATTR_AGGREGATABLE = 2048
3440
};
3541

3642
// cali::cali_attr_type

0 commit comments

Comments
 (0)