YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
perf_toy_common.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "yac.h"
#include "yac_utils.h"
#include "perf_toy_common.h"
Include dependency graph for perf_toy_common.c:

Go to the source code of this file.

Data Structures

struct  timer_data
 

Functions

void * start_timer (MPI_Comm comm, char const *fmt,...)
 Starts a timer and returns a pointer to the timer data.
 
void stop_timer (void *timer_)
 Stops the timer and prints the timing results.
 
void init_grid (int comp_id, char const *grid_name, char const *grid_filename, int *cell_point_id, int *corner_point_id)
 Initializes grid data and registers it with YAC.
 

Function Documentation

◆ init_grid()

void init_grid ( int comp_id,
char const * grid_name,
char const * grid_filename,
int * cell_point_id,
int * corner_point_id )

Initializes grid data and registers it with YAC.

Parameters
[in]comp_idThe component ID.
[in]grid_nameThe name of the grid.
[in]grid_filenameThe filename of the grid.
[out]cell_point_idPointer to the cell center point ID.
[out]corner_point_idPointer to the corner point ID.
Remarks
Supports all grid files that can be read by yac_read_icon_grid_information_parallel
The grid file is read by and decomposed among all processes of the component communicator.

Definition at line 80 of file perf_toy_common.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_timer()

void * start_timer ( MPI_Comm comm,
char const * fmt,
... )

Starts a timer and returns a pointer to the timer data.

Parameters
[in]commThe MPI communicator.
[in]fmtThe format string for the timer label.
[in]...Additional arguments for the format string.
Returns
A pointer to the timer data.

Definition at line 20 of file perf_toy_common.c.

Here is the caller graph for this function:

◆ stop_timer()

void stop_timer ( void * timer)

Stops the timer and prints the timing results.

Parameters
[in]timerA pointer to the timer data.
Remarks
This is a collective operation for all processes in the communicator used to start the timer.
The timing results are printed to stderr by the root process of the communicator.

Definition at line 44 of file perf_toy_common.c.

Here is the caller graph for this function: