354
359
if (!adios_define_mesh_uniform_maximums (value, new_group, name))
358
if (!strncmp (n->value.element.name, "!--", 3)) // a comment
362
if (!strcasecmp (n->value.element.name, "nspace"))
365
value = mxmlElementGetAttr (n, "value");
366
adios_define_mesh_nspace (value, new_group, name);
368
if (!strncmp (n->value.element.name, "!--", 3)) // a comment
473
483
if (!adios_define_mesh_rectilinear_coordinatesSingleVar(value, new_group, name))
477
if (!strncmp (n->value.element.name, "!--", 3)) // a comment
486
if (!strcasecmp (n->value.element.name, "nspace"))
489
value = mxmlElementGetAttr (n, "value");
490
adios_define_mesh_nspace (value, new_group, name);
493
if (!strncmp (n->value.element.name, "!--", 3)) // a comment
484
500
if (!saw_dimensions)
542
558
value = mxmlElementGetAttr (n, "value");
546
log_warn ("config.xml: value attribute on "
547
"nspace required (%s)\n"
554
if (!adios_define_mesh_structured_nspace (value, new_group, name))
559
adios_define_mesh_nspace (value, new_group, name);
562
// log_warn ("config.xml: value attribute on "
563
// "nspace required (%s)\n"
570
// if (!adios_define_mesh_structured_nspace (value, new_group, name))
557
573
if (!strcasecmp (n->value.element.name, "dimensions"))
715
730
value = mxmlElementGetAttr (n, "value");
719
log_warn ("config.xml: value attribute on "
720
"nspace required (%s)\n"
727
if (!adios_define_mesh_unstructured_nspace (value, new_group, name))
731
adios_define_mesh_nspace (value, new_group, name);
735
// log_warn ("config.xml: value attribute on "
736
// "nspace required (%s)\n"
743
// if (!adios_define_mesh_unstructured_nspace (value, new_group, name))
730
746
if (!strcasecmp (n->value.element.name, "number-of-points"))
1223
1241
// fix the bgp bugs
1224
1242
// if (!adios_common_define_var (*(int64_t *) &new_group, name
1225
if (!adios_common_define_var (ptr_new_group, name
1243
int64_t var = adios_common_define_var (ptr_new_group, name
1226
1244
,path, t1, dimensions
1227
1245
,gb_global_dimensions
1228
1246
,gb_local_offsets
1229
,transform_type // NCSU ALACRITY-ADIOS
1235
1252
// Successfully define a variable, so now
1253
// an attribute for the transform method if given.
1254
if (transform_type && strcmp(transform_type,"")) {
1255
adios_common_set_transform (var, transform_type);
1236
1257
// an attribute for the mesh if it exists.
1237
1258
if (strcmp(mesh,"")){
1238
mpath1 = malloc(strlen("/adios_schema")+strlen(name)+1);
1239
strcpy(mpath1,name);
1240
strcat(mpath1,"/adios_schema");
1241
adios_common_define_attribute (ptr_new_group,mpath1,path,adios_string,mesh,"");
1259
adios_common_define_var_mesh (ptr_new_group, name, mesh, path);
1243
1261
// an attribute for the center if it exists.
1244
1262
if (strcmp(center,"")){
1245
mpath2 = malloc(strlen("/adios_schema/centering")+strlen(name)+1);
1246
strcpy(mpath2,name);
1247
strcat(mpath2,"/adios_schema/centering");
1248
adios_common_define_attribute (ptr_new_group,mpath2,path,adios_string,center,"");
1263
adios_common_define_var_centering (ptr_new_group, name, center, path);
1250
1265
// if a time attribute exists
1251
1266
// parse it and define it
1252
1267
if (strcmp(tsteps,"")){
1253
adios_define_var_timesteps(tsteps,new_group,name,path);
1268
adios_common_define_var_timesteps(tsteps,new_group,name,path);
1255
1270
// if a time scale attribute exists
1256
1271
// parse it and define it
1257
1272
if (strcmp(tscale,"")){
1258
adios_define_var_timescale(tscale,new_group,name,path);
1273
adios_common_define_var_timescale(tscale,new_group,name,path);
1260
1275
// if a time series format attribute exists
1261
1276
// parse it and define it
1262
1277
if (strcmp(tformat,"")){
1263
adios_define_var_timeseriesformat(tformat,new_group,name,path);
1278
adios_common_define_var_timeseriesformat(tformat,new_group,name,path);
1265
1280
// if a hyperslab attribute exists
1266
1281
// parse it and define it
1267
1282
if (strcmp(hyperslab,"")){
1268
adios_define_var_hyperslab(hyperslab,new_group,name,path);
1283
adios_common_define_var_hyperslab(hyperslab,new_group,name,path);
1272
1287
if (!strcasecmp (n->value.element.name, "global-bounds"))
1274
1289
mxml_node_t * n1; // used for global_bounds
1275
struct adios_global_bounds_struct * new_global_bounds = 0;
1277
1290
const char * dimensions = 0;
1278
1291
const char * dimension = 0;
1279
1292
const char * global_dimensions = 0;
1416
1429
parseFlag ("read", read_flag, adios_flag_no);
1417
1430
// fix the bgp bugs
1418
1431
// if (!adios_common_define_var (*(int64_t *) &new_group
1419
if (!adios_common_define_var (ptr_new_group
1421
,path, t1, dimensions
1422
,gb_global_dimensions
1424
,transform_type // NCSU ALACRITY-ADIOS
1432
int64_t var = adios_common_define_var (ptr_new_group, name
1433
,path, t1, dimensions
1434
,gb_global_dimensions
1430
1441
// Successfully define a variable, so now
1442
// an attribute for the transform method if given.
1443
if (transform_type && strcmp(transform_type,"")) {
1444
adios_common_set_transform (var, transform_type);
1431
1446
// an attribute for the mesh if it exists.
1432
1447
if (strcmp(mesh,"")){
1433
mpath1 = malloc(strlen("/adios_schema")+strlen(name)+1);
1434
strcpy(mpath1,name);
1435
strcat(mpath1,"/adios_schema");
1436
adios_common_define_attribute (ptr_new_group,mpath1,path,adios_string,mesh,"");
1448
adios_common_define_var_mesh (ptr_new_group, name, mesh, path);
1438
1450
// an attribute for the mesh if it exists.
1439
1451
if (strcmp(center,"")){
1440
mpath2 = malloc(strlen("/adios_schema/centering")+strlen(name)+1);
1441
strcpy(mpath2,name);
1442
strcat(mpath2,"/adios_schema/centering");
1443
adios_common_define_attribute (ptr_new_group,mpath2,path,adios_string,center,"");
1452
adios_common_define_var_centering (ptr_new_group, name, center, path);
1445
1454
// if a time attribute exists
1446
1455
// parse it and define it
1447
1456
if (strcmp(tsteps,"")){
1448
adios_define_var_timesteps(tsteps,new_group,name,path);
1457
adios_common_define_var_timesteps(tsteps,new_group,name,path);
1450
1459
// if a time scale attribute exists
1451
1460
// parse it and define it
1452
1461
if (strcmp(tscale,"")){
1453
adios_define_var_timescale(tscale,new_group,name,path);
1462
adios_common_define_var_timescale(tscale,new_group,name,path);
1455
1464
// if a time series format attribute exists
1456
1465
// parse it and define it
1457
1466
if (strcmp(tformat,"")){
1458
adios_define_var_timeseriesformat(tformat,new_group,name,path);
1467
adios_common_define_var_timeseriesformat(tformat,new_group,name,path);
1460
1469
// if a hyperslab attribute exists
1461
1470
// parse it and define it
1462
1471
if (strcmp(hyperslab,"")){
1463
adios_define_var_hyperslab(hyperslab,new_group,name,path);
1472
adios_common_define_var_hyperslab(hyperslab,new_group,name,path);
1622
1632
// Define attribute for the type and time varying characteristics
1623
1633
adios_common_define_attribute (ptr_new_group,meshtype,"/",adios_string,type,"");
1624
1634
adios_common_define_attribute (ptr_new_group,meshtime,"/",adios_string,time_varying,"");
1625
adios_define_mesh_timeSteps(time_steps, new_group, name);
1626
adios_define_mesh_timeScale(time_scale, new_group, name);
1627
adios_define_mesh_timeSeriesFormat(time_format, new_group, name);
1635
adios_common_define_mesh_timeSteps(time_steps, new_group, name);
1636
adios_common_define_mesh_timeScale(time_scale, new_group, name);
1637
adios_common_define_mesh_timeSeriesFormat(time_format, new_group, name);
1628
1638
// Only parse mesh if the variables are in this file
1629
1639
// otherwise simply point the mesh file
1630
1640
mesh_file = mxmlElementGetAttr(n, "file");
1631
mesh_group = mxmlElementGetAttr(n, "group");
1634
1642
adios_common_define_attribute (ptr_new_group,meshfile,"/",adios_string,mesh_file,"");
1645
mesh_ref = mxmlElementGetAttr(n, "ref");
1647
adios_common_define_attribute (ptr_new_group,meshfile,"/",adios_string,mesh_ref,"");
1650
mesh_group = mxmlElementGetAttr(n, "group");
1636
1651
if (mesh_group)
1637
1652
adios_common_define_attribute (ptr_new_group,meshgroup,"/",adios_string,mesh_group,"");
1988
void PRINT_MXML_NODE (mxml_node_t *root)
1992
log_debug("MXML root=NULL\n");
1994
else if (root->type == MXML_ELEMENT)
1996
log_debug("MXML ELEMENT root=%p, name=[%s] parent=%p\n",
1997
root, root->value.element.name, root->parent);
1999
else if (root->type == MXML_TEXT)
2001
log_debug("MXML TEXT root=%p, text=[%s] parent=%p\n",
2002
root, root->value.text.string, root->parent);
2006
log_debug("MXML Type=%d root=%p, parent=%p\n",
2007
root->type, root, root->parent);
1974
2011
int adios_parse_config (const char * config, MPI_Comm comm)
2073
while (root && root->type != MXML_ELEMENT)
2075
root = mxmlWalkNext (root, doc, MXML_DESCEND);
2078
while (!strncmp (root->value.element.name, "!--", 3))
2080
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
2081
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
2084
if (strcasecmp (root->value.element.name, "adios-config"))
2086
if (strncmp (root->value.element.name, "?xml", 4))
2088
adios_error (err_invalid_xml_doc, "config.xml: invalid root xml element: %s\n"
2089
,root->value.element.name
2098
while (!strncmp (root->value.element.name, "!--", 3))
2100
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
2103
root = mxmlWalkNext (root, doc, MXML_DESCEND); // skip ver num
2104
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND); // get next
2105
while (!strncmp (root->value.element.name, "!--", 3))
2107
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
2108
root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
2114
//printf ("it is adios-config\n");
2118
if (strcasecmp (root->value.element.name, "adios-config"))
2120
adios_error (err_invalid_xml_doc, "config.xml: invalid root xml element: %s\n"
2121
,root->value.element.name
2109
PRINT_MXML_NODE(root);
2111
if (strcasecmp (root->value.element.name, "adios-config")) {
2112
root = mxmlFindElement (doc, doc, "adios-config", NULL, NULL, MXML_DESCEND);
2113
PRINT_MXML_NODE(root);
2117
if (!root || !root->value.element.name || strcasecmp (root->value.element.name, "adios-config"))
2119
adios_error (err_invalid_xml_doc, "config.xml: did not find adios-config xml element\n");
2124
2120
mxmlRelease (doc);