-
Notifications
You must be signed in to change notification settings - Fork 3
/
util.h
30 lines (23 loc) · 835 Bytes
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include <stdlib.h>
/* define useful debugging print macro */
#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__);
#else
#define debug(...) do ; while(0)
#endif
typedef struct {
int N, /* dim of matrix */
NZ, /* number of non-zero elements */
nz_count, /* number of matrix elements for each process */
nz_start_idx, /* first matrix element for each process */
row_count, /* number of rows to process for each process */
row_start_idx; /* first row processed for each process */
} proc_info_t;
void random_vec(double *v, int N, int limit);
void * malloc_or_exit(size_t size);
void * calloc_or_exit(size_t nmemb, size_t size);
char in_range(int num, int start, int count);
#endif