5.0-rc1 (revision 14071)
SCOREP_SubstratePlugins.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Score-P software (http://www.score-p.org)
3  *
4  * Copyright (c) 2016-2018,
5  * Technische Universitaet Dresden, Germany
6  *
7  * Copyright (c) 2018,
8  * Forschungszentrum Juelich GmbH, Germany
9  *
10  * This software may be modified and distributed under the terms of
11  * a BSD-style license. See the COPYING file in the package base
12  * directory for details.
13  *
14  */
15 
23 #ifndef SCOREP_SUBSTRATE_PLUGINS_H
24 #define SCOREP_SUBSTRATE_PLUGINS_H
25 
120 #include <stdlib.h>
121 #include <stdio.h>
122 #include <stddef.h>
123 
127 
128 
130 #define SCOREP_SUBSTRATE_PLUGIN_VERSION 2
131 
133 #define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS 99
134 
135 
136 #ifdef __cplusplus
137 # define EXTERN extern "C"
138 #else
139 # define EXTERN extern
140 #endif
141 
143 #define SCOREP_SUBSTRATE_PLUGIN_ENTRY( _name ) \
144  EXTERN SCOREP_SubstratePluginInfo \
145  SCOREP_SubstratePlugin_ ## _name ## _get_info( void )
146 
154 {
163  const char* ( *SCOREP_GetExperimentDirName )( void );
164 
171  int
172  ( * SCOREP_Ipc_GetSize )( void );
173 
174 
181  int
182  ( * SCOREP_Ipc_GetRank )( void );
183 
196  int
197  ( * SCOREP_Ipc_Send )( const void* buf,
198  int count,
199  SCOREP_Ipc_Datatype datatype,
200  int dest );
201 
202 
215  int
216  ( * SCOREP_Ipc_Recv )( void* buf,
217  int count,
218  SCOREP_Ipc_Datatype datatype,
219  int source );
220 
221 
229  int
230  ( * SCOREP_Ipc_Barrier )( void );
231 
232 
244  int
245  ( * SCOREP_Ipc_Bcast )( void* buf,
246  int count,
247  SCOREP_Ipc_Datatype datatype,
248  int root );
249 
267  int
268  ( * SCOREP_Ipc_Gather )( const void* sendbuf,
269  void* recvbuf,
270  int count,
271  SCOREP_Ipc_Datatype datatype,
272  int root );
273 
274 
293  int
294  ( * SCOREP_Ipc_Gatherv )( const void* sendbuf,
295  int sendcount,
296  void* recvbuf,
297  const int* recvcnts,
298  SCOREP_Ipc_Datatype datatype,
299  int root );
300 
301 
316  int
317  ( * SCOREP_Ipc_Allgather )( const void* sendbuf,
318  void* recvbuf,
319  int count,
320  SCOREP_Ipc_Datatype datatype );
321 
336  int
337  ( * SCOREP_Ipc_Reduce )( const void* sendbuf,
338  void* recvbuf,
339  int count,
340  SCOREP_Ipc_Datatype datatype,
341  SCOREP_Ipc_Operation operation,
342  int root );
343 
344 
358  int
359  ( * SCOREP_Ipc_Allreduce )( const void* sendbuf,
360  void* recvbuf,
361  int count,
362  SCOREP_Ipc_Datatype datatype,
363  SCOREP_Ipc_Operation operation );
364 
377  int
378  ( * SCOREP_Ipc_Scatter )( const void* sendbuf,
379  void* recvbuf,
380  int count,
381  SCOREP_Ipc_Datatype datatype,
382  int root );
383 
384 
399  int
400  ( * SCOREP_Ipc_Scatterv )( const void* sendbuf,
401  const int* sendcounts,
402  void* recvbuf,
403  int recvcount,
404  SCOREP_Ipc_Datatype datatype,
405  int root );
412  ( * SCOREP_Location_GetType )( const struct SCOREP_Location* locationData );
413 
419  const char*
420  ( *SCOREP_Location_GetName )( const struct SCOREP_Location* locationData );
421 
422 
429  uint32_t
430  ( * SCOREP_Location_GetId )( const struct SCOREP_Location* locationData );
431 
438  uint64_t
439  ( * SCOREP_Location_GetGlobalId )( const struct SCOREP_Location* locationData );
440 
449  void
450  ( * SCOREP_Location_SetData )( const struct SCOREP_Location* locationData,
451  size_t plugin_id,
452  void* data );
453 
462  void*
463  ( *SCOREP_Location_GetData )( const struct SCOREP_Location* locationData,
464  size_t plugin_id );
465 
472  ( * SCOREP_CallingContextHandle_GetRegion )( SCOREP_CallingContextHandle handle );
473 
479  SCOREP_CallingContextHandle
480  ( * SCOREP_CallingContextHandle_GetParent )( SCOREP_CallingContextHandle handle );
481 
490 
496  const char*
497  ( *SCOREP_MetricHandle_GetName )( SCOREP_MetricHandle handle );
498 
507 
516 
525 
534 
540  const char*
541  ( *SCOREP_ParadigmHandle_GetName )( SCOREP_ParadigmHandle handle );
542 
551 
557  const char*
558  ( *SCOREP_ParameterHandle_GetName )( SCOREP_ParameterHandle handle );
559 
560 
568  ( * SCOREP_ParameterHandle_GetType )( SCOREP_ParameterHandle handle );
569 
570 
576  uint32_t
578 
584  const char*
585  ( *SCOREP_RegionHandle_GetName )( SCOREP_RegionHandle handle );
586 
592  const char*
593  ( *SCOREP_RegionHandle_GetCanonicalName )( SCOREP_RegionHandle handle );
594 
600  const char*
601  ( *SCOREP_RegionHandle_GetFileName )( SCOREP_RegionHandle handle );
602 
610 
618 
627 
636 
643 
649  const SCOREP_MetricHandle* ( *SCOREP_SamplingSetHandle_GetMetricHandles )( SCOREP_SamplingSetHandle handle );
650 
657 
664 
671 
678 
684  const char*
685  ( *SCOREP_SourceFileHandle_GetName )( SCOREP_SourceFileHandle handle );
686 
692  const char*
693  ( *SCOREP_StringHandle_Get )( SCOREP_StringHandle handle );
694 
703  void
704  ( * SCOREP_Metric_WriteStrictlySynchronousMetrics )( struct SCOREP_Location* location,
705  uint64_t timestamp,
707 
716  void
717  ( * SCOREP_Metric_WriteSynchronousMetrics )( struct SCOREP_Location* location,
718  uint64_t timestamp,
720 
728  void
729  ( * SCOREP_Metric_WriteAsynchronousMetrics )( struct SCOREP_Location* location,
731 
733  void
735  const char* section );
736 
740  void
742  const char* fileName,
743  const char* descriptionFormatString,
744  ... );
746 
747 
789 {
794  uint32_t plugin_version;
795 
801  int ( * init )( void );
802 
813  void ( * assign_id )( size_t pluginId );
814 
820  void ( * init_mpp )( void );
821 
825  void ( * finalize )( void );
826 
850  void ( * create_location )( const struct SCOREP_Location* location,
851  const struct SCOREP_Location* parentLocation );
852 
863  void ( * activate_cpu_location )( const struct SCOREP_Location* location,
864  const struct SCOREP_Location* parentLocation,
865  uint32_t forkSequenceCount );
866 
875  void ( * deactivate_cpu_location )( const struct SCOREP_Location* location,
876  const struct SCOREP_Location* parentLocation );
877 
884  void ( * delete_location )( const struct SCOREP_Location* location );
885 
890  void ( * pre_unify )( void );
891 
897  void ( * write_data )( void );
898 
905  void ( * core_task_create )( const struct SCOREP_Location* location,
906  SCOREP_TaskHandle taskHandle );
907 
908 
915  void ( * core_task_complete )( const struct SCOREP_Location* location,
916  SCOREP_TaskHandle taskHandle );
917 
931  SCOREP_HandleType type );
932 
943  SCOREP_Substrates_Callback** functions );
944 
950  void ( * set_callbacks )( const SCOREP_SubstratePluginCallbacks* callbacks,
951  size_t size );
952 
963 
968  void ( * dump_manifest )( FILE* manifestFile,
969  const char* relativeSourceDir,
970  const char* targetDir );
971 
983 
984 #endif /* SCOREP_SUBSTRATE_PLUGINS_H */
SCOREP_AnyHandle SCOREP_SamplingSetHandle
Definition: SCOREP_PublicTypes.h:123
struct SCOREP_Task * SCOREP_TaskHandle
Definition: SCOREP_PublicTypes.h:159
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:317
bool(* SCOREP_SamplingSetHandle_IsScoped)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:663
uint64_t(* SCOREP_Location_GetGlobalId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:439
SCOREP_AnyHandle SCOREP_SourceFileHandle
Definition: SCOREP_PublicTypes.h:98
Definition: SCOREP_SubstratePlugins.h:153
void(* core_task_create)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:905
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:337
SCOREP_HandleType
Definition: SCOREP_PublicHandles.h:50
SCOREP_AnyHandle SCOREP_MetricHandle
Definition: SCOREP_PublicTypes.h:110
SCOREP_CallingContextHandle(* SCOREP_CallingContextHandle_GetParent)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:480
int(* SCOREP_Ipc_Gather)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:268
void(* SCOREP_Substrates_Callback)(void)
Definition: SCOREP_SubstrateEvents.h:46
void(* deactivate_cpu_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation)
Definition: SCOREP_SubstratePlugins.h:875
void(* write_data)(void)
Definition: SCOREP_SubstratePlugins.h:897
int(* SCOREP_Ipc_Bcast)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:245
void(* SCOREP_Location_SetData)(const struct SCOREP_Location *locationData, size_t plugin_id, void *data)
Definition: SCOREP_SubstratePlugins.h:450
SCOREP_MetricSourceType(* SCOREP_MetricHandle_GetSourceType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:524
int(* SCOREP_Ipc_Recv)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int source)
Definition: SCOREP_SubstratePlugins.h:216
uint8_t(* SCOREP_SamplingSetHandle_GetNumberOfMetrics)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:642
SCOREP_MetricValueType
Definition: SCOREP_MetricTypes.h:97
void(* finalize)(void)
Definition: SCOREP_SubstratePlugins.h:825
SCOREP_Substrates_RequirementFlag
Definition: SCOREP_PublicTypes.h:688
int(* SCOREP_Ipc_GetSize)(void)
Definition: SCOREP_SubstratePlugins.h:172
SCOREP_MetricMode(* SCOREP_MetricHandle_GetMode)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:515
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:942
SCOREP_AnyHandle SCOREP_ParadigmHandle
Definition: SCOREP_PublicTypes.h:147
int(* SCOREP_Ipc_Scatterv)(const void *sendbuf, const int *sendcounts, void *recvbuf, int recvcount, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:400
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:729
uint32_t plugin_version
Definition: SCOREP_SubstratePlugins.h:794
SCOREP_ParadigmType
defines paradigms that are be monitored
Definition: SCOREP_PublicTypes.h:325
void(* dump_manifest)(FILE *manifestFile, const char *relativeSourceDir, const char *targetDir)
Definition: SCOREP_SubstratePlugins.h:968
SCOREP_MetricMode
Definition: SCOREP_MetricTypes.h:133
void(* core_task_complete)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:915
void(* init_mpp)(void)
Definition: SCOREP_SubstratePlugins.h:820
SCOREP_LineNo(* SCOREP_RegionHandle_GetBeginLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:609
int(* SCOREP_Ipc_Send)(const void *buf, int count, SCOREP_Ipc_Datatype datatype, int dest)
Definition: SCOREP_SubstratePlugins.h:197
SCOREP_ParadigmClass(* SCOREP_ParadigmHandle_GetClass)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:533
void(* pre_unify)(void)
Definition: SCOREP_SubstratePlugins.h:890
SCOREP_Substrates_Mode
Definition: SCOREP_SubstrateEvents.h:55
void(* SCOREP_ConfigManifestSectionHeader)(FILE *out, const char *section)
Create formated header in the manifest file.
Definition: SCOREP_SubstratePlugins.h:734
Description of definition handles. This header defines an enumeration to map SCOREP_AnyHandle to spec...
SCOREP_LocationType(* SCOREP_Location_GetType)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:412
void(* activate_cpu_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation, uint32_t forkSequenceCount)
Definition: SCOREP_SubstratePlugins.h:863
SCOREP_MetricSourceType
Definition: SCOREP_MetricTypes.h:53
SCOREP_RegionHandle(* SCOREP_CallingContextHandle_GetRegion)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:472
int(* SCOREP_Ipc_Allreduce)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, SCOREP_Ipc_Operation operation)
Definition: SCOREP_SubstratePlugins.h:359
SCOREP_MetricScope(* SCOREP_SamplingSetHandle_GetScope)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:670
int(* SCOREP_Ipc_Scatter)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:378
SCOREP_LineNo(* SCOREP_RegionHandle_GetEndLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:617
SCOREP_MetricValueType(* SCOREP_MetricHandle_GetValueType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:489
int(* init)(void)
Definition: SCOREP_SubstratePlugins.h:801
SCOREP_ParadigmType(* SCOREP_RegionHandle_GetParadigmType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:635
uint32_t SCOREP_LineNo
Definition: SCOREP_PublicTypes.h:65
SCOREP_RegionType(* SCOREP_RegionHandle_GetType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:626
SCOREP_SamplingSetClass
Class of locations which recorded a sampling set.
Definition: SCOREP_PublicTypes.h:564
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:717
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:704
bool(* get_requirement)(SCOREP_Substrates_RequirementFlag flag)
Definition: SCOREP_SubstratePlugins.h:962
SCOREP_Ipc_Operation
specifies an inter process communication operation for reduce function
Definition: SCOREP_PublicTypes.h:667
SCOREP_Allocator_MovableMemory SCOREP_AnyHandle
Definition: SCOREP_PublicTypes.h:92
int(* SCOREP_Ipc_GetRank)(void)
Definition: SCOREP_SubstratePlugins.h:182
SCOREP_ParameterType
defines types to be used in defining a parameter for parameter based profiling (SCOREP_Definitions_Ne...
Definition: SCOREP_PublicTypes.h:342
int(* SCOREP_Ipc_Gatherv)(const void *sendbuf, int sendcount, void *recvbuf, const int *recvcnts, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:294
void(* create_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation)
Definition: SCOREP_SubstratePlugins.h:850
SCOREP_ParadigmType(* SCOREP_ParadigmHandle_GetType)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:550
SCOREP_ParadigmClass
defines classes of paradigms that are monitored Types:
Definition: SCOREP_PublicTypes.h:273
SCOREP_MetricProfilingType
Definition: SCOREP_MetricTypes.h:76
uint32_t(* SCOREP_RegionHandle_GetId)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:577
uint32_t(* SCOREP_Location_GetId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:430
void(* assign_id)(size_t pluginId)
Definition: SCOREP_SubstratePlugins.h:813
Definition: SCOREP_SubstratePlugins.h:788
SCOREP_ParameterType(* SCOREP_ParameterHandle_GetType)(SCOREP_ParameterHandle handle)
Definition: SCOREP_SubstratePlugins.h:568
#define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS
Definition: SCOREP_SubstratePlugins.h:133
SCOREP_Ipc_Datatype
specifies an inter process communication data types
Definition: SCOREP_PublicTypes.h:639
void(* undeclared[SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS])(void)
Definition: SCOREP_SubstratePlugins.h:981
void(* delete_location)(const struct SCOREP_Location *location)
Definition: SCOREP_SubstratePlugins.h:884
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:741
void(* SCOREP_Substrates_WriteMetricsCb)(struct SCOREP_Location *location, uint64_t timestamp, SCOREP_SamplingSetHandle samplingSet, const uint64_t *metricValues)
Definition: SCOREP_SubstrateEvents.h:1414
SCOREP_MetricOccurrence(* SCOREP_SamplingSetHandle_GetMetricOccurrence)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:656
void(* new_definition_handle)(SCOREP_AnyHandle handle, SCOREP_HandleType type)
Definition: SCOREP_SubstratePlugins.h:930
SCOREP_AnyHandle SCOREP_RegionHandle
Definition: SCOREP_PublicTypes.h:135
SCOREP_MetricScope
Types to be used in defining the scope of a scoped sampling set.
Definition: SCOREP_PublicTypes.h:576
int(* SCOREP_Ipc_Barrier)(void)
Definition: SCOREP_SubstratePlugins.h:230
SCOREP_MetricProfilingType(* SCOREP_MetricHandle_GetProfilingType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:506
void(* set_callbacks)(const SCOREP_SubstratePluginCallbacks *callbacks, size_t size)
Definition: SCOREP_SubstratePlugins.h:950
SCOREP_LocationType
Definition: SCOREP_PublicTypes.h:204
SCOREP_SamplingSetClass(* SCOREP_SamplingSetHandle_GetSamplingSetClass)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:677
SCOREP_MetricOccurrence
Types to be used in defining the occurrence of a sampling set.
Definition: SCOREP_PublicTypes.h:595
SCOREP_RegionType
specifies a Region
Definition: SCOREP_PublicTypes.h:446