(git:0de0cc2)
grid_replay.c File Reference
#include <assert.h>
#include <fenv.h>
#include <limits.h>
#include <math.h>
#include <omp.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../offload/offload_buffer.h"
#include "common/grid_common.h"
#include "grid_replay.h"
#include "cpu/grid_cpu_collocate.h"
#include "cpu/grid_cpu_integrate.h"
#include "grid_task_list.h"

Go to the source code of this file.

Functions

static void read_next_line (char line[], int length, FILE *fp)
 Reads next line from given filehandle and handles errors. More...
 
static void parse_next_line (const char key[], FILE *fp, const char format[], const int nargs,...)
 Parses next line from file, expecting it to match "${key} ${format}". More...
 
static int parse_int (const char key[], FILE *fp)
 Shorthand for parsing a single integer value. More...
 
static void parse_int3 (const char key[], FILE *fp, int vec[3])
 Shorthand for parsing a vector of three integer values. More...
 
static double parse_double (const char key[], FILE *fp)
 Shorthand for parsing a single double value. More...
 
static void parse_double3 (const char key[], FILE *fp, double vec[3])
 Shorthand for parsing a vector of three double values. More...
 
static void parse_double3x3 (const char key[], FILE *fp, double mat[3][3])
 Shorthand for parsing a 3x3 matrix of doubles. More...
 
static void create_dummy_basis_set (const int size, const int lmin, const int lmax, const double zet, grid_basis_set **basis_set)
 Creates mock basis set using the identity as decontraction matrix. More...
 
static void create_dummy_task_list (const bool orthorhombic, const int border_mask, const double ra[3], const double rab[3], const double radius, const grid_basis_set *basis_set_a, const grid_basis_set *basis_set_b, const int o1, const int o2, const int la_max, const int lb_max, const int cycles, const int cycles_per_block, const int npts_global[][3], const int npts_local[][3], const int shift_local[][3], const int border_width[][3], const double dh[][3][3], const double dh_inv[][3][3], grid_task_list **task_list)
 Creates mock task list with one task per cycle. More...
 
bool grid_replay (const char *filename, const int cycles, const bool collocate, const bool batch, const int cycles_per_block, const double tolerance)
 Reads a .task file, collocates/integrates it, and compares results. See grid_replay.h for details. More...
 

Function Documentation

◆ read_next_line()

static void read_next_line ( char  line[],
int  length,
FILE *  fp 
)
static

Reads next line from given filehandle and handles errors.

Author
Ole Schuett

Definition at line 31 of file grid_replay.c.

Here is the caller graph for this function:

◆ parse_next_line()

static void parse_next_line ( const char  key[],
FILE *  fp,
const char  format[],
const int  nargs,
  ... 
)
static

Parses next line from file, expecting it to match "${key} ${format}".

Author
Ole Schuett

Definition at line 42 of file grid_replay.c.

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

◆ parse_int()

static int parse_int ( const char  key[],
FILE *  fp 
)
static

Shorthand for parsing a single integer value.

Author
Ole Schuett

Definition at line 67 of file grid_replay.c.

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

◆ parse_int3()

static void parse_int3 ( const char  key[],
FILE *  fp,
int  vec[3] 
)
static

Shorthand for parsing a vector of three integer values.

Author
Ole Schuett

Definition at line 77 of file grid_replay.c.

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

◆ parse_double()

static double parse_double ( const char  key[],
FILE *  fp 
)
static

Shorthand for parsing a single double value.

Author
Ole Schuett

Definition at line 85 of file grid_replay.c.

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

◆ parse_double3()

static void parse_double3 ( const char  key[],
FILE *  fp,
double  vec[3] 
)
static

Shorthand for parsing a vector of three double values.

Author
Ole Schuett

Definition at line 95 of file grid_replay.c.

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

◆ parse_double3x3()

static void parse_double3x3 ( const char  key[],
FILE *  fp,
double  mat[3][3] 
)
static

Shorthand for parsing a 3x3 matrix of doubles.

Author
Ole Schuett

Definition at line 103 of file grid_replay.c.

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

◆ create_dummy_basis_set()

static void create_dummy_basis_set ( const int  size,
const int  lmin,
const int  lmax,
const double  zet,
grid_basis_set **  basis_set 
)
static

Creates mock basis set using the identity as decontraction matrix.

Author
Ole Schuett

Definition at line 115 of file grid_replay.c.

Here is the call graph for this function:

◆ create_dummy_task_list()

static void create_dummy_task_list ( const bool  orthorhombic,
const int  border_mask,
const double  ra[3],
const double  rab[3],
const double  radius,
const grid_basis_set basis_set_a,
const grid_basis_set basis_set_b,
const int  o1,
const int  o2,
const int  la_max,
const int  lb_max,
const int  cycles,
const int  cycles_per_block,
const int  npts_global[][3],
const int  npts_local[][3],
const int  shift_local[][3],
const int  border_width[][3],
const double  dh[][3][3],
const double  dh_inv[][3][3],
grid_task_list **  task_list 
)
static

Creates mock task list with one task per cycle.

Author
Ole Schuett

Definition at line 155 of file grid_replay.c.

Here is the call graph for this function:

◆ grid_replay()

bool grid_replay ( const char *  filename,
const int  cycles,
const bool  collocate,
const bool  batch,
const int  cycles_per_block,
const double  tolerance 
)

Reads a .task file, collocates/integrates it, and compares results. See grid_replay.h for details.

Reads a .task file, collocates/integrates it, and compares results.

Author
Ole Schuett

Definition at line 222 of file grid_replay.c.

Here is the call graph for this function: