Skip to content

Commit

Permalink
Update shroud wrappers (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored Apr 23, 2024
1 parent 04c4d91 commit 926356a
Show file tree
Hide file tree
Showing 22 changed files with 247 additions and 197 deletions.
2 changes: 1 addition & 1 deletion examples/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (CALIPER_HAVE_MPI)
target_link_libraries(${app} caliper ${MPI_CXX_LIBRARIES})
endforeach()
endif()

if (WITH_FORTRAN)
foreach(app ${CALIPER_Fortran_EXAMPLE_APPS})
add_executable(${app} ${app}.f)
Expand Down
5 changes: 3 additions & 2 deletions examples/apps/fortran-example.f
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ program fortran_example
! A scope annotation. Start region 'main'
call cali_begin_region('main')

call cali_begin_phase('init')
count = 4
call cali_end_phase('init')

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

call cali_begin_string(loop_attribute, 'mainloop')

do i = 1, count
call cali_begin_int(iter_attribute, i)

! ...

call cali_end(iter_attribute)
end do

call cali_end(loop_attribute)


! End 'main'
call cali_end_region('main')

Expand Down
2 changes: 1 addition & 1 deletion scripts/radiuss-spack-configs
Submodule radiuss-spack-configs updated 41 files
+3 −4 README.md
+586 −0 blueos_3_ppc64le_ib/compilers.yaml
+99 −0 blueos_3_ppc64le_ib/packages.yaml
+0 −761 blueos_3_ppc64le_ib/spack.yaml
+220 −0 config.yaml
+93 −0 darwin/compilers.yaml
+25 −0 darwin/packages.yaml
+0 −131 darwin/spack.yaml
+5 −18 docs/sphinx/user_guide/how_to.rst
+1 −1 docs/sphinx/user_guide/index.rst
+3 −12 docs/sphinx/user_guide/use_spack.rst
+2 −2 gitlab/radiuss-jobs/corona.yml
+5 −6 gitlab/radiuss-jobs/lassen.yml
+0 −27 gitlab/radiuss-jobs/poodle.yml
+4 −4 gitlab/radiuss-jobs/ruby.yml
+4 −4 gitlab/radiuss-jobs/tioga.yml
+1 −54 packages/blt/package.py
+15 −52 packages/caliper/package.py
+0 −24 packages/camp/libstdc++-13-missing-header.patch
+78 −68 packages/camp/package.py
+0 −244 packages/care/package.py
+0 −13 packages/chai/change_mpi_target_name_umpire_patch.patch
+42 −42 packages/chai/package.py
+0 −13 packages/fmt/fmt-attributes-cpp11_4.1.0.patch
+0 −13 packages/fmt/fmt-no-export-cpp11flag_3.0.0.patch
+0 −22 packages/fmt/fmt-no-variable-initialize_10.0.0.patch
+0 −15 packages/fmt/fmt-use-cmake-cxx-standard_3.0.0.patch
+0 −131 packages/fmt/package.py
+80 −219 packages/raja/package.py
+4 −21 packages/raja_perf/package.py
+0 −106 packages/umpire/dual_blt_import_umpire_2022.10_2023.06.patch
+124 −239 packages/umpire/package.py
+560 −0 toss_3_x86_64_ib/compilers.yaml
+139 −0 toss_3_x86_64_ib/packages.yaml
+0 −728 toss_3_x86_64_ib/spack.yaml
+231 −0 toss_4_x86_64_ib/compilers.yaml
+164 −0 toss_4_x86_64_ib/packages.yaml
+0 −543 toss_4_x86_64_ib/spack.yaml
+209 −0 toss_4_x86_64_ib_cray/compilers.yaml
+163 −0 toss_4_x86_64_ib_cray/packages.yaml
+0 −470 toss_4_x86_64_ib_cray/spack.yaml
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if (CALIPER_HAVE_FORTRAN)
target_include_directories(
caliper
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/caliper/fortran>"
)
endif()
Expand Down
1 change: 0 additions & 1 deletion src/interface/c_fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ set(CALIPER_INTERFACE_SOURCES
BufferedRegionProfile.cpp
wrapAnnotation.cpp
wrapBufferedRegionProfile.cpp
wrapCaliper.cpp
wrapConfigManager.cpp
wrapScopeAnnotation.cpp
utilCaliper.cpp)
Expand Down
7 changes: 6 additions & 1 deletion src/interface/c_fortran/typesCaliper.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
// typesCaliper.h
// This file is generated by Shroud 0.12.2. Do not edit.
// This file is generated by Shroud 0.13.0. Do not edit.
// For C users and C++ implementation

#ifndef TYPESCALIPER_H
#define TYPESCALIPER_H

#include <stddef.h>

// splicer begin types.CXX_declarations
// splicer end types.CXX_declarations

#ifdef __cplusplus
extern "C" {
#endif

// splicer begin types.C_declarations
// splicer end types.C_declarations

// helper capsule_data_helper
struct s_cali_SHROUD_capsule_data {
void *addr; /* address of C++ memory */
Expand Down
60 changes: 59 additions & 1 deletion src/interface/c_fortran/utilCaliper.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// utilCaliper.cpp
// This file is generated by Shroud 0.12.2. Do not edit.
// This file is generated by Shroud 0.13.0. Do not edit.

#include "caliper/cali.h"
#include "caliper/ConfigManager.h"
#include <string>
#include "BufferedRegionProfile.h"
#include "typesCaliper.h"
#include <cstddef>
#include <cstring>
Expand All @@ -22,6 +26,60 @@ void cali_ShroudCopyStringAndFree(cali_SHROUD_array *data, char *c_var, size_t c
}


// Release library allocated memory.
void cali_SHROUD_memory_destructor(cali_SHROUD_capsule_data *cap)
{
void *ptr = cap->addr;
switch (cap->idtor) {
case 0: // --none--
{
// Nothing to delete
break;
}
case 1: // cali::ScopeAnnotation
{
cali::ScopeAnnotation *cxx_ptr =
reinterpret_cast<cali::ScopeAnnotation *>(ptr);
delete cxx_ptr;
break;
}
case 2: // cali::Annotation
{
cali::Annotation *cxx_ptr =
reinterpret_cast<cali::Annotation *>(ptr);
delete cxx_ptr;
break;
}
case 3: // cali::ConfigManager
{
cali::ConfigManager *cxx_ptr =
reinterpret_cast<cali::ConfigManager *>(ptr);
delete cxx_ptr;
break;
}
case 4: // new_string
{
std::string *cxx_ptr = reinterpret_cast<std::string *>(ptr);
delete cxx_ptr;
break;
}
case 5: // cali::BufferedRegionProfile
{
cali::BufferedRegionProfile *cxx_ptr =
reinterpret_cast<cali::BufferedRegionProfile *>(ptr);
delete cxx_ptr;
break;
}
default:
{
// Unexpected case in destructor
break;
}
}
cap->addr = nullptr;
cap->idtor = 0; // avoid deleting again
}

#ifdef __cplusplus
}
#endif
20 changes: 10 additions & 10 deletions src/interface/c_fortran/wrapAnnotation.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// wrapAnnotation.cpp
// This file is generated by Shroud 0.12.2. Do not edit.
#include "wrapAnnotation.h"
// This file is generated by Shroud 0.13.0. Do not edit.

#include "caliper/cali.h"
#include <cstddef>
#include "wrapAnnotation.h"

// splicer begin class.Annotation.CXX_definitions
// splicer end class.Annotation.CXX_definitions
Expand All @@ -14,24 +14,24 @@ extern "C" {
// splicer end class.Annotation.C_definitions

cali_Annotation * cali_Annotation_new(const char * key,
cali_Annotation * SHadow_rv)
cali_Annotation * SHC_rv)
{
// splicer begin class.Annotation.method.new
cali::Annotation *SHCXX_rv = new cali::Annotation(key);
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
SHadow_rv->idtor = 2;
return SHadow_rv;
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
SHC_rv->idtor = 2;
return SHC_rv;
// splicer end class.Annotation.method.new
}

cali_Annotation * cali_Annotation_new_with_properties(const char * key,
int properties, cali_Annotation * SHadow_rv)
int properties, cali_Annotation * SHC_rv)
{
// splicer begin class.Annotation.method.new_with_properties
cali::Annotation *SHCXX_rv = new cali::Annotation(key, properties);
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
SHadow_rv->idtor = 2;
return SHadow_rv;
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
SHC_rv->idtor = 2;
return SHC_rv;
// splicer end class.Annotation.method.new_with_properties
}

Expand Down
6 changes: 3 additions & 3 deletions src/interface/c_fortran/wrapAnnotation.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// wrapAnnotation.h
// This file is generated by Shroud 0.12.2. Do not edit.
// This file is generated by Shroud 0.13.0. Do not edit.
/**
* \file wrapAnnotation.h
* \brief Shroud generated wrapper for Annotation class
Expand All @@ -22,10 +22,10 @@ extern "C" {
// splicer end class.Annotation.C_declarations

cali_Annotation * cali_Annotation_new(const char * key,
cali_Annotation * SHadow_rv);
cali_Annotation * SHC_rv);

cali_Annotation * cali_Annotation_new_with_properties(const char * key,
int properties, cali_Annotation * SHadow_rv);
int properties, cali_Annotation * SHC_rv);

void cali_Annotation_delete(cali_Annotation * self);

Expand Down
12 changes: 6 additions & 6 deletions src/interface/c_fortran/wrapBufferedRegionProfile.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// wrapBufferedRegionProfile.cpp
// This file is generated by Shroud 0.12.2. Do not edit.
#include "wrapBufferedRegionProfile.h"
// This file is generated by Shroud 0.13.0. Do not edit.

#include "BufferedRegionProfile.h"
#include <cstddef>
#include "wrapBufferedRegionProfile.h"

// splicer begin class.BufferedRegionProfile.CXX_definitions
// splicer end class.BufferedRegionProfile.CXX_definitions
Expand All @@ -14,14 +14,14 @@ extern "C" {
// splicer end class.BufferedRegionProfile.C_definitions

cali_BufferedRegionProfile * cali_BufferedRegionProfile_new(
cali_BufferedRegionProfile * SHadow_rv)
cali_BufferedRegionProfile * SHC_rv)
{
// splicer begin class.BufferedRegionProfile.method.new
cali::BufferedRegionProfile *SHCXX_rv =
new cali::BufferedRegionProfile();
SHadow_rv->addr = static_cast<void *>(SHCXX_rv);
SHadow_rv->idtor = 5;
return SHadow_rv;
SHC_rv->addr = static_cast<void *>(SHCXX_rv);
SHC_rv->idtor = 5;
return SHC_rv;
// splicer end class.BufferedRegionProfile.method.new
}

Expand Down
4 changes: 2 additions & 2 deletions src/interface/c_fortran/wrapBufferedRegionProfile.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// wrapBufferedRegionProfile.h
// This file is generated by Shroud 0.12.2. Do not edit.
// This file is generated by Shroud 0.13.0. Do not edit.
/**
* \file wrapBufferedRegionProfile.h
* \brief Shroud generated wrapper for BufferedRegionProfile class
Expand All @@ -22,7 +22,7 @@ extern "C" {
// splicer end class.BufferedRegionProfile.C_declarations

cali_BufferedRegionProfile * cali_BufferedRegionProfile_new(
cali_BufferedRegionProfile * SHadow_rv);
cali_BufferedRegionProfile * SHC_rv);

void cali_BufferedRegionProfile_delete(
cali_BufferedRegionProfile * self);
Expand Down
73 changes: 0 additions & 73 deletions src/interface/c_fortran/wrapCaliper.cpp

This file was deleted.

10 changes: 8 additions & 2 deletions src/interface/c_fortran/wrapCaliper.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// wrapCaliper.h
// This file is generated by Shroud 0.12.2. Do not edit.
// This file is generated by Shroud 0.13.0. Do not edit.
/**
* \file wrapCaliper.h
* \brief Shroud generated wrapper for cali namespace
Expand All @@ -18,6 +18,11 @@
extern "C" {
#endif

// typedef cali::cali_id_t
// splicer begin typedef.cali_id_t
typedef uint64_t cali_cali_id_t;
// splicer end typedef.cali_id_t

// cali::cali_attr_properties
enum cali_cali_attr_properties {
cali_CALI_ATTR_DEFAULT = 0,
Expand All @@ -30,7 +35,8 @@ enum cali_cali_attr_properties {
cali_CALI_ATTR_HIDDEN = 128,
cali_CALI_ATTR_NESTED = 256,
cali_CALI_ATTR_GLOBAL = 512,
cali_CALI_ATTR_UNALIGNED = 1024
cali_CALI_ATTR_UNALIGNED = 1024,
cali_CALI_ATTR_AGGREGATABLE = 2048
};

// cali::cali_attr_type
Expand Down
Loading

0 comments on commit 926356a

Please sign in to comment.