43 int main(
int argc,
char *argv[]) {
44 map<int, string> typeAsString;
50 typeAsString[
COM_INT] =
"COM_INT";
88 cout <<
"Usage: " << argv[0] <<
" <inputfile> <outputfile> " << endl;
92 const char *file_in = argv[1];
93 const char *file_out = argv[2];
95 const char *win_in =
"rocin_win";
96 const char *win_out=
"user_win";
98 string win_in_pre( win_in); win_in_pre.append(
".");
99 string win_out_pre( win_out); win_out_pre.append(
".");
111 for (
int i=0;
i<np; ++
i) {
118 if ( nconn == 1 && strncmp(cnames,
":st",3)==0) {
121 COM_get_size( (win_in_pre+cnames).c_str(), pane_ids[i], &nelems, &nglayers);
122 COM_set_size( (win_out_pre+cnames).c_str(), pane_ids[i], nelems, nglayers);
126 COM_get_array_const( (win_in_pre+cnames).c_str(), pane_ids[i], &dims);
129 cout <<
"Structured information" << endl;
130 cout <<
" nelems = " << nelems << endl;
131 cout <<
" nglayers = " << nglayers << endl;
132 cout <<
" dims[0] = " << dims[0] << endl;
133 cout <<
" dims[1] = " << dims[1] << endl;
141 COM_get_size((win_in_pre+
"nc").c_str(), pane_ids[i], &nnodes, &ngnodes);
142 COM_set_size((win_out_pre+
"nc").c_str(), pane_ids[i], nnodes, ngnodes);
143 cout <<
"# nodes in dest set to " << nnodes
144 <<
" & # gnodes in dest set to " << ngnodes << endl;
148 istringstream is( cnames);
149 for (
int k=0;
k<nconn; ++
k) {
153 COM_get_size((win_in_pre+cname).c_str(), pane_ids[i], &nelems, &ng);
154 COM_set_size((win_out_pre+cname).c_str(), pane_ids[i], nelems, ng);
155 cout <<
"Connectivity table " << i <<
" has " << nelems
156 <<
" elements and " << ng <<
" ghost nodes" << endl;
174 string allatts(
"pconn ridges ");
177 istringstream is(allatts.c_str());
178 for (
int i=0;
i<na; ++
i) {
180 string aname; is >> aname;
186 cout << (win_in_pre+aname).c_str() <<
" has type " << typeAsString[type]
187 <<
" (" << type <<
')' << endl;
188 cout << (win_in_pre+aname).c_str() <<
" has location '" << loc <<
'\''
190 cout << (win_in_pre+aname).c_str() <<
" has " << ncomp <<
" components"
192 string waname = win_out_pre+aname;
196 cout <<
"Windowed attribute " << endl;
200 COM_get_size((win_in_pre+aname).c_str(), 0, &nitems, &ng);
201 cout << (win_in_pre+aname).c_str() <<
" has " << nitems <<
" items and "
202 << ng <<
" ghost items." << endl;
210 cout <<
"Panel attribute" << endl;
213 for (
int i=0;
i<np; ++
i) {
218 COM_get_size((win_in_pre+aname).c_str(), pane_ids[
i], &nitems, &ng);
219 cout << (win_in_pre+aname).c_str() <<
" has " << nitems
220 <<
" items and " << ng <<
" ghost items." << endl;
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
This file contains the prototypes for Roccom API.
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)
#define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
void COM_get_attributes(const char *wname, int *na, std::string &names)
void COM_print_profile(const char *fname, const char *header)
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_array_const(const char *wa_str, int pane_id, const void *addr, int strd=0, int cap=0)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
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)
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)
Contains declaration of the base class for Roccom implementations.