50 #define __FUNC__ "Vec_dhCreate"
64 #define __FUNC__ "Vec_dhDestroy"
77 #define __FUNC__ "Vec_dhInit"
87 #define __FUNC__ "Vec_dhCopy"
97 memcpy (y->
vals, x->
vals, x->
n * sizeof (
double));
102 #define __FUNC__ "Vec_dhDuplicate"
114 tmp->vals = (
double *)
MALLOC_DH (size *
sizeof (
double));
119 #define __FUNC__ "Vec_dhSet"
127 for (i = 0; i < m; ++i)
132 #define __FUNC__ "Vec_dhSetRand"
144 for (i = 0; i < m; ++i)
147 for (i = 0; i < m; ++i)
154 for (i = 0; i < m; ++i)
155 max =
MAX (max, vals[i]);
156 for (i = 0; i < m; ++i)
157 vals[i] = vals[i] / max;
162 #define __FUNC__ "Vec_dhPrint"
178 for (pe = 0; pe <
np_dh; ++pe)
194 for (i = 0; i < m; ++i)
195 fprintf (fp,
"%g\n", vals[i]);
213 for (i = 0; i < sg->
blocks; ++i)
216 int beg_row = sg->
beg_rowP[oldBlock];
217 int end_row = beg_row + sg->
row_count[oldBlock];
219 printf (
"seq: block= %i beg= %i end= %i\n", oldBlock, beg_row,
223 for (j = beg_row; j < end_row; ++j)
225 fprintf (fp,
"%g\n", vals[j]);
236 for (pe = 0; pe <
np_dh; ++pe)
252 fprintf (stderr,
"par: block= %i\n",
id);
254 for (i = 0; i < m; ++i)
256 fprintf (fp,
"%g\n", vals[i]);
268 #define __FUNC__ "Vec_dhPrintBIN"
274 SET_V_ERROR (
"only implemented for a single MPI task");
278 SET_V_ERROR (
"not implemented for reordered vector; ensure sg=NULL");
288 #define __FUNC__ "Vec_dhRead"
304 SET_V_ERROR (
"only implemented for a single MPI task");
313 printf (
"Vec_dhRead:: ignoring following header lines:\n");
315 (
"--------------------------------------------------------------\n");
316 for (i = 0; i < ignore; ++i)
322 (
"--------------------------------------------------------------\n");
329 items = fscanf (fp,
"%lg", &w);
337 printf (
"Vec_dhRead:: n= %i\n", n);
341 v = tmp->vals = (
double *)
MALLOC_DH (n *
sizeof (
double));
347 for (i = 0; i < ignore; ++i)
353 for (i = 0; i <
n; ++i)
355 items = fscanf (fp,
"%lg", v + i);
358 sprintf (
msgBuf_dh,
"failed to read value %i of %i", i + 1, n);
367 #define __FUNC__ "Vec_dhReadBIN"
void Vec_dhSetRand(Vec_dh v)
void Vec_dhCopy(Vec_dh x, Vec_dh y)
void Vec_dhDestroy(Vec_dh v)
void Vec_dhSet(Vec_dh v, double value)
void Vec_dhDuplicate(Vec_dh v, Vec_dh *out)
void io_dh_read_ebin_vec_private(int *n, double **vals, char *filename)
void Vec_dhInit(Vec_dh v, int size)
void Vec_dhPrint(Vec_dh v, SubdomainGraph_dh sg, char *filename)
void Vec_dhReadBIN(Vec_dh *vout, char *filename)
void Vec_dhRead(Vec_dh *vout, int ignore, char *filename)
void io_dh_print_ebin_vec_private(int n, int beg_row, double *vals, int *n2o, int *o2n, Hash_i_dh hash, char *filename)
void closeFile_dh(FILE *fpIN)
void Vec_dhCreate(Vec_dh *v)
FILE * openFile_dh(const char *filenameIN, const char *modeIN)
char msgBuf_dh[MSG_BUF_SIZE_DH]
void Vec_dhPrintBIN(Vec_dh v, SubdomainGraph_dh sg, char *filename)