#include <stdlib.h>
#include <iostream>
#include <vector>
#include <mpi.h>
#if MPI_VERSION < 3
#define OTF2_MPI_UINT64_T MPI_UNSIGNED_LONG
#define OTF2_MPI_INT64_T MPI_LONG
#endif
void* userData,
{
std::cout << "Entering region " << region << " at location " << location << " at time " << time << std::endl;
}
void* userData,
{
std::cout << "Leaving region " << region << " at location " << location << " at time " << time << std::endl;
}
GlobDefLocation_Register( void* userData,
uint64_t numberOfEvents,
{
std::vector<OTF2_LocationRef>* locations =
( std::vector<OTF2_LocationRef>* )userData;
locations->push_back( location );
}
int
main( int argc,
char** argv )
{
MPI_Init( &argc, &argv );
int size;
MPI_Comm_size( MPI_COMM_WORLD, &size );
int rank;
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
uint64_t number_of_locations;
&number_of_locations );
std::vector<OTF2_LocationRef> locations;
locations.reserve( number_of_locations );
&GlobDefLocation_Register );
global_def_reader,
global_def_callbacks,
&locations );
uint64_t definitions_read = 0;
global_def_reader,
&definitions_read );
uint64_t number_of_locations_to_read = 0;
for ( std::size_t i = 0; i < locations.size(); i++ )
{
if ( locations[ i ] % size != rank )
{
continue;
}
number_of_locations_to_read++;
}
bool successful_open_def_files =
for ( std::size_t i = 0; i < locations.size(); i++ )
{
if ( locations[ i ] % size != rank )
{
continue;
}
if ( successful_open_def_files )
{
if ( def_reader )
{
uint64_t def_reads = 0;
def_reader,
&def_reads );
}
}
}
if ( successful_open_def_files )
{
}
if ( number_of_locations_to_read > 0 )
{
&Enter_print );
&Leave_print );
global_evt_reader,
event_callbacks,
NULL );
uint64_t events_read = 0;
global_evt_reader,
&events_read );
}
MPI_Finalize();
return EXIT_SUCCESS;
}