4.1 (revision 13848)
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 <stddef.h>
122 
126 
127 
129 #define SCOREP_SUBSTRATE_PLUGIN_VERSION 1
130 
132 #define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS 100
133 
134 
135 #ifdef __cplusplus
136 # define EXTERN extern "C"
137 #else
138 # define EXTERN extern
139 #endif
140 
142 #define SCOREP_SUBSTRATE_PLUGIN_ENTRY( _name ) \
143  EXTERN SCOREP_SubstratePluginInfo \
144  SCOREP_SubstratePlugin_ ## _name ## _get_info( void )
145 
153 {
162  const char* ( *SCOREP_GetExperimentDirName )( void );
163 
170  int
171  ( * SCOREP_Ipc_GetSize )( void );
172 
173 
180  int
181  ( * SCOREP_Ipc_GetRank )( void );
182 
195  int
196  ( * SCOREP_Ipc_Send )( const void* buf,
197  int count,
198  SCOREP_Ipc_Datatype datatype,
199  int dest );
200 
201 
214  int
215  ( * SCOREP_Ipc_Recv )( void* buf,
216  int count,
217  SCOREP_Ipc_Datatype datatype,
218  int source );
219 
220 
228  int
229  ( * SCOREP_Ipc_Barrier )( void );
230 
231 
243  int
244  ( * SCOREP_Ipc_Bcast )( void* buf,
245  int count,
246  SCOREP_Ipc_Datatype datatype,
247  int root );
248 
266  int
267  ( * SCOREP_Ipc_Gather )( const void* sendbuf,
268  void* recvbuf,
269  int count,
270  SCOREP_Ipc_Datatype datatype,
271  int root );
272 
273 
292  int
293  ( * SCOREP_Ipc_Gatherv )( const void* sendbuf,
294  int sendcount,
295  void* recvbuf,
296  const int* recvcnts,
297  SCOREP_Ipc_Datatype datatype,
298  int root );
299 
300 
315  int
316  ( * SCOREP_Ipc_Allgather )( const void* sendbuf,
317  void* recvbuf,
318  int count,
319  SCOREP_Ipc_Datatype datatype );
320 
335  int
336  ( * SCOREP_Ipc_Reduce )( const void* sendbuf,
337  void* recvbuf,
338  int count,
339  SCOREP_Ipc_Datatype datatype,
340  SCOREP_Ipc_Operation operation,
341  int root );
342 
343 
357  int
358  ( * SCOREP_Ipc_Allreduce )( const void* sendbuf,
359  void* recvbuf,
360  int count,
361  SCOREP_Ipc_Datatype datatype,
362  SCOREP_Ipc_Operation operation );
363 
376  int
377  ( * SCOREP_Ipc_Scatter )( const void* sendbuf,
378  void* recvbuf,
379  int count,
380  SCOREP_Ipc_Datatype datatype,
381  int root );
382 
383 
398  int
399  ( * SCOREP_Ipc_Scatterv )( const void* sendbuf,
400  const int* sendcounts,
401  void* recvbuf,
402  int recvcount,
403  SCOREP_Ipc_Datatype datatype,
404  int root );
411  ( * SCOREP_Location_GetType )( const struct SCOREP_Location* locationData );
412 
418  const char*
419  ( *SCOREP_Location_GetName )( const struct SCOREP_Location* locationData );
420 
421 
428  uint32_t
429  ( * SCOREP_Location_GetId )( const struct SCOREP_Location* locationData );
430 
437  uint64_t
438  ( * SCOREP_Location_GetGlobalId )( const struct SCOREP_Location* locationData );
439 
448  void
449  ( * SCOREP_Location_SetData )( const struct SCOREP_Location* locationData,
450  size_t plugin_id,
451  void* data );
452 
461  void*
462  ( *SCOREP_Location_GetData )( const struct SCOREP_Location* locationData,
463  size_t plugin_id );
464 
471  ( * SCOREP_CallingContextHandle_GetRegion )( SCOREP_CallingContextHandle handle );
472 
478  SCOREP_CallingContextHandle
479  ( * SCOREP_CallingContextHandle_GetParent )( SCOREP_CallingContextHandle handle );
480 
489 
495  const char*
496  ( *SCOREP_MetricHandle_GetName )( SCOREP_MetricHandle handle );
497 
506 
515 
524 
533 
539  const char*
540  ( *SCOREP_ParadigmHandle_GetName )( SCOREP_ParadigmHandle handle );
541 
550 
556  const char*
557  ( *SCOREP_ParameterHandle_GetName )( SCOREP_ParameterHandle handle );
558 
559 
567  ( * SCOREP_ParameterHandle_GetType )( SCOREP_ParameterHandle handle );
568 
569 
575  uint32_t
577 
583  const char*
584  ( *SCOREP_RegionHandle_GetName )( SCOREP_RegionHandle handle );
585 
591  const char*
592  ( *SCOREP_RegionHandle_GetCanonicalName )( SCOREP_RegionHandle handle );
593 
599  const char*
600  ( *SCOREP_RegionHandle_GetFileName )( SCOREP_RegionHandle handle );
601 
609 
617 
626 
635 
642 
648  const SCOREP_MetricHandle* ( *SCOREP_SamplingSetHandle_GetMetricHandles )( SCOREP_SamplingSetHandle handle );
649 
656 
663 
670 
677 
683  const char*
684  ( *SCOREP_SourceFileHandle_GetName )( SCOREP_SourceFileHandle handle );
685 
691  const char*
692  ( *SCOREP_StringHandle_Get )( SCOREP_StringHandle handle );
693 
702  void
703  ( * SCOREP_Metric_WriteStrictlySynchronousMetrics )( struct SCOREP_Location* location,
704  uint64_t timestamp,
706 
715  void
716  ( * SCOREP_Metric_WriteSynchronousMetrics )( struct SCOREP_Location* location,
717  uint64_t timestamp,
719 
727  void
728  ( * SCOREP_Metric_WriteAsynchronousMetrics )( struct SCOREP_Location* location,
731 
732 
774 {
779  uint32_t plugin_version;
780 
786  int ( * init )( void );
787 
798  void ( * assign_id )( size_t pluginId );
799 
805  void ( * init_mpp )( void );
806 
810  void ( * finalize )( void );
811 
835  void ( * create_location )( const struct SCOREP_Location* location,
836  const struct SCOREP_Location* parentLocation );
837 
848  void ( * activate_cpu_location )( const struct SCOREP_Location* location,
849  const struct SCOREP_Location* parentLocation,
850  uint32_t forkSequenceCount );
851 
860  void ( * deactivate_cpu_location )( const struct SCOREP_Location* location,
861  const struct SCOREP_Location* parentLocation );
862 
869  void ( * delete_location )( const struct SCOREP_Location* location );
870 
875  void ( * pre_unify )( void );
876 
882  void ( * write_data )( void );
883 
890  void ( * core_task_create )( const struct SCOREP_Location* location,
891  SCOREP_TaskHandle taskHandle );
892 
893 
900  void ( * core_task_complete )( const struct SCOREP_Location* location,
901  SCOREP_TaskHandle taskHandle );
902 
916  SCOREP_HandleType type );
917 
928  SCOREP_Substrates_Callback** functions );
929 
935  void ( * set_callbacks )( const SCOREP_SubstratePluginCallbacks* callbacks,
936  size_t size );
937 
948 
960 
961 #endif /* SCOREP_SUBSTRATE_PLUGINS_H */
SCOREP_AnyHandle SCOREP_SamplingSetHandle
Definition: SCOREP_PublicTypes.h:109
struct SCOREP_Task * SCOREP_TaskHandle
Definition: SCOREP_PublicTypes.h:145
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:316
bool(* SCOREP_SamplingSetHandle_IsScoped)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:662
uint64_t(* SCOREP_Location_GetGlobalId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:438
SCOREP_AnyHandle SCOREP_SourceFileHandle
Definition: SCOREP_PublicTypes.h:84
Definition: SCOREP_SubstratePlugins.h:152
void(* core_task_create)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:890
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:336
SCOREP_HandleType
Definition: SCOREP_PublicHandles.h:50
SCOREP_AnyHandle SCOREP_MetricHandle
Definition: SCOREP_PublicTypes.h:96
SCOREP_CallingContextHandle(* SCOREP_CallingContextHandle_GetParent)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:479
int(* SCOREP_Ipc_Gather)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:267
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:860
void(* write_data)(void)
Definition: SCOREP_SubstratePlugins.h:882
int(* SCOREP_Ipc_Bcast)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:244
void(* SCOREP_Location_SetData)(const struct SCOREP_Location *locationData, size_t plugin_id, void *data)
Definition: SCOREP_SubstratePlugins.h:449
SCOREP_MetricSourceType(* SCOREP_MetricHandle_GetSourceType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:523
int(* SCOREP_Ipc_Recv)(void *buf, int count, SCOREP_Ipc_Datatype datatype, int source)
Definition: SCOREP_SubstratePlugins.h:215
uint8_t(* SCOREP_SamplingSetHandle_GetNumberOfMetrics)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:641
SCOREP_MetricValueType
Definition: SCOREP_MetricTypes.h:97
void(* finalize)(void)
Definition: SCOREP_SubstratePlugins.h:810
SCOREP_Substrates_RequirementFlag
Definition: SCOREP_PublicTypes.h:672
int(* SCOREP_Ipc_GetSize)(void)
Definition: SCOREP_SubstratePlugins.h:171
SCOREP_MetricMode(* SCOREP_MetricHandle_GetMode)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:514
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:927
SCOREP_AnyHandle SCOREP_ParadigmHandle
Definition: SCOREP_PublicTypes.h:133
int(* SCOREP_Ipc_Scatterv)(const void *sendbuf, const int *sendcounts, void *recvbuf, int recvcount, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:399
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:728
uint32_t plugin_version
Definition: SCOREP_SubstratePlugins.h:779
SCOREP_ParadigmType
defines paradigms that are be monitored
Definition: SCOREP_PublicTypes.h:309
SCOREP_MetricMode
Definition: SCOREP_MetricTypes.h:133
void(* core_task_complete)(const struct SCOREP_Location *location, SCOREP_TaskHandle taskHandle)
Definition: SCOREP_SubstratePlugins.h:900
void(* init_mpp)(void)
Definition: SCOREP_SubstratePlugins.h:805
SCOREP_LineNo(* SCOREP_RegionHandle_GetBeginLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:608
int(* SCOREP_Ipc_Send)(const void *buf, int count, SCOREP_Ipc_Datatype datatype, int dest)
Definition: SCOREP_SubstratePlugins.h:196
SCOREP_ParadigmClass(* SCOREP_ParadigmHandle_GetClass)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:532
void(* pre_unify)(void)
Definition: SCOREP_SubstratePlugins.h:875
SCOREP_Substrates_Mode
Definition: SCOREP_SubstrateEvents.h:55
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:411
void(* activate_cpu_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation, uint32_t forkSequenceCount)
Definition: SCOREP_SubstratePlugins.h:848
SCOREP_MetricSourceType
Definition: SCOREP_MetricTypes.h:53
SCOREP_RegionHandle(* SCOREP_CallingContextHandle_GetRegion)(SCOREP_CallingContextHandle handle)
Definition: SCOREP_SubstratePlugins.h:471
int(* SCOREP_Ipc_Allreduce)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, SCOREP_Ipc_Operation operation)
Definition: SCOREP_SubstratePlugins.h:358
SCOREP_MetricScope(* SCOREP_SamplingSetHandle_GetScope)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:669
int(* SCOREP_Ipc_Scatter)(const void *sendbuf, void *recvbuf, int count, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:377
SCOREP_LineNo(* SCOREP_RegionHandle_GetEndLine)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:616
SCOREP_MetricValueType(* SCOREP_MetricHandle_GetValueType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:488
int(* init)(void)
Definition: SCOREP_SubstratePlugins.h:786
SCOREP_ParadigmType(* SCOREP_RegionHandle_GetParadigmType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:634
uint32_t SCOREP_LineNo
Definition: SCOREP_PublicTypes.h:51
SCOREP_RegionType(* SCOREP_RegionHandle_GetType)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:625
SCOREP_SamplingSetClass
Class of locations which recorded a sampling set.
Definition: SCOREP_PublicTypes.h:548
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:716
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:703
bool(* get_requirement)(SCOREP_Substrates_RequirementFlag flag)
Definition: SCOREP_SubstratePlugins.h:947
SCOREP_Ipc_Operation
specifies an inter process communication operation for reduce function
Definition: SCOREP_PublicTypes.h:651
SCOREP_Allocator_MovableMemory SCOREP_AnyHandle
Definition: SCOREP_PublicTypes.h:78
int(* SCOREP_Ipc_GetRank)(void)
Definition: SCOREP_SubstratePlugins.h:181
SCOREP_ParameterType
defines types to be used in defining a parameter for parameter based profiling (SCOREP_Definitions_Ne...
Definition: SCOREP_PublicTypes.h:326
int(* SCOREP_Ipc_Gatherv)(const void *sendbuf, int sendcount, void *recvbuf, const int *recvcnts, SCOREP_Ipc_Datatype datatype, int root)
Definition: SCOREP_SubstratePlugins.h:293
void(* create_location)(const struct SCOREP_Location *location, const struct SCOREP_Location *parentLocation)
Definition: SCOREP_SubstratePlugins.h:835
SCOREP_ParadigmType(* SCOREP_ParadigmHandle_GetType)(SCOREP_ParadigmHandle handle)
Definition: SCOREP_SubstratePlugins.h:549
SCOREP_ParadigmClass
defines classes of paradigms that are monitored Types:
Definition: SCOREP_PublicTypes.h:259
SCOREP_MetricProfilingType
Definition: SCOREP_MetricTypes.h:76
uint32_t(* SCOREP_RegionHandle_GetId)(SCOREP_RegionHandle handle)
Definition: SCOREP_SubstratePlugins.h:576
uint32_t(* SCOREP_Location_GetId)(const struct SCOREP_Location *locationData)
Definition: SCOREP_SubstratePlugins.h:429
void(* assign_id)(size_t pluginId)
Definition: SCOREP_SubstratePlugins.h:798
Definition: SCOREP_SubstratePlugins.h:773
SCOREP_ParameterType(* SCOREP_ParameterHandle_GetType)(SCOREP_ParameterHandle handle)
Definition: SCOREP_SubstratePlugins.h:567
#define SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS
Definition: SCOREP_SubstratePlugins.h:132
SCOREP_Ipc_Datatype
specifies an inter process communication data types
Definition: SCOREP_PublicTypes.h:623
void(* undeclared[SCOREP_SUBSTRATE_PLUGIN_UNDEFINED_MANAGEMENT_FUNCTIONS])(void)
Definition: SCOREP_SubstratePlugins.h:958
void(* delete_location)(const struct SCOREP_Location *location)
Definition: SCOREP_SubstratePlugins.h:869
void(* SCOREP_Substrates_WriteMetricsCb)(struct SCOREP_Location *location, uint64_t timestamp, SCOREP_SamplingSetHandle samplingSet, const uint64_t *metricValues)
Definition: SCOREP_SubstrateEvents.h:1397
SCOREP_MetricOccurrence(* SCOREP_SamplingSetHandle_GetMetricOccurrence)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:655
void(* new_definition_handle)(SCOREP_AnyHandle handle, SCOREP_HandleType type)
Definition: SCOREP_SubstratePlugins.h:915
SCOREP_AnyHandle SCOREP_RegionHandle
Definition: SCOREP_PublicTypes.h:121
SCOREP_MetricScope
Types to be used in defining the scope of a scoped sampling set.
Definition: SCOREP_PublicTypes.h:560
int(* SCOREP_Ipc_Barrier)(void)
Definition: SCOREP_SubstratePlugins.h:229
SCOREP_MetricProfilingType(* SCOREP_MetricHandle_GetProfilingType)(SCOREP_MetricHandle handle)
Definition: SCOREP_SubstratePlugins.h:505
void(* set_callbacks)(const SCOREP_SubstratePluginCallbacks *callbacks, size_t size)
Definition: SCOREP_SubstratePlugins.h:935
SCOREP_LocationType
Definition: SCOREP_PublicTypes.h:190
SCOREP_SamplingSetClass(* SCOREP_SamplingSetHandle_GetSamplingSetClass)(SCOREP_SamplingSetHandle handle)
Definition: SCOREP_SubstratePlugins.h:676
SCOREP_MetricOccurrence
Types to be used in defining the occurrence of a sampling set.
Definition: SCOREP_PublicTypes.h:579
SCOREP_RegionType
specifies a Region
Definition: SCOREP_PublicTypes.h:430