10.0 (revision 35c4bf227)
SCOREP_SubstratePlugins.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: (c) 2016 Technische Universität Dresden <tu-dresden.de>
3  * SPDX-FileCopyrightText: (c) 2018 Forschungszentrum Jülich GmbH <fz-juelich.de>
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  */
8 
16 #ifndef SCOREP_SUBSTRATE_PLUGINS_H
17 #define SCOREP_SUBSTRATE_PLUGINS_H
18 
113 #include <stdlib.h>
114 #include <stdio.h>
115 #include <stddef.h>
116 
120 
121 
123 #define SCOREP_SUBSTRATE_PLUGIN_VERSION 3
124 
126 #define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS 99
127 
128 
129 #ifdef __cplusplus
130 # define EXTERN extern "C"
131 #else
132 # define EXTERN extern
133 #endif
134 
136 #define SCOREP_SUBSTRATE_PLUGIN_ENTRY( _name ) \
137  EXTERN SCOREP_SubstratePluginInfo \
138  SCOREP_SubstratePlugin_ ## _name ## _get_info( void )
139 
147 {
156  const char* ( *SCOREP_GetExperimentDirName )( void );
157 
164  int
165  ( * SCOREP_Ipc_GetSize )( void );
166 
167 
174  int
175  ( * SCOREP_Ipc_GetRank )( void );
176 
189  int
190  ( * SCOREP_Ipc_Send )( const void* buf,
191  int count,
192  SCOREP_Ipc_Datatype datatype,
193  int dest );
194 
195 
208  int
209  ( * SCOREP_Ipc_Recv )( void* buf,
210  int count,
211  SCOREP_Ipc_Datatype datatype,
212  int source );
213 
214 
222  int
223  ( * SCOREP_Ipc_Barrier )( void );
224 
225 
237  int
238  ( * SCOREP_Ipc_Bcast )( void* buf,
239  int count,
240  SCOREP_Ipc_Datatype datatype,
241  int root );
242 
260  int
261  ( * SCOREP_Ipc_Gather )( const void* sendbuf,
262  void* recvbuf,
263  int count,
264  SCOREP_Ipc_Datatype datatype,
265  int root );
266 
267 
286  int
287  ( * SCOREP_Ipc_Gatherv )( const void* sendbuf,
288  int sendcount,
289  void* recvbuf,
290  const int* recvcnts,
291  SCOREP_Ipc_Datatype datatype,
292  int root );
293 
294 
309  int
310  ( * SCOREP_Ipc_Allgather )( const void* sendbuf,
311  void* recvbuf,
312  int count,
313  SCOREP_Ipc_Datatype datatype );
314 
329  int
330  ( * SCOREP_Ipc_Reduce )( const void* sendbuf,
331  void* recvbuf,
332  int count,
333  SCOREP_Ipc_Datatype datatype,
334  SCOREP_Ipc_Operation operation,
335  int root );
336 
337 
351  int
352  ( * SCOREP_Ipc_Allreduce )( const void* sendbuf,
353  void* recvbuf,
354  int count,
355  SCOREP_Ipc_Datatype datatype,
356  SCOREP_Ipc_Operation operation );
357 
370  int
371  ( * SCOREP_Ipc_Scatter )( const void* sendbuf,
372  void* recvbuf,
373  int count,
374  SCOREP_Ipc_Datatype datatype,
375  int root );
376 
377 
392  int
393  ( * SCOREP_Ipc_Scatterv )( const void* sendbuf,
394  const int* sendcounts,
395  void* recvbuf,
396  int recvcount,
397  SCOREP_Ipc_Datatype datatype,
398  int root );
405  ( * SCOREP_Location_GetType )( const struct SCOREP_Location* locationData );
406 
412  const char*
413  ( *SCOREP_Location_GetName )( const struct SCOREP_Location* locationData );
414 
415 
422  uint32_t
423  ( * SCOREP_Location_GetId )( const struct SCOREP_Location* locationData );
424 
431  uint64_t
432  ( * SCOREP_Location_GetGlobalId )( const struct SCOREP_Location* locationData );
433 
442  void
443  ( * SCOREP_Location_SetData )( const struct SCOREP_Location* locationData,
444  size_t plugin_id,
445  void* data );
446 
455  void*
456  ( *SCOREP_Location_GetData )( const struct SCOREP_Location* locationData,
457  size_t plugin_id );
458 
465  ( * SCOREP_CallingContextHandle_GetRegion )( SCOREP_CallingContextHandle handle );
466 
472  SCOREP_CallingContextHandle
473  ( * SCOREP_CallingContextHandle_GetParent )( SCOREP_CallingContextHandle handle );
474 
483 
489  const char*
490  ( *SCOREP_MetricHandle_GetName )( SCOREP_MetricHandle handle );
491 
500 
509 
518 
527 
533  const char*
534  ( *SCOREP_ParadigmHandle_GetName )( SCOREP_ParadigmHandle handle );
535 
544 
550  const char*
551  ( *SCOREP_ParameterHandle_GetName )( SCOREP_ParameterHandle handle );
552 
553 
561  ( * SCOREP_ParameterHandle_GetType )( SCOREP_ParameterHandle handle );
562 
563 
569  uint32_t
571 
577  const char*
578  ( *SCOREP_RegionHandle_GetName )( SCOREP_RegionHandle handle );
579 
585  const char*
586  ( *SCOREP_RegionHandle_GetCanonicalName )( SCOREP_RegionHandle handle );
587 
593  const char*
594  ( *SCOREP_RegionHandle_GetFileName )( SCOREP_RegionHandle handle );
595 
603 
611 
620 
629 
636 
642  const SCOREP_MetricHandle* ( *SCOREP_SamplingSetHandle_GetMetricHandles )( SCOREP_SamplingSetHandle handle );
643 
650 
657 
664 
671 
677  const char*
678  ( *SCOREP_SourceFileHandle_GetName )( SCOREP_SourceFileHandle handle );
679 
685  const char*
686  ( *SCOREP_StringHandle_Get )( SCOREP_StringHandle handle );
687 
696  void
697  ( * SCOREP_Metric_WriteStrictlySynchronousMetrics )( struct SCOREP_Location* location,
698  uint64_t timestamp,
700 
709  void
710  ( * SCOREP_Metric_WriteSynchronousMetrics )( struct SCOREP_Location* location,
711  uint64_t timestamp,
713 
721  void
722  ( * SCOREP_Metric_WriteAsynchronousMetrics )( struct SCOREP_Location* location,
724 
726  void
728  const char* section );
729 
733  void
735  const char* fileName,
736  const char* descriptionFormatString,
737  ... );
739 
740 
782 {
787  uint32_t plugin_version;
788 
794  int ( * init )( void );
795 
804  void ( * assign_id )( size_t pluginId );
805 
811  void ( * init_mpp )( void );
812 
816  void ( * finalize )( void );
817 
841  void ( * create_location )( const struct SCOREP_Location* location,
842  const struct SCOREP_Location* parentLocation );
843 
854  void ( * activate_cpu_location )( const struct SCOREP_Location* location,
855  const struct SCOREP_Location* parentLocation,
856  uint32_t forkSequenceCount );
857 
866  void ( * deactivate_cpu_location )( const struct SCOREP_Location* location,
867  const struct SCOREP_Location* parentLocation );
868 
875  void ( * delete_location )( const struct SCOREP_Location* location );
876 
881  void ( * pre_unify )( void );
882 
888  void ( * write_data )( void );
889 
896  void ( * core_task_create )( const struct SCOREP_Location* location,
897  SCOREP_TaskHandle taskHandle );
898 
899 
906  void ( * core_task_complete )( const struct SCOREP_Location* location,
907  SCOREP_TaskHandle taskHandle );
908 
922  SCOREP_HandleType type );
923 
934  SCOREP_Substrates_Callback** functions );
935 
941  void ( * set_callbacks )( const SCOREP_SubstratePluginCallbacks* callbacks,
942  size_t size );
943 
954 
959  void ( * dump_manifest )( FILE* manifestFile,
960  const char* relativeSourceDir,
961  const char* targetDir );
962 
974 
975 #endif /* SCOREP_SUBSTRATE_PLUGINS_H */
SCOREP_AnyHandle SCOREP_RegionHandle
Definition: SCOREP_PublicTypes.h:129
Defines public definitions that are used internally and externally (e.g., by metric plugins...
int(* SCOREP_Ipc_Allgather)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype)
Definition: SCOREP_SubstratePlugins.h:310
bool(* SCOREP_SamplingSetHandle_IsScoped)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:656
uint64_t(* SCOREP_Location_GetGlobalId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:432
Definition: SCOREP_SubstratePlugins.h:146
void(* core_task_create)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:896
SCOREP_RegionType
specifies a Region
Definition: SCOREP_PublicTypes.h:486
int(* SCOREP_Ipc_Reduce)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, SCOREP_Ipc_Operation operation, int root)
Definition: SCOREP_SubstratePlugins.h:330
uint32_t SCOREP_LineNo
Definition: SCOREP_PublicTypes.h:59
SCOREP_HandleType
Definition: SCOREP_PublicHandles.h:33
SCOREP_CallingContextHandle(* SCOREP_CallingContextHandle_GetParent)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:473
int(* SCOREP_Ipc_Gather)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:261
void(* SCOREP_Substrates_Callback)(void)
Definition: SCOREP_SubstrateEvents.h:38
void(* deactivate_cpu_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation)
Definition: SCOREP_SubstratePlugins.h:866
void(* write_data)(void)
Definition: SCOREP_SubstratePlugins.h:888
int(* SCOREP_Ipc_Bcast)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:238
void(* SCOREP_Location_SetData)(const struct SCOREP_Location *locationData, size_t plugin_id, void *data)
Definition: SCOREP_SubstratePlugins.h:443
SCOREP_MetricSourceType(* SCOREP_MetricHandle_GetSourceType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:517
int(* SCOREP_Ipc_Recv)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int source)
Definition: SCOREP_SubstratePlugins.h:209
uint8_t(* SCOREP_SamplingSetHandle_GetNumberOfMetrics)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:635
struct SCOREP_Task * SCOREP_TaskHandle
Definition: SCOREP_PublicTypes.h:156
SCOREP_MetricValueType
Definition: SCOREP_MetricTypes.h:80
void(* finalize)(void)
Definition: SCOREP_SubstratePlugins.h:816
int(* SCOREP_Ipc_GetSize)(void)
Definition: SCOREP_SubstratePlugins.h:165
SCOREP_MetricMode(* SCOREP_MetricHandle_GetMode)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:508
Description of the substrate plugin events header. For information on how to use substrate plugins...
uint32_t(* get_event_functions)(SCOREP_Substrates_Mode mode, SCOREP_Substrates_Callback **functions)
Definition: SCOREP_SubstratePlugins.h:933
int(* SCOREP_Ipc_Scatterv)(const void *sendbuf, const int *sendcounts, void *recvbuf, int recvcount, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:393
void(* SCOREP_Metric_WriteAsynchronousMetrics)(struct SCOREP_Location *location, SCOREP_Substrates_WriteMetricsCb cb)
Tell Score-P to write the current asynchronous metrics to cb.
Definition: SCOREP_SubstratePlugins.h:722
uint32_t plugin_version
Definition: SCOREP_SubstratePlugins.h:787
void(* dump_manifest)(FILE *manifestFile, const char *relativeSourceDir, const char *targetDir)
Definition: SCOREP_SubstratePlugins.h:959
SCOREP_MetricMode
Definition: SCOREP_MetricTypes.h:116
void(* core_task_complete)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:906
void(* init_mpp)(void)
Definition: SCOREP_SubstratePlugins.h:811
SCOREP_AnyHandle SCOREP_SourceFileHandle
Definition: SCOREP_PublicTypes.h:92
SCOREP_LineNo(* SCOREP_RegionHandle_GetBeginLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:602
int(* SCOREP_Ipc_Send)(const void *buf, int count, SCOREP_Ipc_Datatype datatype, int dest)
Definition: SCOREP_SubstratePlugins.h:190
SCOREP_SamplingSetClass
Class of locations which recorded a sampling set.
Definition: SCOREP_PublicTypes.h:605
SCOREP_AnyHandle SCOREP_ParadigmHandle
Definition: SCOREP_PublicTypes.h:141
SCOREP_ParadigmClass(* SCOREP_ParadigmHandle_GetClass)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:526
void(* pre_unify)(void)
Definition: SCOREP_SubstratePlugins.h:881
SCOREP_Substrates_Mode
Definition: SCOREP_SubstrateEvents.h:47
SCOREP_Allocator_MovableMemory SCOREP_AnyHandle
Definition: SCOREP_PublicTypes.h:86
void(* SCOREP_ConfigManifestSectionHeader)(FILE *out, const char *section)
Create formated header in the manifest file.
Definition: SCOREP_SubstratePlugins.h:727
Description of definition handles. This header defines an enumeration to map SCOREP_AnyHandle to spec...
SCOREP_AnyHandle SCOREP_MetricHandle
Definition: SCOREP_PublicTypes.h:104
SCOREP_LocationType(* SCOREP_Location_GetType)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:405
void(* activate_cpu_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation, uint32_t forkSequenceCount)
Definition: SCOREP_SubstratePlugins.h:854
SCOREP_MetricSourceType
Definition: SCOREP_MetricTypes.h:36
SCOREP_RegionHandle(* SCOREP_CallingContextHandle_GetRegion)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:465
SCOREP_Ipc_Datatype
specifies an inter process communication data types
Definition: SCOREP_PublicTypes.h:844
int(* SCOREP_Ipc_Allreduce)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, SCOREP_Ipc_Operation operation)
Definition: SCOREP_SubstratePlugins.h:352
SCOREP_MetricScope(* SCOREP_SamplingSetHandle_GetScope)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:663
int(* SCOREP_Ipc_Scatter)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:371
SCOREP_LineNo(* SCOREP_RegionHandle_GetEndLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:610
SCOREP_MetricValueType(* SCOREP_MetricHandle_GetValueType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:482
SCOREP_ParadigmClass
defines classes of paradigms that are monitored Types:
Definition: SCOREP_PublicTypes.h:298
int(* init)(void)
Definition: SCOREP_SubstratePlugins.h:794
SCOREP_ParadigmType(* SCOREP_RegionHandle_GetParadigmType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:628
SCOREP_RegionType(* SCOREP_RegionHandle_GetType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:619
void(* SCOREP_Metric_WriteSynchronousMetrics)(struct SCOREP_Location *location, uint64_t timestamp, SCOREP_Substrates_WriteMetricsCb cb)
Tell Score-P to write the current synchronous metrics to cb.
Definition: SCOREP_SubstratePlugins.h:710
void(* SCOREP_Metric_WriteStrictlySynchronousMetrics)(struct SCOREP_Location *location, uint64_t timestamp, SCOREP_Substrates_WriteMetricsCb cb)
Tell Score-P to write the current strictly synchronous metrics to cb.
Definition: SCOREP_SubstratePlugins.h:697
bool(* get_requirement)(SCOREP_Substrates_RequirementFlag flag)
Definition: SCOREP_SubstratePlugins.h:953
int(* SCOREP_Ipc_GetRank)(void)
Definition: SCOREP_SubstratePlugins.h:175
SCOREP_Ipc_Operation
specifies an inter process communication operation for reduce function
Definition: SCOREP_PublicTypes.h:872
int(* SCOREP_Ipc_Gatherv)(const void *sendbuf, int sendcount, void *recvbuf, const int *recvcnts, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:287
void(* create_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation)
Definition: SCOREP_SubstratePlugins.h:841
SCOREP_ParadigmType(* SCOREP_ParadigmHandle_GetType)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:543
SCOREP_Substrates_RequirementFlag
Definition: SCOREP_PublicTypes.h:893
SCOREP_AnyHandle SCOREP_SamplingSetHandle
Definition: SCOREP_PublicTypes.h:117
SCOREP_MetricProfilingType
Definition: SCOREP_MetricTypes.h:59
uint32_t(* SCOREP_RegionHandle_GetId)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:570
uint32_t(* SCOREP_Location_GetId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:423
void(* assign_id)(size_t pluginId)
Definition: SCOREP_SubstratePlugins.h:804
Definition: SCOREP_SubstratePlugins.h:781
SCOREP_ParameterType(* SCOREP_ParameterHandle_GetType)(SCOREP_ParameterHandle handle)
Definition: SCOREP_SubstratePlugins.h:561
#define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS
Definition: SCOREP_SubstratePlugins.h:126
void(* undeclared[SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS])(void)
Definition: SCOREP_SubstratePlugins.h:972
void(* delete_location)(const struct SCOREP_Location *location)
Definition: SCOREP_SubstratePlugins.h:875
void(* SCOREP_ConfigManifestSectionEntry)(FILE *out, const char *fileName, const char *descriptionFormatString,...)
Create formated entry in the manifest file consisting out of a name and a description, the latter in printf style and terminated with a period.
Definition: SCOREP_SubstratePlugins.h:734
void(* SCOREP_Substrates_WriteMetricsCb)(struct SCOREP_Location *location, uint64_t timestamp, SCOREP_SamplingSetHandle samplingSet, const uint64_t *metricValues)
Definition: SCOREP_SubstrateEvents.h:1516
SCOREP_MetricOccurrence(* SCOREP_SamplingSetHandle_GetMetricOccurrence)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:649
void(* new_definition_handle)(SCOREP_AnyHandle handle, SCOREP_HandleType type)
Definition: SCOREP_SubstratePlugins.h:921
SCOREP_MetricScope
Types to be used in defining the scope of a scoped sampling set.
Definition: SCOREP_PublicTypes.h:617
int(* SCOREP_Ipc_Barrier)(void)
Definition: SCOREP_SubstratePlugins.h:223
SCOREP_MetricProfilingType(* SCOREP_MetricHandle_GetProfilingType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:499
void(* set_callbacks)(const SCOREP_SubstratePluginCallbacks *callbacks, size_t size)
Definition: SCOREP_SubstratePlugins.h:941
SCOREP_ParadigmType
defines paradigms that are be monitored
Definition: SCOREP_PublicTypes.h:355
SCOREP_ParameterType
defines types to be used in defining a parameter for parameter based profiling (SCOREP_Definitions_Ne...
Definition: SCOREP_PublicTypes.h:372
SCOREP_SamplingSetClass(* SCOREP_SamplingSetHandle_GetSamplingSetClass)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:670
SCOREP_MetricOccurrence
Types to be used in defining the occurrence of a sampling set.
Definition: SCOREP_PublicTypes.h:636
SCOREP_LocationType
Definition: SCOREP_PublicTypes.h:201