1805
1800
if (lo_dim_temp)
1806
1801
free (lo_dim_temp);
1803
v->id = ++t->member_count;
1804
adios_append_var (t, v);
1809
/* Set the transformation method for a variable. Only one transformation will work for each variable */
1810
int adios_common_set_transform (int64_t var_id, const char *transform_type_str)
1812
struct adios_var_struct * v = (struct adios_var_struct *)var_id;
1808
1814
// NCSU ALACRITY-ADIOS - parse transform type string, and call the transform layer to
1809
1815
// set up the variable as needed
1810
struct adios_transform_spec *transform_spec = adios_transform_parse_spec(transform_type_str);
1816
struct adios_transform_spec *transform_spec = adios_transform_parse_spec(transform_type_str, v->transform_spec);
1811
1817
if (transform_spec->transform_type == adios_transform_unknown) {
1812
log_error("Unknown transform type \"%s\" specified for variable \"%s\", ignoring it...\n",
1818
adios_error(err_invalid_transform_type,
1819
"Unknown transform type \"%s\" specified for variable \"%s\", ignoring it...\n",
1813
1820
transform_spec->transform_type_str, v->name);
1814
1821
transform_spec->transform_type = adios_transform_none;
1817
1824
// This function sets the transform_type field. It does nothing if transform_type is none.
1818
1825
// Note: ownership of the transform_spec struct is given to this function
1819
v = adios_transform_define_var(t, v, transform_spec);
1821
v->id = ++t->member_count;
1822
adios_append_var (t, v);
1826
v = adios_transform_define_var(v, transform_spec);
1827
1831
void adios_common_get_group (int64_t * group_id, const char * name)
1829
1833
struct adios_group_list_struct * g = adios_get_groups ();
5560
5575
return list_rem_next (queue, NULL, data);
5563
5579
// Functions for non-XML API fo ADIOS Schema some of which are also called from functions in adios_internals_mxml.c
5564
int adios_define_schema_version(struct adios_group_struct * new_group, char * schema_version){
5565
int64_t p_new_group = (int64_t) new_group;
5580
int adios_common_define_schema_version (struct adios_group_struct * new_group, char * schema_version)
5582
int64_t p_new_group = (int64_t) new_group;
5567
5584
if (strcasecmp (schema_version,"")){
5568
5585
char * ver;// copy version
5569
5586
char * d; // dot location
5570
5587
char * ptr_end;
5571
5588
ver = strdup (schema_version);
5572
char * schema_version_major;
5573
char * schema_version_minor;
5574
5589
char * schema_version_major_att_nam;
5575
5590
char * schema_version_minor_att_nam;
5576
5591
d = strtok (ver, ".");
5577
5592
int counter = 0; // counter
5581
5596
int slength = 0;
5626
5640
// The number indicates how to write the time steps. Ex: 4 ==>
5627
5641
// varname.XXXX.png where XXXX is the time step padded with 0s
5628
5642
// We do not fail if this is not given as variables all have nsteps
5643
if (!timeseries || !strcmp(timeseries,"")){
5633
5647
char * ptr_end;
5634
5648
d1 = strdup (timeseries);
5635
if (strtod (d1, &ptr_end)){
5650
double tmp_d = strtod (d1, &ptr_end);
5651
if (!(ptr_end && ptr_end[0]==0))
5636
5653
adios_conca_mesh_att_nam(&format_att_nam, name, "time-series-format");
5637
5654
adios_common_define_attribute (p_new_group,format_att_nam,"/",adios_double,d1,"");
5638
free(format_att_val); }
5655
free(format_att_val);
5643
5661
// Parse mesh time scale (real time tracking, not integers)
5644
int adios_define_mesh_timeScale (const char * timescale
5645
,struct adios_group_struct * new_group
5662
int adios_common_define_mesh_timeScale (const char * timescale,
5663
struct adios_group_struct * new_group,
5649
5667
char * c; // comma location
5650
5668
char * d1; // save of strdup
5651
int64_t p_new_group = (int64_t) new_group;
5669
int64_t p_new_group = (int64_t) new_group;
5652
5670
char * gettscalefrom0 = 0; // scale attribute xml value
5653
5671
char * gettscalefrom1 = 0; // scale attribute xml value
5654
5672
char * gettscalefrom2 = 0; // scale attribute xml value
5737
5753
c = strtok (NULL, ",");
5739
5755
if (counter == 3){
5740
5757
time_start_att_val = strdup(gettscalefrom0);
5741
5758
adios_conca_mesh_att_nam(&time_start_att_nam, name, "time-scale-start");
5742
5759
// if this is string
5743
if (!strtod (time_start_att_val, &ptr_end))
5760
tmp_d2 = strtod (time_start_att_val, &ptr_end);
5761
if (!(ptr_end && ptr_end[0]==0))
5762
// if (!strtod (time_start_att_val, &ptr_end))
5744
5763
adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_string,time_start_att_val,"");
5746
5765
adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_double,time_start_att_val,"");
5747
5766
time_stride_att_val = strdup(gettscalefrom1);
5748
5767
adios_conca_mesh_att_nam(&time_stride_att_nam, name, "time-scale-stride");
5749
5768
// if this is string
5750
if (!strtod (time_stride_att_val, &ptr_end))
5769
tmp_d2 = strtod (time_stride_att_val, &ptr_end);
5770
// if (!strtod (time_stride_att_val, &ptr_end))
5771
if (!(ptr_end && ptr_end[0]==0))
5751
5772
adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_string,time_stride_att_val,"");
5753
5774
adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_double,time_stride_att_val,"");
5754
5775
time_count_att_val = strdup(gettscalefrom2);
5755
5776
adios_conca_mesh_att_nam(&time_count_att_nam, name, "time-scale-count");
5756
5777
// if this is string
5757
if (!strtod (time_count_att_val, &ptr_end))
5778
tmp_d2 = strtod (time_count_att_val, &ptr_end);
5779
// if (!strtod (time_count_att_val, &ptr_end))
5780
if (!(ptr_end && ptr_end[0]==0))
5758
5781
adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_string,time_count_att_val,"");
5760
5783
adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_double,time_count_att_val,"");
5765
5788
free(gettscalefrom1);
5766
5789
free(gettscalefrom0);
5767
5790
}else if (counter == 2) {
5768
5792
adios_conca_mesh_att_nam(&time_min_att_nam, name, "time-scale-min");
5769
5793
// if this is string
5770
if (!strtod (time_min_att_val, &ptr_end))
5794
tmp_d2 = strtod (time_min_att_nam, &ptr_end);
5795
if (!(ptr_end && ptr_end[0]==0))
5796
// if (!strtod (time_min_att_val, &ptr_end))
5771
5797
adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_string,time_min_att_val,"");
5773
5799
adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_double,time_min_att_val,"");
5774
5800
time_max_att_val = strdup(gettscalefrom1);
5775
5801
adios_conca_mesh_att_nam(&time_max_att_nam, name, "time-scale-max");
5776
5802
// if this is string
5777
if (!strtod (time_max_att_val, &ptr_end))
5803
tmp_d2 = strtod (time_max_att_nam, &ptr_end);
5804
if (!(ptr_end && ptr_end[0]==0))
5805
// if (!strtod (time_max_att_val, &ptr_end))
5778
5806
adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_string,time_max_att_val,"");
5780
5808
adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_double,time_max_att_val,"");
5839
int adios_common_define_mesh_timeVarying (const char * timevarying, int64_t group_id, const char * name)
5842
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/time-varying")+1);
5843
strcpy (mpath, "/adios_schema/");
5844
strcat (mpath, name);
5845
strcat (mpath, "/time-varying");
5846
adios_common_define_attribute (group_id, mpath, "", adios_string, timevarying, "");
5807
5851
// Parse mesh time steps (integers = number of times vars are written)
5808
int adios_define_mesh_timeSteps (const char * timesteps
5809
,struct adios_group_struct * new_group
5852
int adios_common_define_mesh_timeSteps (const char * timesteps,
5853
struct adios_group_struct * new_group,
5813
5857
char * c; // comma location
5814
5858
char * d1; // save of strdup
5815
int64_t p_new_group = (int64_t) new_group;
5859
int64_t p_new_group = (int64_t) new_group;
5816
5860
char * gettstepsfrom0 = 0; // tstep attribute xml value
5817
5861
char * gettstepsfrom1 = 0; // tstep attribute xml value
5818
5862
char * gettstepsfrom2 = 0; // tstep attribute xml value
5972
6012
// defining a uniform mesh
5973
int adios_define_mesh_uniform (char * dimensions, char * origin, char * spacing, char * maximum, struct adios_group_struct * new_group ,const char * name)
5977
if (!adios_define_mesh_uniform_dimensions (dimensions, new_group, name))
5980
log_warn ("config.xml: value attribute on "
5981
"dimensions required (%s)\n"
5989
if (!adios_define_mesh_uniform_origins (origin, new_group, name))
5992
log_warn ("config.xml: value attribute on "
5993
"origin required (%s)\n"
6000
if (!adios_define_mesh_uniform_spacings (spacing, new_group, name))
6003
log_warn ("config.xml: value attribute on "
6004
"spacing required (%s)\n"
6012
if (!adios_define_mesh_uniform_maximums (maximum, new_group, name))
6015
log_warn ("config.xml: value attribute on "
6016
"max required (%s)\n"
6013
int adios_common_define_mesh_uniform (char * dimensions,
6018
// struct adios_group_struct * new_group,
6023
struct adios_group_struct * new_group = (struct adios_group_struct *) group_id;
6025
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1);
6026
strcpy (mpath, "/adios_schema/");
6027
strcat (mpath, name);
6028
strcat (mpath, "/type");
6029
adios_common_define_attribute (group_id, mpath, "", adios_string, "uniform", "");
6031
if (!adios_define_mesh_uniform_dimensions (dimensions, new_group, name))
6034
adios_define_mesh_uniform_origins (origin, new_group, name);
6036
adios_define_mesh_uniform_spacings (spacing, new_group, name);
6038
adios_define_mesh_uniform_maximums (maximum, new_group, name);
6040
adios_define_mesh_nspace (nspace, new_group, name);
6025
int adios_define_mesh_rectilinear (char * dimensions, char * coordinates
6026
,struct adios_group_struct * new_group
6046
// defining a rectilinear mesh
6047
int adios_common_define_mesh_rectilinear (char * dimensions,
6049
// struct adios_group_struct * new_group,
6032
if (!adios_define_mesh_rectilinear_dimensions (dimensions, new_group, name))
6035
log_warn ("config.xml: value attribute on "
6036
"dimensions required (%s)\n"
6055
struct adios_group_struct * new_group = (struct adios_group_struct *) group_id;
6057
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1);
6058
strcpy (mpath, "/adios_schema/");
6059
strcat (mpath, name);
6060
strcat (mpath, "/type");
6061
adios_common_define_attribute (group_id, mpath, "", adios_string, "rectilinear", "");
6063
if (!adios_define_mesh_rectilinear_dimensions (dimensions, new_group, name))
6042
6066
// Determine if it is the multi-var or single-var case
6046
// If we do not find "," in the coordinates
6047
if (!(p = strstr(coordinates, ","))){
6048
if (!adios_define_mesh_rectilinear_coordinatesSingleVar (coordinates, new_group, name))
6051
if (!adios_define_mesh_rectilinear_coordinatesMultiVar (coordinates, new_group, name))
6055
log_warn ("config.xml: value attribute on "
6056
"coordinates required for rectilinear mesh: (%s)\n"
6068
// If we do not find "," in the coordinates
6069
if (!(p = strstr(coordinates, ",")))
6071
if (!adios_define_mesh_rectilinear_coordinatesSingleVar (coordinates, new_group, name))
6076
if (!adios_define_mesh_rectilinear_coordinatesMultiVar (coordinates, new_group, name))
6080
adios_define_mesh_nspace (nspace, new_group, name);
6064
int adios_define_mesh_structured(char * dimensions, char * nspace
6066
,struct adios_group_struct * new_group
6086
// defining a structured mesh
6087
int adios_common_define_mesh_structured (char * dimensions,
6090
// struct adios_group_struct * new_group,
6095
struct adios_group_struct * new_group = (struct adios_group_struct *) group_id;
6097
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1);
6098
strcpy (mpath, "/adios_schema/");
6099
strcat (mpath, name);
6100
strcat (mpath, "/type");
6101
adios_common_define_attribute (group_id, mpath, "", adios_string, "structured", "");
6068
6103
if (dimensions){
6069
6104
if (!adios_define_mesh_structured_dimensions (dimensions, new_group, name))
6072
6107
log_warn ("config.xml: value attribute on "
6073
"dimensions required (%s)\n"
6108
"dimensions required (%s)\n", name);
6081
if (!adios_define_mesh_structured_nspace (nspace, new_group, name))
6114
// if (!adios_define_mesh_structured_nspace (nspace, new_group, name))
6115
if (!adios_define_mesh_nspace (nspace, new_group, name))
6095
log_warn ("config.xml: value on"
6096
"points required for mesh type=structured (%s)\n"
6129
log_warn ("config.xml: value on "
6130
"points required for mesh type=structured (%s)\n", name);
6105
int adios_define_mesh_unstructured(char *nspace
6106
, char *npoints, char *points
6107
, char * data, char * count, char * type
6108
, struct adios_group_struct * new_group
6109
, const char * name)
6137
// defining a unstructured mesh
6138
int adios_common_define_mesh_unstructured (char * points,
6111
int saw_cell_set = 0;
6147
struct adios_group_struct * new_group = (struct adios_group_struct *) group_id;
6149
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1);
6150
strcpy (mpath, "/adios_schema/");
6151
strcat (mpath, name);
6152
strcat (mpath, "/type");
6153
adios_common_define_attribute (group_id, mpath, "", adios_string, "unstructured", "");
6114
if (!adios_define_mesh_unstructured_nspace (nspace, new_group, name))
6156
// if (!adios_define_mesh_unstructured_nspace (nspace, new_group, name))
6157
if (!adios_define_mesh_nspace (nspace, new_group, name))
6134
log_warn ("config.xml: value on"
6135
"points required for mesh type=structured (%s)\n"
6177
log_warn ("config.xml: value on "
6178
"points required for mesh type=structured (%s)\n", name);
6141
6182
log_warn ("config.xml: data attribute on "
6142
"uniform-cells required (%s)\n"
6183
"uniform-cells required (%s)\n", name);
6149
6188
log_warn ("config.xml: count attribute on "
6150
"uniform-cells required (%s)\n"
6189
"uniform-cells required (%s)\n", name);
6157
6194
log_warn ("config.xml: type attribute on "
6158
"uniform-cells required (%s)\n"
6195
"uniform-cells required (%s)\n", name);
6164
6199
// If we do find "," in data (uniform cell case)
6165
6200
if (!(pt = strstr(data, ","))){
6166
if (pt = strstr(count,",")){
6201
if ( (pt = strstr(count,",")) ){
6167
6202
log_warn ("count value on uniform-cells (check data value)"
6168
" should not contain ',' (%s)\n",name);
6203
" should not contain ',' (%s)\n",name);
6171
if (pt = strstr(type,",")){
6206
if ( (pt = strstr(type,",")) ){
6172
6207
log_warn ("type value on uniform-cells (check data value)"
6173
" should not contain ',' (%s)\n", name);
6208
" should not contain ',' (%s)\n", name);
6176
6211
if (!adios_define_mesh_unstructured_uniformCells (count, data, type
6603
6634
if (counter == 3){
6604
6636
time_start_att_val = strdup(gettscalefrom0);
6605
6637
conca_var_att_nam(&time_start_att_nam, name, "time-scale-start");
6638
tmp_d2 = strtod (time_start_att_val, &ptr_end);
6606
6639
// if this is string
6607
if (!strtod (time_start_att_val, &ptr_end))
6640
if ( !(ptr_end && ptr_end[0]==0))
6641
// if (!strtod (time_start_att_val, &ptr_end))
6608
6642
adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_string,time_start_att_val,"");
6610
6644
adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_double,time_start_att_val,"");
6611
6645
time_stride_att_val = strdup(gettscalefrom1);
6612
6646
conca_var_att_nam(&time_stride_att_nam, name, "time-scale-stride");
6613
6647
// if this is string
6614
if (!strtod (time_stride_att_val, &ptr_end))
6648
tmp_d2 = strtod (time_stride_att_nam, &ptr_end);
6649
if ( !(ptr_end && ptr_end[0]==0))
6650
// if (!strtod (time_stride_att_val, &ptr_end))
6615
6651
adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_string,time_stride_att_val,"");
6617
6653
adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_double,time_stride_att_val,"");
6618
6654
time_count_att_val = strdup(gettscalefrom2);
6619
6655
conca_var_att_nam(&time_count_att_nam, name, "time-scale-count");
6620
6656
// if this is string
6621
if (!strtod (time_count_att_val, &ptr_end))
6657
tmp_d2 = strtod (time_count_att_nam, &ptr_end);
6658
if ( !(ptr_end && ptr_end[0]==0))
6659
// if (!strtod (time_count_att_val, &ptr_end))
6622
6660
adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_string,time_count_att_val,"");
6624
6662
adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_double,time_count_att_val,"");
6629
6667
free(gettscalefrom1);
6630
6668
free(gettscalefrom0);
6631
6669
}else if (counter == 2) {
6632
6671
time_min_att_val = strdup(gettscalefrom0);
6633
6672
conca_var_att_nam(&time_min_att_nam, name, "time-scale-min");
6634
6673
// if this is string
6635
if (!strtod (time_min_att_val, &ptr_end))
6674
tmp_d2 = strtod (time_min_att_val, &ptr_end);
6675
if ( !(ptr_end && ptr_end[0]==0))
6676
// if (!strtod (time_min_att_val, &ptr_end))
6636
6677
adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_string,time_min_att_val,"");
6638
6679
adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_double,time_min_att_val,"");
6639
6680
time_max_att_val = strdup(gettscalefrom1);
6640
6681
conca_var_att_nam(&time_max_att_nam, name, "time-scale-max");
6641
6682
// if this is string
6642
if (!strtod (time_max_att_val, &ptr_end))
6683
tmp_d2 = strtod (time_max_att_nam, &ptr_end);
6684
if ( !(ptr_end && ptr_end[0]==0))
6685
// if (!strtod (time_max_att_val, &ptr_end))
6643
6686
adios_common_define_attribute (p_new_group,time_max_att_nam,path,adios_string,time_max_att_val,"");
6645
6688
adios_common_define_attribute (p_new_group,time_max_att_nam,path,adios_double,time_max_att_val,"");
6672
6719
// Parse var hyper slab: lines or planes from a higher dimension mesh
6673
int adios_define_var_hyperslab ( const char * hyperslab,
6674
struct adios_group_struct * new_group,
6720
int adios_common_define_var_hyperslab ( const char * hyperslab,
6721
struct adios_group_struct * new_group,
6678
6725
char * c; // comma location
6679
6726
char * d1; // save of strdup
6680
int64_t p_new_group = (int64_t) new_group;
6727
int64_t p_new_group = (int64_t) new_group;
6681
6728
char * gethslabfrom0 = 0; // hslab attribute xml value
6682
6729
char * gethslabfrom1 = 0; // hslab attribute xml value
6683
6730
char * gethslabfrom2 = 0; // hslab attribute xml value
6684
char * hslab_var_att_nam = 0; // hslab attribute name for var or num
6685
6731
char * hslab_start_att_nam = 0; // hslab attribute name for start
6686
6732
char * hslab_stride_att_nam = 0;// hslab attribute name for stride
6687
6733
char * hslab_count_att_nam = 0; // hslab attribute name for count
6688
6734
char * hslab_max_att_nam = 0; // hslab attribute name for max
6689
6735
char * hslab_min_att_nam = 0; // hslab attribute name for min
6690
6736
char * hslab_single_att_nam = 0;// hslab attribute name for min
6691
char * hslab_var_att_val = 0; // hslab attribute value for var or num
6692
6737
char * hslab_start_att_val = 0; // hslab attribute value for start
6693
6738
char * hslab_stride_att_val = 0;// hslab attribute value for stride
6694
6739
char * hslab_count_att_val = 0; // hslab attribute value for count
6779
int adios_define_mesh_uniform_dimensions (const char * dimensions
6780
,struct adios_group_struct * new_group
6823
int adios_define_mesh_nspace (const char * nspace,
6824
struct adios_group_struct * new_group,
6828
char * d1; // save of strdup
6829
int64_t p_new_group = (int64_t) new_group;
6830
char * nsp_att_nam = 0; // nspace attribute name
6832
if (!nspace || !strcmp(nspace, ""))
6834
// log_warn ("config.xml: nspace value (optional) is not provided"
6835
// "for uniform mesh: %s\n", name);
6838
d1 = strdup (nspace);
6840
adios_conca_mesh_att_nam(&nsp_att_nam, name, "nspace");
6841
adios_common_define_attribute (p_new_group,nsp_att_nam,"/",adios_string,nspace,"");
6848
int adios_define_mesh_uniform_dimensions (const char * dimensions,
6849
struct adios_group_struct * new_group,
6784
6853
char * c; // comma location
6785
6854
char * d1; // save of strdup
6786
int64_t p_new_group = (int64_t) new_group;
6855
int64_t p_new_group = (int64_t) new_group;
6787
6856
char * dim_att_nam = 0; // dimensions attribute name
6788
char * getdimsfrom = 0; // dimensions attribute that is a var
6789
6857
int counter = 0; // used to create dimX attributes
6790
6858
char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes
6860
if (!dimensions || !strcmp(dimensions,""))
6794
log_warn ("config.xml: dimensions value required for"
6795
"uniform mesh: %s\n"
6862
log_warn ("config.xml: dimensions value required for "
6863
"uniform mesh: %s\n", name);
6833
int adios_define_mesh_uniform_maximums (const char * maximum
6834
,struct adios_group_struct * new_group
6898
int adios_define_mesh_uniform_maximums (const char * maximum,
6899
struct adios_group_struct * new_group,
6838
6903
char * c; // comma location
6839
6904
char * d1; // save of strdup
6840
int64_t p_new_group = (int64_t) new_group;
6905
int64_t p_new_group = (int64_t) new_group;
6841
6906
char * max_att_nam = 0; // maxima attribute name
6842
char * getmaxafrom = 0; // maxima attribute name that is a var
6843
6907
int counter = 0; // used to create maxX attributes
6844
6908
char counterstr[5] = {0,0,0,0,0}; // used to create maxX attributes
6910
if (!maximum || !strcmp(maximum,""))
6848
log_warn ("config.xml: maximum value required"
6849
"for uniform mesh: %s\n"
6912
// log_warn ("config.xml: maximum value (optional) is not provided"
6913
// "for uniform mesh: %s\n",
6884
int adios_define_mesh_uniform_origins (const char * origin
6885
,struct adios_group_struct * new_group
6946
int adios_define_mesh_uniform_origins (const char * origin,
6947
struct adios_group_struct * new_group,
6889
6951
char * c; // comma location
6890
6952
char * d1; // save of strdup
6891
struct adios_mesh_item_list_struct * item = 0;
6892
int64_t p_new_group = (int64_t) new_group;
6953
int64_t p_new_group = (int64_t) new_group;
6893
6954
char * org_att_nam = 0; // origins attribute name
6894
char * getorgsfrom = 0; // origins attribute name that is a var
6895
6955
int counter = 0; // used to create orgX attributes
6896
6956
char counterstr[5] = {0,0,0,0,0}; // used to create orgX attributes
6958
if (!origin || !strcmp(origin,""))
6900
log_warn ("config.xml: origin value required "
6901
"for uniform mesh: %s\n"
6960
// log_warn ("config.xml: origin value (optional) not provided "
6961
// "for uniform mesh: %s\n",
6936
int adios_define_mesh_uniform_spacings (const char * spacing
6937
,struct adios_group_struct * new_group
6994
int adios_define_mesh_uniform_spacings (const char * spacing,
6995
struct adios_group_struct * new_group,
6941
6999
char * c; // comma location
6942
7000
char * d1; // save of strdup
6943
int64_t p_new_group = (int64_t) new_group;
7001
int64_t p_new_group = (int64_t) new_group;
6944
7002
char * spa_att_nam = 0; // spacings attribute name
6945
char * getspasfrom = 0; // spacings attribute name that is a var
6946
7003
int counter = 0; // used to create spaX attributes
6947
7004
char counterstr[5] = {0,0,0,0,0}; // used to create spaX attributes if (!spacing)
7006
if (!spacing || !strcmp(spacing,""))
6951
log_warn ("config.xml: mesh uniform spacing value "
6952
"required for mesh: %s\n"
7008
// log_warn ("config.xml: spacing value (optional) not provided "
7009
// "for uniform mesh: %s\n",
6978
7034
adios_conca_mesh_att_nam(&spas, name, "spacings-num");
6979
7035
adios_common_define_attribute (p_new_group,spas,"/",adios_integer,counterstr,"");
6987
int adios_define_mesh_rectilinear_dimensions (const char * dimensions
6988
,struct adios_group_struct * new_group
7042
int adios_define_mesh_rectilinear_dimensions (const char * dimensions,
7043
struct adios_group_struct * new_group,
6992
7047
char * c; // comma location
6993
7048
char * d1; // save of strdup
6994
struct adios_mesh_item_list_struct * item = 0;
6995
int64_t p_new_group = (int64_t) new_group;
7049
int64_t p_new_group = (int64_t) new_group;
6996
7050
char * dim_att_nam = 0; // dimensions attribute name
6997
char * getdimsfrom = 0; // dimensions attribute name that is a var
6998
7051
int counter = 0; // used to create dimX attributes
6999
7052
char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes
7054
if (!dimensions || !strcmp(dimensions,""))
7003
log_warn ("config.xml: dimensions value required"
7004
"for rectilinear mesh: %s\n"
7056
log_warn ("config.xml: dimensions value required "
7057
"for rectilinear mesh: %s\n", name);
7032
7082
adios_common_define_attribute (p_new_group,dims,"/",adios_integer,counterstr,"");
7041
int adios_define_mesh_rectilinear_coordinatesMultiVar (const char * coordinates
7042
,struct adios_group_struct * new_group
7090
int adios_define_mesh_rectilinear_coordinatesMultiVar (const char * coordinates,
7091
struct adios_group_struct * new_group,
7046
7095
char * c; // comma location
7047
7096
char * d1; // save of strdup
7048
struct adios_mesh_var_list_struct * var = 0;
7049
int64_t p_new_group = (int64_t) new_group;
7097
int64_t p_new_group = (int64_t) new_group;
7050
7098
char * coo_att_nam = 0; // coordinates attribute name
7051
7099
int counter = 0; // used to create ptsX attributes
7052
7100
char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes
7102
if (!coordinates || !strcmp(coordinates,""))
7056
log_warn ("config.xml: coordinates-multi-var value required"
7057
"for rectilinear mesh: %s\n"
7104
log_warn ("config.xml: coordinates-multi-var value required "
7105
"for rectilinear mesh: %s\n", name);
7104
int adios_define_mesh_rectilinear_coordinatesSingleVar (const char * coordinates
7105
,struct adios_group_struct * new_group
7149
int adios_define_mesh_rectilinear_coordinatesSingleVar (const char * coordinates,
7150
struct adios_group_struct * new_group,
7109
7154
char * d1; // save of strdup
7110
struct adios_mesh_var_list_struct * var = 0;
7111
int64_t p_new_group = (int64_t) new_group;
7155
int64_t p_new_group = (int64_t) new_group;
7112
7156
char * coo_att_nam = 0; // coordinates attribute name
7158
if (!coordinates || !strcmp(coordinates,""))
7116
log_warn ("config.xml: coordinates-single-var value required"
7117
"for rectilinear mesh: %s\n"
7160
log_warn ("config.xml: coordinates-single-var value required "
7161
"for rectilinear mesh: %s\n", name);
7124
7166
d1 = strdup (coordinates);
7125
7168
adios_conca_mesh_att_nam(&coo_att_nam, name, "coords-single-var");
7126
7169
adios_common_define_attribute (p_new_group,coo_att_nam,"/",adios_string,d1,"");
7127
7170
free (coo_att_nam);
7161
int adios_define_mesh_structured_dimensions (const char * dimensions
7162
,struct adios_group_struct * new_group
7205
int adios_define_mesh_structured_dimensions (const char * dimensions,
7206
struct adios_group_struct * new_group,
7166
7210
char * c; // comma location
7167
7211
char * d1; // save of strdup
7168
struct adios_mesh_item_list_struct * item = 0;
7169
int64_t p_new_group = (int64_t) new_group;
7212
int64_t p_new_group = (int64_t) new_group;
7170
7213
char * dim_att_nam = 0; // dimensions attribute name
7171
char * getdimsfrom = 0; // dimensions attribute name that is a var
7172
7214
int counter = 0; // used to create dimX attributes
7173
7215
char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes
7217
if (!dimensions || !strcmp(dimensions,""))
7177
log_warn ("config.xml: dimensions value required"
7178
"for structured mesh: %s\n"
7219
log_warn ("config.xml: dimensions value required "
7220
"for structured mesh: %s\n", name);
7185
7225
d1 = strdup (dimensions);
7186
7227
c = strtok (d1, ",");
7211
int adios_define_mesh_structured_pointsSingleVar (const char * points
7212
,struct adios_group_struct * new_group
7252
int adios_define_mesh_structured_pointsSingleVar (const char * points,
7253
struct adios_group_struct * new_group,
7216
char * c; // comma location
7217
7257
char * d1; // save of strdup
7218
struct adios_mesh_var_list_struct * var = 0;
7219
int64_t p_new_group = (int64_t) new_group;
7258
int64_t p_new_group = (int64_t) new_group;
7220
7259
char * pts_att_nam = 0; // points attribute name
7261
if (!points || !strcmp(points,""))
7224
log_warn ("config.xml: points-single-var value required"
7225
"for structured mesh: %s\n"
7263
log_warn ("config.xml: points-single-var value required "
7264
"for structured mesh: %s\n", name);
7232
7269
d1 = strdup (points);
7233
adios_conca_mesh_att_nam(&pts_att_nam, name, "points-single-var");
7234
adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,d1,"");
7270
adios_conca_mesh_att_nam(&pts_att_nam, name, "points-single-var");
7271
adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,d1,"");
7240
int adios_define_mesh_structured_pointsMultiVar (const char * points
7241
,struct adios_group_struct * new_group
7277
int adios_define_mesh_structured_pointsMultiVar (const char * points,
7278
struct adios_group_struct * new_group,
7245
7282
char * c; // comma location
7246
7283
char * d1; // save of strdup
7247
struct adios_mesh_var_list_struct * var = 0;
7248
int64_t p_new_group = (int64_t) new_group;
7284
int64_t p_new_group = (int64_t) new_group;
7249
7285
char * pts_att_nam = 0; // pointss attribute name
7250
7286
int counter = 0; // used to create ptsX attributes
7251
7287
char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes
7289
if (!points || !strcmp(points,""))
7255
log_warn ("config.xml: points-multi-var value required"
7256
"for structured mesh: %s\n"
7291
log_warn ("config.xml: points-multi-var value required "
7292
"for structured mesh: %s\n", name);
7364
int adios_define_mesh_unstructured_pointsMultiVar (const char * points
7365
,struct adios_group_struct * new_group
7391
int adios_define_mesh_unstructured_pointsMultiVar (const char * points,
7392
struct adios_group_struct * new_group,
7369
7396
char * c; // comma location
7370
7397
char * d1; // save of strdup
7371
struct adios_mesh_var_list_struct * var = 0;
7372
int64_t p_new_group = (int64_t) new_group;
7398
int64_t p_new_group = (int64_t) new_group;
7373
7399
char * pts_att_nam = 0; // pointss attribute name
7374
7400
int counter = 0; // used to create ptsX attributes
7375
7401
char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes
7403
if (!points || !strcmp(points,""))
7379
log_warn ("config.xml: points-multi-var value required"
7380
"for unstructured mesh: %s\n"
7405
log_warn ("config.xml: points-multi-var value required "
7406
"for unstructured mesh: %s\n", name);
7387
7411
d1 = strdup (points);
7389
7412
c = strtok (d1, ",");
7425
int adios_define_mesh_unstructured_pointsSingleVar (const char * points
7426
,struct adios_group_struct * new_group
7446
int adios_define_mesh_unstructured_pointsSingleVar (const char * points,
7447
struct adios_group_struct * new_group,
7430
char * c; // comma location
7431
7451
char * d1; // save of strdup
7432
struct adios_mesh_var_list_struct * var = 0;
7433
int64_t p_new_group = (int64_t) new_group;
7452
int64_t p_new_group = (int64_t) new_group;
7434
7453
char * pts_att_nam = 0; // points attribute name
7455
if (!points || !strcmp(points,""))
7438
log_warn ("config.xml: points-single-var value required"
7439
"for unstructured mesh: %s\n"
7457
log_warn ("config.xml: points-single-var value required "
7458
"for unstructured mesh: %s\n", name);
7474
7488
adios_common_define_attribute (p_new_group,ncellset_att_nam,"/",adios_integer,"1","");
7475
7489
free (ncellset_att_nam);
7479
log_warn ("config.xml: uniform-cells count value required"
7480
"for unstructured mesh: %s\n"
7488
log_warn ("config.xml: uniform-cells data value required"
7489
"for unstructured mesh: %s\n"
7497
log_warn ("config.xml: uniform-cells type value required"
7498
"for unstructured mesh: %s\n"
7491
if (!count || !strcmp(count,""))
7493
log_warn ("config.xml: uniform-cells count value required "
7494
"for unstructured mesh: %s\n", name);
7498
if (!data || !strcmp(data,""))
7500
log_warn ("config.xml: uniform-cells data value required "
7501
"for unstructured mesh: %s\n", name);
7505
if (!type || !strcmp(type,""))
7507
log_warn ("config.xml: uniform-cells type value required "
7508
"for unstructured mesh: %s\n", name);
7526
int adios_define_mesh_unstructured_mixedCells (const char * count
7529
,struct adios_group_struct * new_group
7534
int adios_define_mesh_unstructured_mixedCells (const char * count,
7537
struct adios_group_struct * new_group,
7533
7541
char * c; // comma location
7534
7542
char * d1; // save of strdup
7535
struct adios_mesh_cell_list_list_struct * cell_list = 0;
7536
struct adios_mesh_item_struct * item = 0;
7537
7543
int counter = 0; // used to create countX, typeX, dataX? attributes
7538
7544
char counterstr[5] = {0,0,0,0,0}; // used to create countX, typeX, dataX? attributes
7539
int64_t p_new_group = (int64_t) new_group;
7545
int64_t p_new_group = (int64_t) new_group;
7540
7546
char * ncellset_att_nam = 0; // ncellset attribute
7541
7547
char * ccounts_att_nam = 0; // ccountX attributes
7542
7548
char * cdata_att_nam = 0; // cdataX attributes
7543
7549
char * celltype_att_nam = 0; // ctypeX attributes
7547
log_warn ("config.xml: mixed-cells count value required"
7548
"for unstructured mesh: %s\n"
7556
log_warn ("config.xml: mixed-cells data value required"
7557
"for unstructured mesh: %s\n"
7551
if (!count || !strcmp(count,""))
7553
log_warn ("config.xml: mixed-cells count value required "
7554
"for unstructured mesh: %s\n", name);
7558
if (!data || !strcmp(data,""))
7560
log_warn ("config.xml: mixed-cells data value required "
7561
"for unstructured mesh: %s\n", name);
7565
if (!types || !strcmp(types,""))
7565
7567
log_warn ("config.xml: mixed-cells type value required "
7566
"for unstructured mesh: %s\n"
7568
"for unstructured mesh: %s\n", name);
7573
7573
d1 = strdup (count);
7574
7574
c = strtok (d1, ",");
7578
7577
//cell_list->cell_list.count.var = 0;
7656
7650
// Generate an error message
7657
7651
if (counter != cell_set_count){
7658
7652
log_warn ("config.xml: Please provide at least %d cell types of mesh: %s\n"
7659
"or use the 'uniform-cells' tag\n"
7653
"or use the 'uniform-cells' tag\n", cell_set_count, name);
7670
int adios_define_var_mesh(int64_t ptr_new_group, char * varname, char * varpath, char * meshname){
7660
// called by NO-XML API
7661
int adios_common_define_var_mesh (int64_t group_id, const char * varname, const char * meshname, const char * path)
7671
7663
char *mpath = 0;
7672
7664
mpath = malloc(strlen("/adios_schema")+strlen(varname)+1);
7673
7665
strcpy(mpath,varname);
7674
7666
strcat(mpath,"/adios_schema");
7675
adios_common_define_attribute (ptr_new_group,mpath,varpath,adios_string,meshname,"");
7667
adios_common_define_attribute (group_id, mpath, path, adios_string, meshname, "");
7680
int adios_define_var_centering(int64_t ptr_new_group, char * varname, char * varpath, char * centering){
7672
int adios_common_define_var_centering (int64_t group_id, const char * varname, const char * centering, const char * path)
7681
7674
char *mpath = 0;
7682
7675
mpath = malloc(strlen("/adios_schema/centering")+strlen(varname)+1);
7683
7676
strcpy(mpath,varname);
7684
7677
strcat(mpath,"/adios_schema/centering");
7685
adios_common_define_attribute (ptr_new_group,mpath,varpath,adios_string,centering,"");
7690
int adios_define_mesh_group(int64_t ptr_new_group, char * name, char * group){
7691
char * meshgroup = 0;
7692
adios_conca_mesh_att_nam(&group, name, "mesh-group");
7693
adios_common_define_attribute (ptr_new_group,meshgroup,"/",adios_string,group,"");
7697
int adios_define_mesh_file(int64_t ptr_new_group, char * name, char * file){
7698
char * meshfile = 0;
7699
adios_conca_mesh_att_nam(&meshfile, name, "mesh-file");
7700
adios_common_define_attribute (ptr_new_group,file,"/",adios_string,file,"");
7678
adios_common_define_attribute (group_id, mpath, path, adios_string, centering, "");
7683
int adios_common_define_mesh_group (int64_t group_id, const char * name, const char * group)
7686
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/mesh-group")+1);
7687
strcpy (mpath, "/adios_schema/");
7688
strcat (mpath, name);
7689
strcat (mpath, "/mesh-group");
7690
// adios_conca_mesh_att_nam(&group, name, "mesh-group");
7691
adios_common_define_attribute (group_id, mpath, "", adios_string, group, "");
7696
int adios_common_define_mesh_file (int64_t group_id, char * name, char * file){
7698
mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/mesh-file")+1);
7699
strcpy (mpath, "/adios_schema/");
7700
strcat (mpath, name);
7701
strcat (mpath, "/mesh-file");
7702
adios_common_define_attribute (group_id, mpath, "", adios_string, file, "");