57 std::sprintf(buf,
"COM datatype %d",type);
65 std::string w(wName); w+=
".";
75 for (
int i=0;
i<np; ++
i) {
78 ostr <<
"Pane "<<pane_ids[
i]<<
" ";
83 if ( nconn == 1 && strncmp(cnames,
":st",3)==0) {
86 COM_get_size( (w+cnames).c_str(), pane_ids[i], &ndims, &nglayers);
90 COM_get_array_const((w+cnames).c_str(), pane_ids[i], &dims);
92 ostr <<
"Structured mesh: "
93 << ndims <<
"-D (" << nglayers <<
" ghost layers);"
94 <<
" grid is " << dims[0];
98 ostr <<
"x" << dims[1];
103 ostr <<
"x" << dims[2];
113 COM_get_size((w+
"nc").c_str(), pane_ids[i], &nnodes, &ngnodes);
114 ostr <<
"Unstructured mesh: "
115 << nnodes <<
" nodes (" << ngnodes <<
" ghosts)";
119 std::istringstream is( cnames);
120 for (
int c=0; c<nconn; ++c) {
127 ostr <<
"\n Connectivity table " << c <<
" has ";
129 ostr << ne <<
" elements (" << ng <<
" ghosts)";
145 std::istringstream is(atts);
146 for (
int i=0;
i<na; ++
i) {
148 std::string aname; is >> aname;
154 ostr <<
"" << aname <<
" ("<<units<<
") " << ncomp <<
" x " <<
COM_get_type(type) <<
" ";
160 ostr <<
" Window: " << nitems <<
" items ("<<ng<<
" ghosts)";
163 for (
int i=0;
i<np; ++
i) {
167 ostr <<
"\n Panel("<<pane_ids[
i]<<
"): "<<nitems<<
" items ("<<ng<<
" ghosts)";
179 ostr <<
" (Unrecognized attribute location "<<loc<<
")";
183 #ifdef DEBUG_FILE_DUMP
184 std::ofstream fout(( DEBUG_FILE_DUMP + aname +
".txt").c_str());
187 for (
int c=0; c<ncomp; ++c) {
189 COM_get_array_const((w + aname).c_str(), pane_ids[
i], &data, &strd,
192 COM_get_array_const((w + (
char)(
'1' + c) +
'-' + aname).c_str(),
193 pane_ids[i], &data, &strd, &cap);
195 fout <<
"NULL\n##################################################\n";
201 for (j=0; j<nitems; ++
j) {
202 fout << (int)((
const char*)data)[j];
203 if ((j + 1) % 8 == 0)
211 for (j=0; j<nitems; ++
j) {
212 fout << ((
const int*)data)[
j];
213 if ((j + 1) % 8 == 0)
221 for (j=0; j<nitems; ++
j) {
222 fout << ((
const float*)data)[
j];
223 if ((j + 1) % 8 == 0)
231 for (j=0; j<nitems; ++
j) {
232 fout << ((
const double*)data)[
j];
233 if ((j + 1) % 8 == 0)
240 fout <<
"\n##################################################\n";
244 #endif // DEBUG_FILE_DUMP
254 int main(
int argc,
char *argv[]) {
258 std::cerr<<
"Usage: printtest <hdf file to print>\n";
270 const char *hdf_in = argv[1];
272 const char *win_in =
"random_window";
273 std::string w(win_in); w+=
".";
280 printf(
"Analysis of file '%s':\n",hdf_in);
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
This file contains the prototypes for Roccom API.
void COM_print_window(const char *wName, std::ostream &ostr)
Print a terse human-readable description of this window to this ostream.
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
void COM_get_connectivities(const char *wname, int pane_id, int *nc, std::string &names)
std::string COM_get_type(int type)
Use Rocin to read an HDF file, and print out a human-readable text listing of everything in the file...
void COM_get_attributes(const char *wname, int *na, std::string &names)
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
Rocin creates a series of Roccom windows by reading in a list of files.
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
void COM_free_buffer(int **buf)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)