1.4 (revision 3771)
otf2/OTF2_Callbacks.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the Score-P software (http://www.score-p.org)
00003  *
00004  * Copyright (c) 2009-2012,
00005  * RWTH Aachen University, Germany
00006  *
00007  * Copyright (c) 2009-2012,
00008  * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
00009  *
00010  * Copyright (c) 2009-2014,
00011  * Technische Universitaet Dresden, Germany
00012  *
00013  * Copyright (c) 2009-2012,
00014  * University of Oregon, Eugene, USA
00015  *
00016  * Copyright (c) 2009-2012,
00017  * Forschungszentrum Juelich GmbH, Germany
00018  *
00019  * Copyright (c) 2009-2012,
00020  * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
00021  *
00022  * Copyright (c) 2009-2012,
00023  * Technische Universitaet Muenchen, Germany
00024  *
00025  * This software may be modified and distributed under the terms of
00026  * a BSD-style license.  See the COPYING file in the package base
00027  * directory for details.
00028  *
00029  */
00030 
00031 
00032 #ifndef OTF2_CALLBACKS_H
00033 #define OTF2_CALLBACKS_H
00034 
00035 
00043 #ifndef __cplusplus
00044 #include <stdbool.h>
00045 #endif
00046 
00047 
00048 #include <otf2/OTF2_ErrorCodes.h>
00049 
00050 
00051 #include <otf2/OTF2_GeneralDefinitions.h>
00052 
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif /* __cplusplus */
00057 
00058 
00109 typedef OTF2_FlushType
00110 ( *OTF2_PreFlushCallback )( void*            userData,
00111                             OTF2_FileType    fileType,
00112                             OTF2_LocationRef location,
00113                             void*            callerData,
00114                             bool             final );
00115 
00116 
00132 typedef OTF2_TimeStamp
00133 ( *OTF2_PostFlushCallback )( void*            userData,
00134                              OTF2_FileType    fileType,
00135                              OTF2_LocationRef location );
00136 
00137 
00145 typedef struct OTF2_FlushCallbacks
00146 {
00148     OTF2_PreFlushCallback  otf2_pre_flush;
00150     OTF2_PostFlushCallback otf2_post_flush;
00151 } OTF2_FlushCallbacks;
00152 
00153 
00193 typedef void*
00194 ( *OTF2_MemoryAllocate )( void*            userData,
00195                           OTF2_FileType    fileType,
00196                           OTF2_LocationRef location,
00197                           void**           perBufferData,
00198                           uint64_t         chunkSize );
00199 
00200 
00224 typedef void
00225 ( *OTF2_MemoryFreeAll )( void*            userData,
00226                          OTF2_FileType    fileType,
00227                          OTF2_LocationRef location,
00228                          void**           perBufferData,
00229                          bool             final );
00230 
00231 
00236 typedef struct OTF2_MemoryCallbacks
00237 {
00239     OTF2_MemoryAllocate otf2_allocate;
00241     OTF2_MemoryFreeAll  otf2_free_all;
00242 } OTF2_MemoryCallbacks;
00243 
00244 
00295 typedef struct OTF2_CollectiveContext OTF2_CollectiveContext;
00296 
00297 
00298 #define OTF2_COLLECTIVES_ROOT 0
00299 
00300 
00308 typedef OTF2_CallbackCode
00309 ( *OTF2_Collectives_GetSize )( void*                   userData,
00310                                OTF2_CollectiveContext* commContext,
00311                                uint32_t*               size );
00312 
00313 
00322 typedef OTF2_CallbackCode
00323 ( *OTF2_Collectives_GetRank )( void*                   userData,
00324                                OTF2_CollectiveContext* commContext,
00325                                uint32_t*               rank );
00326 
00327 
00338 typedef OTF2_CallbackCode
00339 ( *OTF2_Collectives_CreateLocalComm )( void*                    userData,
00340                                        OTF2_CollectiveContext** localCommContext,
00341                                        OTF2_CollectiveContext*  globalCommContext,
00342                                        uint32_t                 globalRank,
00343                                        uint32_t                 globalSize,
00344                                        uint32_t                 localRank,
00345                                        uint32_t                 localSize,
00346                                        uint32_t                 fileNumber,
00347                                        uint32_t                 numberOfFiles );
00348 
00349 
00357 typedef OTF2_CallbackCode
00358 ( *OTF2_Collectives_FreeLocalComm )( void*                   userData,
00359                                      OTF2_CollectiveContext* localCommContext );
00360 
00361 
00368 typedef OTF2_CallbackCode
00369 ( *OTF2_Collectives_Barrier )( void*                   userData,
00370                                OTF2_CollectiveContext* commContext );
00371 
00372 
00379 typedef OTF2_CallbackCode
00380 ( *OTF2_Collectives_Bcast )( void*                   userData,
00381                              OTF2_CollectiveContext* commContext,
00382                              void*                   data,
00383                              uint32_t                numberElements,
00384                              OTF2_Type               type,
00385                              uint32_t                root );
00386 
00387 
00396 typedef OTF2_CallbackCode
00397 ( *OTF2_Collectives_Gather )( void*                   userData,
00398                               OTF2_CollectiveContext* commContext,
00399                               const void*             inData,
00400                               void*                   outData,
00401                               uint32_t                numberElements,
00402                               OTF2_Type               type,
00403                               uint32_t                root );
00404 
00405 
00414 typedef OTF2_CallbackCode
00415 ( *OTF2_Collectives_Gatherv )( void*                   userData,
00416                                OTF2_CollectiveContext* commContext,
00417                                const void*             inData,
00418                                uint32_t                inElements,
00419                                void*                   outData,
00420                                const uint32_t*         outElements,
00421                                OTF2_Type               type,
00422                                uint32_t                root );
00423 
00424 
00433 typedef OTF2_CallbackCode
00434 ( *OTF2_Collectives_Scatter )( void*                   userData,
00435                                OTF2_CollectiveContext* commContext,
00436                                const void*             inData,
00437                                void*                   outData,
00438                                uint32_t                numberElements,
00439                                OTF2_Type               type,
00440                                uint32_t                root );
00441 
00442 
00451 typedef OTF2_CallbackCode
00452 ( *OTF2_Collectives_Scatterv )( void*                   userData,
00453                                 OTF2_CollectiveContext* commContext,
00454                                 const void*             inData,
00455                                 const uint32_t*         inElements,
00456                                 void*                   outData,
00457                                 uint32_t                outElements,
00458                                 OTF2_Type               type,
00459                                 uint32_t                root );
00460 
00461 
00470 typedef void
00471 ( *OTF2_Collectives_Release )( void*                   userData,
00472                                OTF2_CollectiveContext* globalCommContext,
00473                                OTF2_CollectiveContext* localCommContext );
00474 
00475 
00480 typedef struct OTF2_CollectiveCallbacks
00481 {
00482     OTF2_Collectives_Release         otf2_release;
00483     OTF2_Collectives_GetSize         otf2_get_size;
00484     OTF2_Collectives_GetRank         otf2_get_rank;
00485     OTF2_Collectives_CreateLocalComm otf2_create_local_comm;
00486     OTF2_Collectives_FreeLocalComm   otf2_free_local_comm;
00487     OTF2_Collectives_Barrier         otf2_barrier;
00488     OTF2_Collectives_Bcast           otf2_bcast;
00489     OTF2_Collectives_Gather          otf2_gather;
00490     OTF2_Collectives_Gatherv         otf2_gatherv;
00491     OTF2_Collectives_Scatter         otf2_scatter;
00492     OTF2_Collectives_Scatterv        otf2_scatterv;
00493 } OTF2_CollectiveCallbacks;
00494 
00495 
00506 #ifdef __cplusplus
00507 }
00508 #endif /* __cplusplus */
00509 
00510 
00511 #endif /* !OTF2_CALLBACKS_H */