source: CIVL/examples/xsbench/src/XSbench_header.h@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[788bdd2]1#ifndef __XSBENCH_HEADER_H__
2#define __XSBENCH_HEADER_H__
3
4#include<stdio.h>
5#include<stdlib.h>
6#include<time.h>
7#include<string.h>
8#include<strings.h>
9#include<math.h>
10#include<omp.h>
11#include<unistd.h>
12//#include<sys/time.h> // SFS: commented out, already have time.h
13
14// Papi Header
15#ifdef PAPI
16#include "papi.h"
17#endif
18
19// I/O Specifiers
20#define INFO 1
21#define DEBUG 1
22#define SAVE 1
23
24// Structures
25typedef struct{
26 double energy;
27 double total_xs;
28 double elastic_xs;
29 double absorbtion_xs;
30 double fission_xs;
31 double nu_fission_xs;
32} NuclideGridPoint;
33
34typedef struct{
35 double energy;
36 int * xs_ptrs;
37} GridPoint;
38
39typedef struct{
40 int nthreads;
41 long n_isotopes;
42 long n_gridpoints;
43 int lookups;
44 char * HM;
45} Inputs;
46
47// Function Prototypes
48void logo(int version);
49void center_print(const char *s, int width);
50void border_print(void);
51void fancy_int(long a);
52
53NuclideGridPoint ** gpmatrix(size_t m, size_t n);
54
55void gpmatrix_free( NuclideGridPoint ** M );
56
57int NGP_compare( const void * a, const void * b );
58
59void generate_grids( NuclideGridPoint ** nuclide_grids,
60 long n_isotopes, long n_gridpoints );
61void generate_grids_v( NuclideGridPoint ** nuclide_grids,
62 long n_isotopes, long n_gridpoints );
63
64void sort_nuclide_grids( NuclideGridPoint ** nuclide_grids, long n_isotopes,
65 long n_gridpoints );
66
67GridPoint * generate_energy_grid( long n_isotopes, long n_gridpoints,
68 NuclideGridPoint ** nuclide_grids);
69
70void set_grid_ptrs( GridPoint * energy_grid, NuclideGridPoint ** nuclide_grids,
71 long n_isotopes, long n_gridpoints );
72
73int binary_search( NuclideGridPoint * A, double quarry, int n );
74
75void calculate_macro_xs( double p_energy, int mat, long n_isotopes,
76 long n_gridpoints, int * restrict num_nucs,
77 double ** restrict concs,
78 GridPoint * restrict energy_grid,
79 NuclideGridPoint ** restrict nuclide_grids,
80 int ** restrict mats,
81 double * restrict macro_xs_vector );
82
83void calculate_micro_xs( double p_energy, int nuc, long n_isotopes,
84 long n_gridpoints,
85 GridPoint * restrict energy_grid,
86 NuclideGridPoint ** restrict nuclide_grids, int idx,
87 double * restrict xs_vector );
88
89long grid_search( long n, double quarry, GridPoint * A);
90
91int * load_num_nucs(long n_isotopes);
92int ** load_mats( int * num_nucs, long n_isotopes );
93double ** load_concs( int * num_nucs );
94double ** load_concs_v( int * num_nucs );
95int pick_mat(unsigned long * seed);
96double rn(unsigned long * seed);
97int rn_int(unsigned long * seed);
98void counter_stop( int * eventset, int num_papi_events );
99void counter_init( int * eventset, int * num_papi_events );
100void do_flops(void);
101void do_loads( int nuc,
102 NuclideGridPoint ** restrict nuclide_grids,
103 long n_gridpoints );
104Inputs read_CLI( int argc, char * argv[] );
105void print_CLI_error(void);
106double rn_v(void);
107double round_double( double input );
108unsigned int hash(unsigned char *str, int nbins);
109size_t estimate_mem_usage( Inputs in );
110void print_inputs(Inputs in, int nprocs, int version);
111void print_results( Inputs in, int mype, double runtime, int nprocs, unsigned long long vhash );
112void binary_dump(long n_isotopes, long n_gridpoints, NuclideGridPoint ** nuclide_grids, GridPoint * energy_grid);
113void binary_read(long n_isotopes, long n_gridpoints, NuclideGridPoint ** nuclide_grids, GridPoint * energy_grid);
114
115#endif
Note: See TracBrowser for help on using the repository browser.