41
41
struct adios_read_hooks_struct * read_hooks; /* Save adios_read_hooks for each fopen for Matlab */
43
43
/* Group view information *//* Actual method provides the group names */
45
char ** group_namelist;
46
int * nvars_per_group; /* # of variables per each group */
47
int * nattrs_per_group; /* # of attributes per each group */
48
int group_in_view; /* 0..ngroups-1: selected group in view,
45
char ** group_namelist;
46
uint32_t * nvars_per_group; /* # of variables per each group */
47
uint32_t * nattrs_per_group; /* # of attributes per each group */
48
int group_in_view; /* 0..ngroups-1: selected group in view,
50
int group_varid_offset; /* offset of var IDs from specific group to full list
50
uint64_t group_varid_offset; /* offset of var IDs from specific group to full list
51
51
if a selected group is in view */
52
int group_attrid_offset;
53
int full_nvars; /* fp->nvars to save here for a group view */
54
char ** full_varnamelist; /* fp->var_namelist to save here if one group is viewed */
55
int full_nattrs; /* fp->nvars to save here for a group view */
56
char ** full_attrnamelist; /* fp->attr_namelist to save here if one group is viewed */
52
uint64_t group_attrid_offset;
53
uint32_t full_nvars; /* fp->nvars to save here for a group view */
54
char ** full_varnamelist; /* fp->var_namelist to save here if one group is viewed */
55
uint32_t full_nattrs; /* fp->nvars to save here for a group view */
56
char ** full_attrnamelist; /* fp->attr_namelist to save here if one group is viewed */
57
57
qhashtbl_t *hashtbl_vars; /* speed up search for var_namelist to varid */
59
59
// NCSU ALACRITY-ADIOS - Table of sub-requests issued by transform method
191
213
// NCSU ALACRITY-ADIOS - Initialize transform methods
192
214
adios_transform_read_init();
216
if (!adios_read_hooks[method].adios_read_open_fn) {
217
adios_error (err_invalid_read_method,
218
"Read method (=%d) passed to adios_read_open() is not provided "
219
"by this build of ADIOS.\n", (int)method);
194
223
internals->method = method;
195
224
internals->read_hooks = adios_read_hooks;
197
fp = adios_read_hooks[internals->method].adios_open_fn (fname, comm, lock_mode, timeout_sec);
226
fp = adios_read_hooks[internals->method].adios_read_open_fn (fname, comm, lock_mode, timeout_sec);
201
230
// create hashtable from the variable names as key and their index as value
202
int hashsize = fp->nvars;
203
if (fp->nvars > 100) hashsize = 100;
231
int hashsize = calc_hash_size(fp->nvars);
204
232
internals->hashtbl_vars = qhashtbl(hashsize);
205
233
for (i=0; i<fp->nvars; i++) {
206
234
internals->hashtbl_vars->put (internals->hashtbl_vars, fp->var_namelist[i],
207
(void *)i+1); // avoid 0 for error checking later
235
(void *)(i+1)); // avoid 0 for error checking later
210
238
//read mesh names from attributes for example the var is using a mesh named trimesh,
302
331
internals->method = method;
303
332
internals->read_hooks = adios_read_hooks;
305
fp = adios_read_hooks[internals->method].adios_open_file_fn (fname, comm);
334
if (!adios_read_hooks[internals->method].adios_read_open_file_fn) {
335
adios_error (err_invalid_read_method,
336
"Read method (=%d) passed to adios_read_open_file() is not provided "
337
"by this build of ADIOS.\n", (int)method);
340
fp = adios_read_hooks[internals->method].adios_read_open_file_fn (fname, comm);
309
344
// create hashtable from the variable names as key and their index as value
310
int hashsize = fp->nvars;
311
if (fp->nvars > 100) hashsize = 100;
345
int hashsize = calc_hash_size(fp->nvars);
312
346
internals->hashtbl_vars = qhashtbl(hashsize);
313
347
for (i=0; i<fp->nvars; i++) {
314
348
internals->hashtbl_vars->put (internals->hashtbl_vars, fp->var_namelist[i],
315
(void *)i+1); // avoid 0 for error checking later
349
(void *)(i+1)); // avoid 0 for error checking later
318
352
//read mesh names from attributes for example the var is using a mesh named trimesh,
1054
static double common_check_var_type_to_double (enum ADIOS_DATATYPES * type, void * value)
1058
if (*type == adios_real)
1059
data = *(float *)value;
1060
else if (*type == adios_double)
1061
data = *(double *)value;
1062
else if (*type == adios_byte)
1063
data = *(signed char *)value;
1064
else if (*type == adios_unsigned_byte)
1065
data = *(unsigned char *)value;
1066
else if (*type == adios_short)
1067
data = *(signed short *)value;
1068
else if (*type == adios_unsigned_short)
1069
data = *(unsigned short *)value;
1070
else if (*type == adios_integer)
1071
data = *(signed int *)value;
1072
else if (*type == adios_unsigned_integer)
1073
data = *(unsigned int *)value;
1074
else if (*type == adios_long)
1075
data = *(signed long long *)value;
1076
else if (*type == adios_unsigned_long)
1077
data = *(unsigned long long *)value;
1078
else if (*type == adios_unknown)
1080
adios_error (err_mesh_unifrom_invalid_var_type,
1081
"Provided var type is not supported. "
1082
"Var type only supports (unsigned) char, (unsigned) short, "
1083
"(unsigned) int,(unsigned) long long, float and double\n");
1088
static uint64_t common_check_var_type_to_uint64 (enum ADIOS_DATATYPES * type, void * value)
1092
if (*type == adios_real)
1093
data = *(float *)value;
1094
else if (*type == adios_double)
1095
data = *(double *)value;
1096
else if (*type == adios_byte)
1097
data = *(signed char *)value;
1098
else if (*type == adios_unsigned_byte)
1099
data = *(unsigned char *)value;
1100
else if (*type == adios_short)
1101
data = *(signed short *)value;
1102
else if (*type == adios_unsigned_short)
1103
data = *(unsigned short *)value;
1104
else if (*type == adios_integer)
1105
data = *(signed int *)value;
1106
else if (*type == adios_unsigned_integer)
1107
data = *(unsigned int *)value;
1108
else if (*type == adios_long)
1109
data = *(signed long long *)value;
1110
else if (*type == adios_unsigned_long)
1111
data = *(unsigned long long *)value;
1112
else if (*type == adios_unknown)
1114
adios_error (err_mesh_unifrom_invalid_var_type,
1115
"Provided var type is not supported. "
1116
"Var type only supports (unsigned) char, (unsigned) short, "
1117
"(unsigned) int,(unsigned) long long, float and double\n");
1122
static int common_check_var_type_to_int (enum ADIOS_DATATYPES * type, void * value)
1126
if (*type == adios_real)
1127
data = *(float *)value;
1128
else if (*type == adios_double)
1129
data = *(double *)value;
1130
else if (*type == adios_byte)
1131
data = *(signed char *)value;
1132
else if (*type == adios_unsigned_byte)
1133
data = *(unsigned char *)value;
1134
else if (*type == adios_short)
1135
data = *(signed short *)value;
1136
else if (*type == adios_unsigned_short)
1137
data = *(unsigned short *)value;
1138
else if (*type == adios_integer)
1139
data = *(signed int *)value;
1140
else if (*type == adios_unsigned_integer)
1141
data = *(unsigned int *)value;
1142
else if (*type == adios_long)
1143
data = *(signed long long *)value;
1144
else if (*type == adios_unsigned_long)
1145
data = *(unsigned long long *)value;
1146
else if (*type == adios_unknown)
1148
adios_error (err_mesh_unifrom_invalid_var_type,
1149
"Provided var type is not supported. "
1150
"Var type only supports (unsigned) char, (unsigned) short, "
1151
"(unsigned) int,(unsigned) long long, float and double\n");
1026
1155
int adios_get_uniform_mesh_attr (ADIOS_FILE * fp, ADIOS_MESH *meshinfo, char * attrs) //attr for origins-num(origins), spacings-num(spacings), maximums-num(maximums)
1029
1158
enum ADIOS_DATATYPES attr_type;
1031
1160
void * data = NULL;
1182
1311
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
1183
1312
if (!strcmp (attrs, "origins"))
1185
if (v->type == adios_real)
1186
meshinfo->uniform->origins[i] = *(float *)v->value;
1187
else if (v->type == adios_double)
1188
meshinfo->uniform->origins[i] = *(double *)v->value;
1189
else if (v->type == adios_byte)
1190
meshinfo->uniform->origins[i] = *(signed char *)v->value;
1191
else if (v->type == adios_unsigned_byte)
1192
meshinfo->uniform->origins[i] = *(unsigned char *)v->value;
1193
else if (v->type == adios_short)
1194
meshinfo->uniform->origins[i] = *(signed short *)v->value;
1195
else if (v->type == adios_unsigned_short)
1196
meshinfo->uniform->origins[i] = *(unsigned short *)v->value;
1197
else if (v->type == adios_integer)
1198
meshinfo->uniform->origins[i] = *(signed int *)v->value;
1199
else if (v->type == adios_unsigned_integer)
1200
meshinfo->uniform->origins[i] = *(unsigned int *)v->value;
1201
else if (v->type == adios_long)
1202
meshinfo->uniform->origins[i] = *(signed long long *)v->value;
1203
else if (v->type == adios_unsigned_long)
1204
meshinfo->uniform->origins[i] = *(unsigned long long *)v->value;
1314
adios_errno = err_no_error;
1315
meshinfo->uniform->origins[i] = common_check_var_type_to_double (&v->type, v->value);
1316
if (adios_errno < 0)
1207
adios_error (err_mesh_unifrom_invalid_var_type,
1208
"Uniform mesh %s origins support (unsigned) char, (unsigned) short, "
1209
"(unsigned) int,(unsigned) long long, float and double\n",
1211
1318
meshinfo->uniform = NULL;
1215
1322
else if (!strcmp (attrs, "maximums"))
1217
if (v->type == adios_real)
1218
meshinfo->uniform->maximums[i] = *(float *)v->value;
1219
else if (v->type == adios_double)
1220
meshinfo->uniform->maximums[i] = *(double *)v->value;
1221
else if (v->type == adios_byte)
1222
meshinfo->uniform->maximums[i] = *(signed char *)v->value;
1223
else if (v->type == adios_unsigned_byte)
1224
meshinfo->uniform->maximums[i] = *(unsigned char *)v->value;
1225
else if (v->type == adios_short)
1226
meshinfo->uniform->maximums[i] = *(signed short *)v->value;
1227
else if (v->type == adios_unsigned_short)
1228
meshinfo->uniform->maximums[i] = *(unsigned short *)v->value;
1229
else if (v->type == adios_integer)
1230
meshinfo->uniform->maximums[i] = *(signed int *)v->value;
1231
else if (v->type == adios_unsigned_integer)
1232
meshinfo->uniform->maximums[i] = *(unsigned int *)v->value;
1233
else if (v->type == adios_long)
1234
meshinfo->uniform->maximums[i] = *(signed long long *)v->value;
1235
else if (v->type == adios_unsigned_long)
1236
meshinfo->uniform->maximums[i] = *(unsigned long long *)v->value;
1324
adios_errno = err_no_error;
1325
meshinfo->uniform->maximums[i] = common_check_var_type_to_double (&v->type, v->value);
1326
if (adios_errno < 0)
1239
adios_error (err_mesh_unifrom_invalid_var_type,
1240
"Uniform mesh %s maximums support (unsigned) char, (unsigned) short, "
1241
"(unsigned) int, (unsigned) long long, float and double\n",
1243
1328
meshinfo->uniform = NULL;
1247
1332
else if (!strcmp (attrs, "spacings"))
1249
if (v->type == adios_real)
1250
meshinfo->uniform->spacings[i] = *(float *)v->value;
1251
else if (v->type == adios_double)
1252
meshinfo->uniform->spacings[i] = *(double *)v->value;
1253
else if (v->type == adios_byte)
1254
meshinfo->uniform->spacings[i] = *(signed char *)v->value;
1255
else if (v->type == adios_unsigned_byte)
1256
meshinfo->uniform->spacings[i] = *(unsigned char *)v->value;
1257
else if (v->type == adios_short)
1258
meshinfo->uniform->spacings[i] = *(signed short *)v->value;
1259
else if (v->type == adios_unsigned_short)
1260
meshinfo->uniform->spacings[i] = *(unsigned short *)v->value;
1261
else if (v->type == adios_integer)
1262
meshinfo->uniform->spacings[i] = *(signed int *)v->value;
1263
else if (v->type == adios_unsigned_integer)
1264
meshinfo->uniform->spacings[i] = *(unsigned int *)v->value;
1265
else if (v->type == adios_long)
1266
meshinfo->uniform->spacings[i] = *(signed long long *)v->value;
1267
else if (v->type == adios_unsigned_long)
1268
meshinfo->uniform->spacings[i] = *(unsigned long long *)v->value;
1334
adios_errno = err_no_error;
1335
meshinfo->uniform->spacings[i] = common_check_var_type_to_double (&v->type, v->value);
1336
if (adios_errno < 0)
1271
adios_error (err_mesh_unifrom_invalid_var_type,
1272
"Uniform mesh %s spacings support (unsigned) char, (unsigned) short, "
1273
"(unsigned) int, (unsigned) long long, float and double\n",
1275
meshinfo->uniform = NULL;
1338
meshinfo->uniform = NULL;
1278
// printf ("meshinfo->uniform->spacings[%d] = %lf\n",i, meshinfo->uniform->spacings[i]);
1280
1342
common_read_free_varinfo (v);
1389
1451
common_read_get_attr_mesh (fp, mesh_attribute, &attr_type, &attr_size, &data);
1390
1452
free (mesh_attribute);
1391
1453
if ( !strcmp((char *)data, "uniform") )
1393
bool have_spacing = 0;
1396
1454
meshinfo->type = ADIOS_MESH_UNIFORM;
1455
else if ( !strcmp((char *)data, "rectilinear") )
1456
meshinfo->type = ADIOS_MESH_RECTILINEAR;
1457
else if ( !strcmp((char *)data, "structured") )
1458
meshinfo->type = ADIOS_MESH_STRUCTURED;
1459
else if ( !strcmp((char *)data, "unstructured") )
1460
meshinfo->type = ADIOS_MESH_UNSTRUCTURED;
1462
//check if mesh structure is stored in the same file
1463
char * meshfile = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/mesh-file")+1 );
1464
strcpy (meshfile, "/adios_schema/");
1465
strcat (meshfile, meshinfo->name);
1466
strcat (meshfile, "/mesh-file");
1467
read_fail = common_read_get_attr_mesh (fp, meshfile, &attr_type, &attr_size, &data);
1472
meshinfo->file_name = NULL;
1473
// get the mesh details now from this data file
1474
common_read_complete_meshinfo (fp, fp, meshinfo);
1478
meshinfo->file_name = strdup((char *)data);
1479
// user has to open this file and call common_read_complete_meshinfo() again with both file pointers
1485
int common_read_complete_meshinfo (ADIOS_FILE *fp, ADIOS_FILE *mp, ADIOS_MESH * meshinfo)
1487
enum ADIOS_DATATYPES attr_type;
1493
if (fp==NULL || mp==NULL)
1495
adios_error (err_mesh_file_missing,
1496
"Mesh file %s or mesh file does not exist. ",
1497
fp->path, mp->path);
1501
// if ( !strcmp((char *)data, "uniform") )
1502
if (meshinfo->type == ADIOS_MESH_UNIFORM)
1504
// meshinfo->type = ADIOS_MESH_UNIFORM;
1397
1505
meshinfo->uniform = (MESH_UNIFORM * ) malloc (sizeof(MESH_UNIFORM));
1399
1507
// initialize pointers that might not be set below
1460
1568
varid = common_read_find_var (fp, dimensions_value_tmp, 1);
1461
1569
if (varid >= 0) {
1462
1570
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
1463
if (v->type == adios_byte)
1464
meshinfo->uniform->dimensions[i] = *(signed char *)v->value;
1465
else if (v->type == adios_unsigned_byte)
1466
meshinfo->uniform->dimensions[i] = *(unsigned char *)v->value;
1467
else if (v->type == adios_short)
1468
meshinfo->uniform->dimensions[i] = *(signed short *)v->value;
1469
else if (v->type == adios_unsigned_short)
1470
meshinfo->uniform->dimensions[i] = *(unsigned short *)v->value;
1471
else if (v->type == adios_integer)
1472
meshinfo->uniform->dimensions[i] = *(signed int *)v->value;
1473
else if (v->type == adios_unsigned_integer)
1474
meshinfo->uniform->dimensions[i] = *(unsigned int *)v->value;
1475
else if (v->type == adios_long)
1476
meshinfo->uniform->dimensions[i] = *(signed long long *)v->value;
1477
else if (v->type == adios_unsigned_long)
1478
meshinfo->uniform->dimensions[i] = *(unsigned long long *)v->value;
1571
adios_errno = err_no_error;
1572
meshinfo->uniform->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value);
1573
if (adios_errno < 0)
1575
adios_error (err_mesh_unifrom_invalid_dim,
1576
"Uniform mesh %s dimensions%d var type is not support!\n",
1480
1580
common_read_free_varinfo (v);
1608
1709
varid = common_read_find_var (fp, dimensions_value_tmp, 1);
1609
1710
if (varid >= 0) {
1610
1711
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
1611
if (v->type == adios_byte)
1612
meshinfo->rectilinear->dimensions[i] = *(signed char *)v->value;
1613
else if (v->type == adios_unsigned_byte)
1614
meshinfo->rectilinear->dimensions[i] = *(unsigned char *)v->value;
1615
else if (v->type == adios_short)
1616
meshinfo->rectilinear->dimensions[i] = *(signed short *)v->value;
1617
else if (v->type == adios_unsigned_short)
1618
meshinfo->rectilinear->dimensions[i] = *(unsigned short *)v->value;
1619
else if (v->type == adios_integer)
1620
meshinfo->rectilinear->dimensions[i] = *(signed int *)v->value;
1621
else if (v->type == adios_unsigned_integer)
1622
meshinfo->rectilinear->dimensions[i] = *(unsigned int *)v->value;
1623
else if (v->type == adios_long)
1624
meshinfo->rectilinear->dimensions[i] = *(signed long long *)v->value;
1625
else if (v->type == adios_unsigned_long)
1626
meshinfo->rectilinear->dimensions[i] = *(unsigned long long *)v->value;
1627
// meshinfo->rectilinear->dimensions[i] = *(uint64_t *)v->value;
1712
adios_errno = err_no_error;
1713
meshinfo->rectilinear->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value);
1714
if (adios_errno < 0)
1716
adios_error (err_mesh_recti_invalid_dim,
1717
"Rectilinear mesh %s dimensions%d var type is not support!\n",
1628
1721
common_read_free_varinfo (v);
1873
1967
varid = common_read_find_var (fp, dimensions_value_tmp, 1);
1874
1968
if (varid >= 0) {
1875
1969
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
1876
if (v->type == adios_byte)
1877
meshinfo->structured->dimensions[i] = *(signed char *)v->value;
1878
else if (v->type == adios_unsigned_byte)
1879
meshinfo->structured->dimensions[i] = *(unsigned char *)v->value;
1880
else if (v->type == adios_short)
1881
meshinfo->structured->dimensions[i] = *(signed short *)v->value;
1882
else if (v->type == adios_unsigned_short)
1883
meshinfo->structured->dimensions[i] = *(unsigned short *)v->value;
1884
else if (v->type == adios_integer)
1885
meshinfo->structured->dimensions[i] = *(signed int *)v->value;
1886
else if (v->type == adios_unsigned_integer)
1887
meshinfo->structured->dimensions[i] = *(unsigned int *)v->value;
1888
else if (v->type == adios_long)
1889
meshinfo->structured->dimensions[i] = *(signed long long *)v->value;
1890
else if (v->type == adios_unsigned_long)
1891
meshinfo->structured->dimensions[i] = *(unsigned long long *)v->value;
1892
// meshinfo->structured->dimensions[i] = *(uint64_t *)v->value;
1970
adios_errno = err_no_error;
1971
meshinfo->structured->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value);
1972
if( adios_errno < 0)
1974
adios_error (err_mesh_structured_invalid_dim,
1975
"Strctured mesh %s dimensions%d var type is not support!\n",
1893
1979
common_read_free_varinfo (v);
2133
log_warn ("Var %s for structured mesh %s nspace is not found. ",
2219
log_warn ("Var %s for structured mesh %s nspace is not found. "
2134
2220
"We use num of dims %d for nspaces.\n",
2135
(char *)data, meshinfo->name, meshinfo->structured->num_dimensions);
2221
(char *)data, meshinfo->name,
2222
meshinfo->structured->num_dimensions);
2138
2225
} // end of structured mesh nspace
2139
2226
}// end of structured mesh
2140
else if ( !strcmp((char *)data, "unstructured") )
2227
// else if ( !strcmp((char *)data, "unstructured") )
2228
else if (meshinfo->type == ADIOS_MESH_UNSTRUCTURED)
2142
meshinfo->type = ADIOS_MESH_UNSTRUCTURED;
2230
// meshinfo->type = ADIOS_MESH_UNSTRUCTURED;
2143
2231
meshinfo->unstructured = (MESH_UNSTRUCTURED* ) malloc (sizeof(MESH_UNSTRUCTURED));
2144
2232
// meshinfo->unstructured->use_single_var = 0; // default value 0 indicates using multi-var
2145
2233
meshinfo->unstructured->nvar_points = 1;
2160
2248
// meshinfo->unstructured->use_single_var = 1; // modify default value to 1
2161
2249
char * coords_tmp = strdup((char *)data);
2162
2250
// printf ("coords_tmp is %s\n", coords_tmp);
2163
varid = common_read_find_var (fp, coords_tmp, 1);
2251
// varid = common_read_find_var (fp, coords_tmp, 1);
2252
varid = common_read_find_var (mp, coords_tmp, 1);
2164
2253
if (varid >= 0)
2166
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2255
// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2256
ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]);
2167
2257
if (v->ndim == 0) //scalar
2169
2259
adios_error (err_mesh_unstructured_invaid_points,
2170
2260
"Unstructured mesh %s points dimension is 0.\n",
2171
2261
meshinfo->name);
2230
2321
strcat (points_var, i_buffer);
2231
2322
free (i_buffer);
2233
read_fail = common_read_get_attr_mesh (fp, points_var, &attr_type, &attr_size, &data);
2324
// read_fail = common_read_get_attr_mesh (fp, points_var, &attr_type, &attr_size, &data);
2325
read_fail = common_read_get_attr_mesh (mp, points_var, &attr_type, &attr_size, &data);
2234
2326
free (points_var);
2237
2329
adios_error (err_mesh_unstructured_missing_one_points,
2238
2330
"Unstructured mesh %s points of dim[%d] is not provided.\n",
2239
2331
meshinfo->name, i);
2242
2334
char * points_var_tmp = strdup((char *)data);
2243
2335
// printf ( "points_var_tmp is %s\n", points_var_tmp);
2244
varid = common_read_find_var (fp, points_var_tmp, 1);
2336
// varid = common_read_find_var (fp, points_var_tmp, 1);
2337
varid = common_read_find_var (mp, points_var_tmp, 1);
2245
2338
if (varid >= 0)
2247
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2340
// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2341
ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]);
2250
2344
first_match_var = strdup (points_var_tmp);
2366
2462
char * points_var_tmp = strdup((char *)data);
2367
varid = common_read_find_var (fp, points_var_tmp, 1);
2463
// varid = common_read_find_var (fp, points_var_tmp, 1);
2464
varid = common_read_find_var (mp, points_var_tmp, 1);
2368
2465
if (varid >= 0)
2370
ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2371
if (v->type==adios_long || v->type==adios_unsigned_long) //long long or unsigned long long
2467
// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]);
2468
ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]);
2469
uint64_t match_points = 0;
2470
adios_errno = err_no_error;
2471
match_points = common_check_var_type_to_uint64 (&v->type, v->value);
2472
if (adios_errno < 0)
2373
if (meshinfo->unstructured->npoints != *(uint64_t *)v->value)
2374
log_warn ("Provided npoints %"PRIu64" does not match points calculated from points-var %"PRIu64". "
2375
"We use calculated npoints from points-var %"PRIu64".\n",
2376
*(uint64_t *)v->value, meshinfo->unstructured->npoints, meshinfo->unstructured->npoints);
2474
log_warn ("Unstructured mesh %s var type of npoints is not supported. "
2475
"We use calculated default npoints %"PRIu64" from points-var\n",
2476
meshinfo->name, meshinfo->unstructured->npoints);
2380
if (meshinfo->unstructured->npoints != *(int *)v->value)
2381
log_warn ("Provided npoints %d does not match points calculated from points-var %"PRIu64". "
2478
if (meshinfo->unstructured->npoints != match_points)
2479
log_warn ("Provided npoints %"PRIu64" does not match points calculated from points-var %"PRIu64". "
2382
2480
"We use calculated npoints from points-var %"PRIu64".\n",
2383
*(int *)v->value, meshinfo->unstructured->npoints, meshinfo->unstructured->npoints);
2481
match_points, meshinfo->unstructured->npoints, meshinfo->unstructured->npoints);
2385
2482
common_read_free_varinfo (v);
2389
log_warn ("Unstructured mesh %s var of npoints is not correct. "
2390
"We use calculated default npoints %"PRIu64" from points-var\n",
2391
meshinfo->name, meshinfo->unstructured->npoints);
2486
// check attrubites if var is not found
2487
read_fail = common_read_get_attr_mesh (mp, points_var_tmp, &attr_type, &attr_size, &data);
2490
adios_errno = err_no_error;
2491
meshinfo->unstructured->npoints = common_check_var_type_to_uint64 (&attr_size, data);
2492
if (adios_errno < 0)
2494
log_warn ("Unstructured mesh %s var type of npoints is not supported. "
2495
"We use calculated default npoints %"PRIu64" from points-var\n",
2496
meshinfo->name, meshinfo->unstructured->npoints);
2500
log_warn ("Unstructured mesh %s var of npoints is not correct. "
2501
"We use calculated default npoints %"PRIu64" from points-var\n",
2502
meshinfo->name, meshinfo->unstructured->npoints);
2441
2554
common_read_free_varinfo (v);
2444
log_warn ("Unstructured mesh %s var of npoints is not correct, "
2445
" use points dim %d for nspaces\n",
2446
meshinfo->name, meshinfo->unstructured->nspaces);
2558
// check attrubites if var is not found
2559
read_fail = common_read_get_attr_mesh (mp, spaces_var_tmp, &attr_type, &attr_size, &data);
2562
adios_errno = err_no_error;
2563
meshinfo->unstructured->nspaces = common_check_var_type_to_int (&attr_size, data);
2564
if (adios_errno < 0)
2565
log_warn ("Unstructured mesh %s var type of nspaces is not suported, "
2566
"use points dim %d for nspaces\n",
2567
meshinfo->name, meshinfo->unstructured->nspaces);
2571
log_warn ("Unstructured mesh %s var of nspaces is not correct, "
2572
"use points dim %d for nspaces\n",
2573
meshinfo->name, meshinfo->unstructured->nspaces);