35 #ifndef __ROCCOM_CPP_H__
36 #define __ROCCOM_CPP_H__
42 #error This header file is for C++. Include "roccom_c.h" instead for C.
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 #define inline extern "C"
58 { COM::Roccom_base::init( argc, argv); }
60 { COM::Roccom_base::finalize(); }
63 {
return COM::Roccom_base::initialized(); }
65 { COM::Roccom_base::abort( ierr); }
68 { COM::Roccom_base::set_default_communicator( comm); }
70 {
return COM::Roccom_base::get_default_communicator(); }
82 {
COM_get_roccom()->unload_module( libname, winname?winname:
"", 0); }
90 inline void COM_new_window(
const std::string wname, MPI_Comm c=MPI_COMM_NULL)
107 {
COM_get_roccom()->window_init_done( w_str.c_str(), pane_changed); }
119 const int type,
int ncomp,
const char *unit)
120 {
COM_get_roccom()->new_attribute( wa_str, loc, type, ncomp, unit); }
124 const int type,
int ncomp,
const char *unit)
125 {
COM_get_roccom()->new_attribute( wa_str.c_str(), loc, type, ncomp, unit); }
136 inline void COM_set_size(
const char *wa_str,
int pane_id,
int size,
int ng=0)
140 inline void COM_set_size(
const std::string wa_str,
int pane_id,
int size,
int ng=0)
141 {
COM_get_roccom()->set_size( wa_str.c_str(), pane_id, size, ng); }
143 template <
class Type>
148 COM_get_roccom()->set_object( wa_str, pane_id, addr, (COM_Object*)(addr));
151 template <
class Type>
157 void *addr,
int strd=0,
int cap=0)
158 {
COM_get_roccom()->set_array( wa_str, pane_id, addr, strd, cap); }
161 const void *addr,
int strd=0,
int cap=0)
163 const_cast<void*>(addr), strd, cap,
true); }
167 void *addr,
int strd=0,
int cap=0)
168 {
COM_get_roccom()->set_array( wa_str.c_str(), pane_id, addr, strd, cap); }
171 const void *addr,
int strd=0,
int cap=0)
173 const_cast<void*
>(addr), strd, cap,
true); }
177 const void *lbound,
const void *ubound)
178 {
COM_get_roccom()->set_bounds( wa_str, pane_id, lbound, ubound); }
182 const void *lbound,
const void *ubound)
183 {
COM_get_roccom()->set_bounds( wa_str.c_str(), pane_id, lbound, ubound); }
185 #define COM_set_bounds_prototype(type) \
186 inline void COM_set_bounds( const char *wa_str, int pane_id, \
187 type lbound, type ubound) \
188 { COM_get_roccom()->set_bounds( wa_str, pane_id, &lbound, &ubound); }
197 void **addr=NULL,
int strd=0,
int cap=0)
198 {
COM_get_roccom()->allocate_array( wa_str, pane_id, addr, strd, cap); }
201 void **addr=NULL,
int strd=-1,
int cap=0)
202 {
COM_get_roccom()->resize_array( wa_str, pane_id, addr, strd, cap); }
206 void **addr=NULL,
int strd=0,
int cap=0)
207 {
COM_get_roccom()->allocate_array( wa_str.c_str(), pane_id, addr, strd, cap); }
210 void **addr=NULL,
int strd=-1,
int cap=0)
211 {
COM_get_roccom()->resize_array( wa_str.c_str(), pane_id, addr, strd, cap); }
215 const void *val,
int v_strd,
int v_size)
216 {
COM_get_roccom()->append_array( wa_str, pane_id, val, v_strd, v_size); }
220 const void *val,
int v_strd,
int v_size)
221 {
COM_get_roccom()->append_array( wa_str.c_str(), pane_id, val, v_strd, v_size); }
225 int wg=1,
const char *ptnname=0,
int val=0)
226 {
COM_get_roccom()->use_attribute(wname, attr, wg, ptnname, val); }
230 int wg=1,
const char *ptnname=0,
int val=0)
231 {
COM_get_roccom()->use_attribute(wname.c_str(), attr.c_str(), wg, ptnname, val); }
235 int wg=1,
const char *ptnname=0,
int val=0)
236 {
COM_get_roccom()->clone_attribute(wname, attr, wg, ptnname, val); }
240 int wg=1,
const char *ptnname=0,
int val=0)
241 {
COM_get_roccom()->clone_attribute(wname.c_str(), attr.c_str(), wg, ptnname, val); }
245 int wg=1,
const char *ptnname=0,
int val=0)
246 {
COM_get_roccom()->copy_attribute(wname, attr, wg, ptnname, val); }
250 int wg=1,
const char *ptnname=0,
int val=0)
251 {
COM_get_roccom()->copy_attribute(wname.c_str(), attr.c_str(), wg, ptnname, val); }
254 (
int trg_hdl,
int src_hdl,
int wg=1,
int ptn_hdl=0,
int val=0)
255 {
COM_get_roccom()->copy_attribute(trg_hdl, src_hdl, wg, ptn_hdl, val); }
258 (
int trg_hdl,
int src_hdl,
int wg,
int ptn_hdl,
int val)
259 {
COM_get_roccom()->copy_attribute(trg_hdl, src_hdl, wg, ptn_hdl, val); }
270 int *type,
int *ncomp, std::string *unit)
271 {
COM_get_roccom()->get_attribute( wa_str.c_str(), loc, type, ncomp, unit); }
274 inline void COM_get_size(
const char *wa_str,
int pane_id,
int *size,
int *ng=0)
278 inline void COM_get_size(
const std::string wa_str,
int pane_id,
int *size,
int *ng=0)
279 {
COM_get_roccom()->get_size( wa_str.c_str(), pane_id, size, ng); }
282 #define COM_get_array_prototype( type) \
283 inline void COM_get_array( const char *wa_str, int pane_id, \
284 type **addr, int *strd=NULL, int *cap=NULL) \
285 { COM_get_roccom()->get_array( wa_str, pane_id, (void**)addr, strd, cap); }
296 #define COM_get_array_const_prototype( type) \
297 inline void COM_get_array_const( const char *wa_str, int pane_id, \
298 const type **addr, int *strd=NULL, int *cap=NULL) \
299 { COM_get_roccom()->get_array( wa_str, pane_id, \
300 (void**)addr, strd, cap, true); }
312 void *val,
int v_strd=0,
int v_size=0,
317 void *lbound,
void *ubound)
318 {
COM_get_roccom()->get_bounds( wa_str, pane_id, lbound, ubound); }
327 {
COM_get_roccom()->set_function( wf_str, func, intents, types); }
331 Member_func_ptr func,
336 wa_str, intents, types); }
344 {
COM_get_roccom()->set_member_function( wf_str, func, wa_str, intents, types); }
364 int *nc, std::string &names)
365 {
COM_get_roccom()->get_connectivities( wname, pane_id, nc, names); }
373 int **pane_ids=NULL,
int rank=-2) {
374 std::vector<int> vec;
376 if ( npanes) *npanes = vec.size();
386 int *nc,
char **names=NULL) {
388 COM_get_roccom()->get_connectivities( wname, pane_id, nc, str, names);
417 {
return COM_get_roccom()->get_attribute_handle( waname.c_str()); }
425 {
return COM_get_roccom()->get_attribute_handle_const( waname.c_str()); }
449 const void *args[] = { wa1, wa2};
453 const void *wa2,
const void *wa3) {
454 const void *args[] = { wa1, wa2, wa3 };
458 const void *wa1,
const void *wa2,
459 const void *wa3,
const void *wa4) {
460 const void *args[] = { wa1, wa2, wa3, wa4 };
465 const void *wa2,
const void *wa3,
466 const void *wa4,
const void *wa5) {
467 const void *args[] = { wa1, wa2, wa3, wa4, wa5 };
472 const void *wa2,
const void *wa3,
473 const void *wa4,
const void *wa5,
475 const void *args[] = { wa1, wa2, wa3, wa4, wa5, wa6 };
480 const void *wa2,
const void *wa3,
481 const void *wa4,
const void *wa5,
482 const void *wa6,
const void *wa7) {
483 const void *args[] = { wa1, wa2, wa3, wa4, wa5, wa6, wa7 };
494 const void *wa2,
int *
id) {
495 const void *args[] = { wa1, wa2};
499 const void *wa2,
const void *wa3,
501 const void *args[] = { wa1, wa2, wa3 };
505 const void *wa2,
const void *wa3,
506 const void *wa4,
int *
id) {
507 const void *args[] = { wa1, wa2, wa3, wa4 };
512 const void *wa2,
const void *wa3,
513 const void *wa4,
const void *wa5,
515 const void *args[] = { wa1, wa2, wa3, wa4, wa5 };
520 const void *wa2,
const void *wa3,
521 const void *wa4,
const void *wa5,
522 const void *wa6,
int *
id) {
523 const void *args[] = { wa1, wa2, wa3, wa4, wa5, wa6 };
528 const void *wa2,
const void *wa3,
529 const void *wa4,
const void *wa5,
530 const void *wa6,
const void *wa7,
532 const void *args[] = { wa1, wa2, wa3, wa4, wa5, wa6, wa7 };
564 {
return COM::Attribute::compatible_types( type1, type2); }
void COM_wait(const int id)
int COM_Type
Indices for derived data types.
void COM_get_communicator(const char *wname, MPI_Comm *comm)
void COM_set_debug(bool debug)
void COM_delete_window(const char *wname)
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
#define COM_assertion_msg(EX, msg)
void COM_get_modules(std::vector< std::string > &names)
#define COM_set_bounds_prototype(type)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
void COM_set_default_communicator(MPI_Comm comm)
void COM_set_function(const char *wf_str, Func_ptr func, const char *intents, const COM_Type *types)
void COM_get_bounds(const char *wa_str, int pane_id, void *lbound, void *ubound)
Get the lower and upper bounds of an attribute.
real *8 function offset(vNorm, x2, y2, z2)
void COM_set_object(const char *wa_str, int pane_id, Type *addr)
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
void COM_delete_attribute(const char *wa_str)
Delete an existing attribute.
void COM_get_windows(std::vector< std::string > &names)
void COM_copy_array(const char *wa_str, int pane_id, void *val, int v_strd=0, int v_size=0, int offset=0)
Copy an array from an attribute on a specific pane into a given buffer.
void COM_deallocate_array(const char *wa_str, const int pid=0)
Deallocate space for an attribute in a pane, asuming the memory was allocated allocate_mesh or alloca...
void COM_get_connectivities(const char *wname, int pane_id, int *nc, std::string &names)
int COM_test(const int id)
void COM_get_object(const char *wa_str, int pane_id, Type **addr)
void COM_set_bounds(const char *wa_str, int pane_id, const void *lbound, const void *ubound)
Set the lower and upper bounds of an attribute.
void COM_get_attributes(const char *wname, int *na, std::string &names)
void COM_load_module(const char *libname, const char *winname)
void COM_use_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Use the subset of panes of another window of which the given pane attribute has value val...
#define COM_get_array_const_prototype(type)
void COM_print_profile(const char *fname, const char *header)
void(* Func_ptr)()
Pointer of functions.
void COM_close_module(const char *libname, const char *winname=NULL)
int COM_compatible_types(COM_Type type1, COM_Type type2)
int COM_check_bounds(const char *wa_str, int pane_id)
Check the lower and upper bounds of an attribute for a specific pane.
#define COM_get_array_prototype(type)
void COM_set_profiling_barrier(int hdl, MPI_Comm comm)
void COM_window_init_done(const char *w_str, int pane_changed=true)
static int get_sizeof(MPI_Datatype i)
Get the size of a given MPI data type.
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
int COM_get_sizeof(const COM_Type type, int c)
void COM_clone_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Clone the subset of panes of another window of which the given pane attribute has value val...
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,...)
void COM_unload_module(const char *libname, const char *winname=NULL)
void COM_allocate_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=0, int cap=0)
Allocate space for an attribute on a specific pane and return the address by setting addr...
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
int COM_get_attribute_handle_const(const char *waname)
int COM_get_window_handle(const char *wname)
void COM_delete_pane(const char *str, int pid)
void COM_init(int *argc, char ***argv)
void COM_get_parent(const char *waname, int pane_id, std::string &parent)
void COM_copy_attribute_handles(int trg_hdl, int src_hdl, int with_ghost, int ptn_hdl, int val)
void COM_copy_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Copy an attribute onto another.
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)
void COM_set_member_function(const char *wf_str, Member_func_ptr func, const char *wa_str, const char *intents, const COM_Type *types)
COM_END_NAME_SPACE COM::Roccom_base * COM_get_roccom()
MPI_Comm COM_get_default_communicator()
void COM_append_array(const char *wa_str, int pane_id, const void *val, int v_strd, int v_size)
Append an array to the end of the attribute on a specific pane and return the new address by setting ...
void COM_icall_function(const int wf, int argc,...)
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)
int COM_get_status(const char *waname, const int pane_id)
Contains declaration of the base class for Roccom implementations.