#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#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,
{
printf( "Entering region %u at location %" PRIu64 " at time %" PRIu64 ".\n",
region, location, time );
}
void* userData,
{
printf( "Leaving region %u at location %" PRIu64 " at time %" PRIu64 ".\n",
region, location, time );
}
struct vector
{
size_t capacity;
size_t size;
uint64_t members[];
};
GlobDefLocation_Register( void* userData,
uint64_t numberOfEvents,
{
struct vector* locations = userData;
if ( locations->size == locations->capacity )
{
}
locations->members[ locations->size++ ] = 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 );
struct vector* locations = malloc( sizeof( *locations )
+ number_of_locations
* sizeof( *locations->members ) );
locations->capacity = number_of_locations;
locations->size = 0;
&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 ( size_t i = 0; i < locations->size; i++ )
{
if ( locations->members[ i ] % size != rank )
{
continue;
}
number_of_locations_to_read++;
}
bool successful_open_def_files =
for ( size_t i = 0; i < locations->size; i++ )
{
if ( locations->members[ 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 );
}
free( locations );
MPI_Finalize();
return EXIT_SUCCESS;
}