1.5.1 (revision 4026)
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 
00196 typedef void*
00197 ( *OTF2_MemoryAllocate )( void*            userData,
00198                           OTF2_FileType    fileType,
00199                           OTF2_LocationRef location,
00200                           void**           perBufferData,
00201                           uint64_t         chunkSize );
00202 
00203 
00227 typedef void
00228 ( *OTF2_MemoryFreeAll )( void*            userData,
00229                          OTF2_FileType    fileType,
00230                          OTF2_LocationRef location,
00231                          void**           perBufferData,
00232                          bool             final );
00233 
00234 
00239 typedef struct OTF2_MemoryCallbacks
00240 {
00242     OTF2_MemoryAllocate otf2_allocate;
00244     OTF2_MemoryFreeAll  otf2_free_all;
00245 } OTF2_MemoryCallbacks;
00246 
00247 
00300 typedef struct OTF2_CollectiveContext OTF2_CollectiveContext;
00301 
00302 
00303 #define OTF2_COLLECTIVES_ROOT 0
00304 
00305 
00313 typedef OTF2_CallbackCode
00314 ( *OTF2_Collectives_GetSize )( void*                   userData,
00315                                OTF2_CollectiveContext* commContext,
00316                                uint32_t*               size );
00317 
00318 
00327 typedef OTF2_CallbackCode
00328 ( *OTF2_Collectives_GetRank )( void*                   userData,
00329                                OTF2_CollectiveContext* commContext,
00330                                uint32_t*               rank );
00331 
00332 
00343 typedef OTF2_CallbackCode
00344 ( *OTF2_Collectives_CreateLocalComm )( void*                    userData,
00345                                        OTF2_CollectiveContext** localCommContext,
00346                                        OTF2_CollectiveContext*  globalCommContext,
00347                                        uint32_t                 globalRank,
00348                                        uint32_t                 globalSize,
00349                                        uint32_t                 localRank,
00350                                        uint32_t                 localSize,
00351                                        uint32_t                 fileNumber,
00352                                        uint32_t                 numberOfFiles );
00353 
00354 
00362 typedef OTF2_CallbackCode
00363 ( *OTF2_Collectives_FreeLocalComm )( void*                   userData,
00364                                      OTF2_CollectiveContext* localCommContext );
00365 
00366 
00373 typedef OTF2_CallbackCode
00374 ( *OTF2_Collectives_Barrier )( void*                   userData,
00375                                OTF2_CollectiveContext* commContext );
00376 
00377 
00384 typedef OTF2_CallbackCode
00385 ( *OTF2_Collectives_Bcast )( void*                   userData,
00386                              OTF2_CollectiveContext* commContext,
00387                              void*                   data,
00388                              uint32_t                numberElements,
00389                              OTF2_Type               type,
00390                              uint32_t                root );
00391 
00392 
00401 typedef OTF2_CallbackCode
00402 ( *OTF2_Collectives_Gather )( void*                   userData,
00403                               OTF2_CollectiveContext* commContext,
00404                               const void*             inData,
00405                               void*                   outData,
00406                               uint32_t                numberElements,
00407                               OTF2_Type               type,
00408                               uint32_t                root );
00409 
00410 
00419 typedef OTF2_CallbackCode
00420 ( *OTF2_Collectives_Gatherv )( void*                   userData,
00421                                OTF2_CollectiveContext* commContext,
00422                                const void*             inData,
00423                                uint32_t                inElements,
00424                                void*                   outData,
00425                                const uint32_t*         outElements,
00426                                OTF2_Type               type,
00427                                uint32_t                root );
00428 
00429 
00438 typedef OTF2_CallbackCode
00439 ( *OTF2_Collectives_Scatter )( void*                   userData,
00440                                OTF2_CollectiveContext* commContext,
00441                                const void*             inData,
00442                                void*                   outData,
00443                                uint32_t                numberElements,
00444                                OTF2_Type               type,
00445                                uint32_t                root );
00446 
00447 
00456 typedef OTF2_CallbackCode
00457 ( *OTF2_Collectives_Scatterv )( void*                   userData,
00458                                 OTF2_CollectiveContext* commContext,
00459                                 const void*             inData,
00460                                 const uint32_t*         inElements,
00461                                 void*                   outData,
00462                                 uint32_t                outElements,
00463                                 OTF2_Type               type,
00464                                 uint32_t                root );
00465 
00466 
00475 typedef void
00476 ( *OTF2_Collectives_Release )( void*                   userData,
00477                                OTF2_CollectiveContext* globalCommContext,
00478                                OTF2_CollectiveContext* localCommContext );
00479 
00480 
00485 typedef struct OTF2_CollectiveCallbacks
00486 {
00487     OTF2_Collectives_Release         otf2_release;
00488     OTF2_Collectives_GetSize         otf2_get_size;
00489     OTF2_Collectives_GetRank         otf2_get_rank;
00490     OTF2_Collectives_CreateLocalComm otf2_create_local_comm;
00491     OTF2_Collectives_FreeLocalComm   otf2_free_local_comm;
00492     OTF2_Collectives_Barrier         otf2_barrier;
00493     OTF2_Collectives_Bcast           otf2_bcast;
00494     OTF2_Collectives_Gather          otf2_gather;
00495     OTF2_Collectives_Gatherv         otf2_gatherv;
00496     OTF2_Collectives_Scatter         otf2_scatter;
00497     OTF2_Collectives_Scatterv        otf2_scatterv;
00498 } OTF2_CollectiveCallbacks;
00499 
00500 
00538 typedef struct OTF2_LockObject* OTF2_Lock;
00539 
00540 
00552 typedef OTF2_CallbackCode
00553 ( *OTF2_Locking_Create )( void*      userData,
00554                           OTF2_Lock* lock );
00555 
00556 
00568 typedef OTF2_CallbackCode
00569 ( *OTF2_Locking_Destroy )( void*     userData,
00570                            OTF2_Lock lock );
00571 
00572 
00584 typedef OTF2_CallbackCode
00585 ( *OTF2_Locking_Lock )( void*     userData,
00586                         OTF2_Lock lock );
00587 
00588 
00600 typedef OTF2_CallbackCode
00601 ( *OTF2_Locking_Unlock )( void*     userData,
00602                           OTF2_Lock lock );
00603 
00604 
00612 typedef void
00613 ( *OTF2_Locking_Release )( void* userData );
00614 
00615 
00620 typedef struct OTF2_LockingCallbacks
00621 {
00622     OTF2_Locking_Release otf2_release;
00623     OTF2_Locking_Create  otf2_create;
00624     OTF2_Locking_Destroy otf2_destroy;
00625     OTF2_Locking_Lock    otf2_lock;
00626     OTF2_Locking_Unlock  otf2_unlock;
00627 } OTF2_LockingCallbacks;
00628 
00629 
00640 #ifdef __cplusplus
00641 }
00642 #endif /* __cplusplus */
00643 
00644 
00645 #endif /* !OTF2_CALLBACKS_H */