53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 extern "C" void COM_F_FUNC2( com_abort, COM_ABORT) (
const int &ierr)
76 COM_SET_DEFAULT_COMMUNICATOR)(
const int &comm)
80 COM_GET_DEFAULT_COMMUNICATOR)()
88 (
const char *libname,
const char *winname,
92 std::string( winname, l2));
95 extern "C" void COM_F_FUNC2( com_unload_module_1, COM_UNLOAD_MODULE_1)
96 (
const char *libname,
int l1)
101 extern "C" void COM_F_FUNC2( com_unload_module_2, COM_UNLOAD_MODULE_2)
102 (
const char *libname,
const char *winname,
int l1,
int l2)
105 std::string( winname, l2));
112 #define CHKLEN(x) COM_assertion( x>=0 && x<MAX_NAMELEN)
120 (
const int &stage,
const char *str1,
void *ptr1,
121 const char *str2,
void *ptr2,
122 int len1,
int len2,
int len3,
int len4);
124 inline int get_f90ptr_treat() {
129 ( 0, 0, 0, 0, 0, 0, 0, 0, 0);
134 extern "C" void COM_F_FUNC2(com_new_window_null,COM_NEW_WINDOW_NULL)
135 (
const char *w_str,
int w_len)
138 extern "C" void COM_F_FUNC2(com_new_window_mpi,COM_NEW_WINDOW_MPI)
139 (
const char *w_str,
const int &c,
int w_len) {
147 (
const char *str,
int len)
150 extern "C" void COM_F_FUNC2(com_window_init_done_1arg, COM_WINDOW_INIT_DONE_1ARG)
151 (
const char *w_str,
int w_len)
154 extern "C" void COM_F_FUNC2(com_window_init_done_2arg, COM_WINDOW_INIT_DONE_2ARG)
155 (
const char *w_str,
int *c,
int w_len)
159 (
const char *w_str,
const int &pid,
int w_len)
163 (
const char *wa_str,
const char &loc,
const int &type,
164 const int &size,
const char *u_str,
165 int wa_len,
int l_len,
int u_len)
168 COM_get_roccom()->new_attribute(
string( wa_str,(
int)wa_len), loc, type,
169 size,
string( u_str,(
int)u_len));
172 extern "C" void COM_F_FUNC2(com_delete_attribute,COM_DELETE_ATTRIBUTE)
173 (
const char *wa_str,
int wa_len)
180 (
const char *wa_str,
const int &pane_id,
const int &size,
int len)
183 COM_get_roccom()->set_size( std::string(wa_str,len), pane_id, size);
187 (
const char *wa_str,
const int &pane_id,
188 const int &size,
const int &ng,
int len)
191 COM_get_roccom()->set_size( std::string(wa_str,len), pane_id, size, ng);
197 {
if (
x==(
void*)p) *p=NULL;
else *p =
x; }
201 (
void *
x,
void **p,
void *,
void*)
202 {
if (
x==(
void*)p) *p=NULL;
else *p =
x; }
207 {
if (
x==(
void*)p) *p=NULL;
else *p =
x; }
212 {
if (
x==(
void*)p) *p=NULL;
else *p =
x; }
217 {
if (
x==(
void*)p) *p=NULL;
else *p =
x; }
219 extern "C" void COM_F_FUNC2( com_set_array_null, COM_SET_ARRAY_NULL)
220 (
const char *wa_str,
const int &pane_id,
int len)
224 extern "C" void COM_F_FUNC2( com_set_array_const_null, COM_SET_ARRAY_CONST_NULL)
225 (
const char *wa_str,
const int &pane_id,
int len)
230 (
const char *wa_str,
const int &pane_id,
void *p,
int len)
234 extern "C" void COM_F_FUNC2( com_set_external_const, COM_SET_EXTERNAL_CONST)
235 (
const char *wa_str,
const int &pane_id,
void *p,
int len)
241 (
const char *com,
int len)
242 { std::string command(com, len);
return system( command.c_str()); }
254 template <
int dim, COM_Type type>
304 typedef void(*Func)(
void*,
void**);
305 (*(Func)f)( addr, &ptr);
308 typedef void(*Func)(
void*,
void**, int);
309 (*(Func)f)( addr, &ptr, l);
315 template <
int dim, COM_Type type>
318 void *addr,
int l=0) {
330 int tonull=(ptr.
at()==NULL);
333 typedef void(*Func)(
void*,
int*,
void*, int);
334 (*(Func)f)( addr, &tonull, ptr.
at(), l);
337 typedef void(*Func)(
void*,
int*,
void*);
338 (*(Func)f)( addr, &tonull, ptr.
at());
351 int tonull=(ptr.
at()==NULL);
353 typedef void(*Func)(
void*,
int*,
void*,
void*,int);
354 (*(Func)f)( addr, &tonull, ptr.
at(), &ptr.
n1, l);
357 typedef void(*Func)(
void*,
int*,
void*,
void*);
358 (*(Func)f)( addr, &tonull,ptr.
at(), &ptr.
n1);
371 int tonull=(ptr.
at()==NULL);
373 typedef void(*Func)(
void*,
int*,
void*,
void*,
void*,int);
374 (*(Func)f)( addr, &tonull, ptr.
at(), &ptr.
n1, &ptr.
n2, l);
377 typedef void(*Func)(
void*,
int*,
void*,
void*,
void*);
378 (*(Func)f)( addr, &tonull,ptr.
at(), &ptr.
n1, &ptr.
n2);
385 template <
int dim, COM_Type type>
388 int strd,
int cap,
int l=0) {
389 void *ptr=com_get_address_f<dim, type>( addr, l);
396 #define COM_SET_ARRAY_SCALAR( func, FUNC) \
397 extern "C" void COM_F_FUNC2( func, FUNC) \
398 ( const char *wa_str, const int &pid, void *addr, \
402 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr); \
410 template <
int dim, COM_Type type>
413 int strd,
int cap,
int l1,
int l2) {
414 int f90ptr_treat = get_f90ptr_treat();
417 int wa_len=l2;
CHKLEN(wa_len);
418 com_set_array_helper<dim,type>( string(waname, wa_len), pane_id, addr,
422 int wa_len=l1;
CHKLEN(wa_len);
424 com_set_array_helper<dim,type>( string(waname, wa_len), pane_id, addr,
428 com_set_array_helper<dim,type>( string(waname, wa_len), pane_id, addr,
436 #define COM_SET_ARRAY_PTR( func, FUNC, dim, type) \
437 extern "C" void COM_F_FUNC2( func, FUNC) \
438 ( const char *wa_str, const int &pid, void *addr, \
441 com_set_array_f<dim,type>( wa_str, pid, addr, 0, 0, l1, l2);\
454 #define COM_SET_ARRAY_STRD_SCALAR( func, FUNC) \
455 extern "C" void COM_F_FUNC2( func, FUNC) \
456 ( const char *wa_str, const int &pid, void *addr, const int &strd, \
460 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr, strd); \
469 #define COM_SET_ARRAY_STRD_PTR( func, FUNC, dim, type) \
470 extern "C" void COM_F_FUNC2( func, FUNC) \
471 ( const char *wa_str, const int &pid, void *addr, \
472 const int &strd, int l1, int l2) \
474 com_set_array_f<dim,type>( wa_str, pid, addr, strd, 0, l1, l2);\
496 #define COM_SET_ARRAY_DYN_SCALAR( func, FUNC) \
497 extern "C" void COM_F_FUNC2( func, FUNC) \
498 ( const char *wa_str, const int &pid, void *addr, const int &strd, \
499 const int &cap, int wa_len, int) \
502 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr, strd, cap); \
509 #define COM_SET_ARRAY_DYN_PTR( func, FUNC, dim, type) \
510 extern "C" void COM_F_FUNC2( func, FUNC) \
511 ( const char *wa_str, const int &pid, void *addr, \
512 const int &strd, const int &cap, int l1, int l2) \
514 com_set_array_f<dim,type>( wa_str, pid, addr, strd, cap, l1, l2); \
536 template <
int dim, COM_Type type>
539 int strd,
int cap,
int l=0) {
541 void *ptr=com_get_address_f<dim,type>( addr, l);
543 COM_get_roccom()->set_array( waname, pane_id, ptr, strd, cap,
true);
548 #define COM_SET_ARRAY_CONST_SCALAR( func, FUNC) \
549 extern "C" void COM_F_FUNC2( func, FUNC) \
550 ( const char *wa_str, const int &pid, void *addr, \
554 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr, true); \
562 template <
int dim, COM_Type type>
565 int strd,
int cap,
int l1,
int l2) {
566 int f90ptr_treat = get_f90ptr_treat();
569 int wa_len=l2;
CHKLEN(wa_len);
570 com_set_array_const_helper<dim,type>( string(waname, wa_len), pane_id,
571 addr, strd, cap, l1);
574 int wa_len=l1;
CHKLEN(wa_len);
576 com_set_array_const_helper<dim,type>( string(waname, wa_len), pane_id,
577 addr, strd, cap, l2);
579 com_set_array_const_helper<dim,type>( string(waname, wa_len), pane_id,
586 #define COM_SET_ARRAY_CONST_PTR( func, FUNC, dim, type) \
587 extern "C" void COM_F_FUNC2( func, FUNC) \
588 ( const char *wa_str, const int &pid, void *addr, \
591 com_set_array_const_f<dim,type>( wa_str, pid, addr, 0, 0, l1, l2);\
597 COM_SET_ARRAY_CONST_FLT1D, 1,
COM_REAL);
603 COM_SET_ARRAY_CONST_FLT2D, 2,
COM_REAL);
609 COM_SET_ARRAY_CONST_FLT3D, 3,
COM_REAL);
613 #define COM_SET_ARRAY_CONST_STRD_SCALAR( func, FUNC) \
614 extern "C" void COM_F_FUNC2( func, FUNC) \
615 ( const char *wa_str, const int &pid, void *addr, int &strd, \
619 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr, strd, true); \
623 COM_SET_ARRAY_CONST_INT_STRD);
625 COM_SET_ARRAY_CONST_FLT_STRD);
627 COM_SET_ARRAY_CONST_DBL_STRD);
631 #define COM_SET_ARRAY_CONST_STRD_PTR( func, FUNC, dim, type) \
632 extern "C" void COM_F_FUNC2( func, FUNC) \
633 ( const char *wa_str, const int &pid, void *addr, \
634 const int &strd, int l1, int l2) \
636 com_set_array_const_f<dim,type>( wa_str, pid, addr, strd, 0, l1, l2);\
642 COM_SET_ARRAY_CONST_FLT1D_STRD, 1,
COM_REAL);
644 COM_SET_ARRAY_CONST_DBL1D_STRD, 1,
COM_DOUBLE);
648 COM_SET_ARRAY_CONST_FLT2D_STRD, 2,
COM_REAL);
650 COM_SET_ARRAY_CONST_DBL2D_STRD, 2,
COM_DOUBLE);
654 COM_SET_ARRAY_CONST_FLT3D_STRD, 3,
COM_REAL);
656 COM_SET_ARRAY_CONST_DBL3D_STRD, 3,
COM_DOUBLE);
658 #define COM_SET_ARRAY_CONST_DYN_SCALAR( func, FUNC) \
659 extern "C" void COM_F_FUNC2( func, FUNC) \
660 ( const char *wa_str, const int &pid, void *addr, const int &strd, \
661 const int &cap, int wa_len, int) \
664 COM_get_roccom()->set_array( string(wa_str,wa_len), pid, addr, \
669 COM_SET_ARRAY_CONST_INT_DYN);
671 COM_SET_ARRAY_CONST_FLT_DYN);
673 COM_SET_ARRAY_CONST_DBL_DYN);
675 #define COM_SET_ARRAY_CONST_DYN_PTR( func, FUNC, dim, type) \
676 extern "C" void COM_F_FUNC2( func, FUNC) \
677 ( const char *wa_str, const int &pid, void *addr, \
678 const int &strd, const int &cap, int l1, int l2) \
680 com_set_array_const_f<dim,type>( wa_str, pid, addr, strd, cap, l1, l2); \
686 COM_SET_ARRAY_CONST_FLT1D_DYN, 1,
COM_REAL);
688 COM_SET_ARRAY_CONST_DBL1D_DYN, 1,
COM_DOUBLE);
692 COM_SET_ARRAY_CONST_FLT2D_DYN, 2,
COM_REAL);
694 COM_SET_ARRAY_CONST_DBL2D_DYN, 2,
COM_DOUBLE);
698 COM_SET_ARRAY_CONST_FLT3D_DYN, 3,
COM_REAL);
700 COM_SET_ARRAY_CONST_DBL3D_DYN, 3,
COM_DOUBLE);
702 #define COM_SET_BOUNDS( func, FUNC) \
703 extern "C" void COM_F_FUNC2( func, FUNC) \
704 ( const char *wa_str, const int &pane_id, \
705 const void *lbound, const void *ubound, int len) \
708 COM_get_roccom()->set_bounds( string(wa_str,len), pane_id, lbound, ubound); \
716 extern "C" void COM_F_FUNC2( com_alloc_array_win, COM_ALLOC_ARRAY_WIN)
717 (
const char *wa_str,
int len)
720 extern "C" void COM_F_FUNC2( com_alloc_array_pane, COM_ALLOC_ARRAY_PANE)
721 (
const char *wa_str,
const int &pane_id,
int len)
722 {
COM_get_roccom()->allocate_array( std::string( wa_str, len), pane_id); }
724 template <
int dim, COM_Type type, Access_mode mode>
727 int &strd,
int &cap,
int offset,
int l=0) {
729 if ( mode !=
AM_RESIZE && strd<0) strd=0;
733 COM_get_roccom()->allocate_array( waname, pane_id, NULL, strd, cap);
737 COM_get_roccom()->resize_array( waname, pane_id, NULL, strd, cap);
741 if ( dim==0) ptr.
ptr = addr;
742 else ptr.
ptr = com_get_address_f<dim,type>( addr, l);
753 com_set_address_f<dim, type>( ptr, addr, l);
756 template <
int dim, COM_Type type, Access_mode mode>
759 int &strd,
int &cap,
int offset,
762 if ( dim==0 && mode==
AM_COPY) {
763 int wa_len=l1;
CHKLEN(wa_len);
764 com_obtain_array_helper<dim,type,mode>( string(waname, wa_len), pane_id,
768 int f90ptr_treat = get_f90ptr_treat();
771 int wa_len=l2;
CHKLEN(wa_len);
772 com_obtain_array_helper<dim,type,mode>( string(waname, wa_len), pane_id,
773 addr, strd, cap,
offset, l1);
776 int wa_len=l1;
CHKLEN(wa_len);
778 com_obtain_array_helper<dim,type,mode>( string(waname, wa_len), pane_id,
779 addr, strd, cap,
offset, l2);
781 com_obtain_array_helper<dim,type,mode>( string(waname, wa_len), pane_id,
787 #define COM_OBTAIN_ARRAY( func, FUNC, dim, type, mode) \
788 extern "C" void COM_F_FUNC2( func, FUNC) \
789 ( const char *waname, const int &pane_id, \
790 void *addr, int l1, int l2) \
792 int minusone=-1, zero = 0; \
793 com_obtain_array_f<dim,type,mode>( waname, pane_id, addr, \
794 minusone, zero, zero, l1, l2); \
816 extern "C" void COM_F_FUNC2( com_resize_array_win, COM_RESIZE_ARRAY_WIN)
817 (
const char *wa_str,
int len)
820 extern "C" void COM_F_FUNC2( com_resize_array_pane, COM_RESIZE_ARRAY_PANE)
821 (
const char *wa_str,
const int &pane_id,
int len)
822 {
COM_get_roccom()->resize_array( std::string( wa_str, len), pane_id); }
906 #define COM_OBTAIN_ARRAY_STRD( func, FUNC, dim, type, mode) \
907 extern "C" void COM_F_FUNC2( func, FUNC) \
908 ( const char *waname, const int &pane_id, void *addr, \
909 int &strd, int l1, int l2) \
912 com_obtain_array_f<dim, type,mode>( waname, pane_id, addr, strd, zero, \
993 #define COM_OBTAIN_ARRAY_DYN( func, FUNC, dim, type, mode) \
994 extern "C" void COM_F_FUNC2( func, FUNC) \
995 ( const char *waname, const int &pane_id, void *addr, \
996 int &strd, int &cap, int l1, int l2) \
998 com_obtain_array_f<dim, type, mode>( waname, pane_id, addr, \
999 strd, cap, 0, l1, l2);\
1079 #define COM_COPY_ARRAY_OFF( func, FUNC, dim, type) \
1080 extern "C" void COM_F_FUNC2( func, FUNC) \
1081 ( const char *waname, const int &pane_id, void *addr, const int &strd, \
1082 const int &cap, const int &offset, int l1, int l2) \
1084 com_obtain_array_f<dim, type, AM_COPY>( waname, pane_id, addr, \
1085 const_cast<int&>(strd), const_cast<int&>(cap), offset, l1, l2);\
1113 #define COM_APPEND_ARRAY_SCALAR( func, FUNC) \
1114 extern "C" void COM_F_FUNC2( func, FUNC) \
1115 ( const char *waname, const int &pane_id, \
1116 const void *val, const int &v_strd, const int &v_size, int wa_len) \
1119 COM_get_roccom()->append_array( string(waname,wa_len), pane_id, \
1120 val, v_strd, v_size); \
1128 template <
int dim, COM_Type type>
1131 const void *val,
int v_strd,
int v_size,
1134 void *v_ptr=com_get_address_f<dim, type>(
const_cast<void*
>(val), l);
1136 COM_get_roccom()->append_array( waname, pane_id, v_ptr, v_strd, v_size);
1139 template <
int dim, COM_Type type>
1142 const void *val,
int v_strd,
int v_size,
1144 int f90ptr_treat = get_f90ptr_treat();
1147 int wa_len=l2;
CHKLEN(wa_len);
1148 com_append_array_helper<dim,type>( string(waname, wa_len), pane_id,
1149 val, v_strd, v_size, l1);
1152 int wa_len=l1;
CHKLEN(wa_len);
1154 com_append_array_helper<dim,type>( string(waname, wa_len), pane_id,
1155 val, v_strd, v_size, l2);
1157 com_append_array_helper<dim,type>( string(waname, wa_len), pane_id,
1158 val, v_strd, v_size);
1162 #define COM_APPEND_ARRAY( func, FUNC, dim, type) \
1163 extern "C" void COM_F_FUNC2( func, FUNC) \
1164 ( const char *waname, const int &pane_id, \
1165 const void *val, int &v_strd, int &v_size, int l1, int l2) \
1167 com_append_array_f<dim,type>( waname, pane_id, \
1168 val, v_strd, v_size, l1, l2); \
1181 #define COM_GET_BOUNDS( func, FUNC) \
1182 extern "C" void COM_F_FUNC2( func, FUNC) \
1183 ( const char *wa_str, const int &pane_id, \
1184 void *lbound, void *ubound, int len) \
1187 COM_get_roccom()->get_bounds( string(wa_str,len), pane_id, lbound, ubound); \
1195 (
const char *wa_str,
const int &pane_id,
int len)
1198 return COM_get_roccom()->check_bounds(
string(wa_str,len), pane_id);
1202 (
const char *wname,
const char *attr,
int w_len,
int a_len)
1206 use_attribute(
string(wname, w_len),
string(attr, a_len));
1210 (
const char *wname,
const char *attr,
int w_len,
int a_len)
1214 clone_attribute(
string(wname, w_len),
string(attr, a_len));
1218 (
const char *wname,
const char *attr,
int w_len,
int a_len)
1222 copy_attribute(
string(wname, w_len),
string(attr, a_len));
1226 (
const int &trg_hdl,
const int &src_hdl)
1232 (
const char *wname,
const char *attr,
const int &with_ghost,
1233 int w_len,
int a_len)
1237 use_attribute(
string(wname, w_len),
string(attr, a_len), with_ghost);
1240 extern "C" void COM_F_FUNC2(com_clone_attr_ghost, COM_CLONE_ATTR_GHOST)
1241 (
const char *wname,
const char *attr,
const int &with_ghost,
1242 int w_len,
int a_len)
1246 clone_attribute(
string(wname, w_len),
string(attr, a_len), with_ghost);
1250 (
const char *wname,
const char *attr,
const int &with_ghost,
1251 int w_len,
int a_len)
1255 copy_attribute(
string(wname, w_len),
string(attr, a_len), with_ghost);
1258 extern "C" void COM_F_FUNC2(com_copy_attr_ghost_hdls,COM_COPY_ATTR_GHOST_HDLS)
1259 (
const int &trg_hdl,
const int &src_hdl,
const int &with_ghost )
1265 (
const char *wname,
const char *attr,
const int &with_ghost,
1266 const char *ptnname,
const int &val,
1267 int w_len,
int a_len,
int p_len)
1271 use_attribute(
string(wname, w_len),
string(attr, a_len),
1272 with_ghost,
string(ptnname, p_len).c_str(), val);
1276 (
const char *wname,
const char *attr,
const int &with_ghost,
1277 const char *ptnname,
const int &val,
1278 int w_len,
int a_len,
int p_len)
1282 clone_attribute(
string(wname, w_len),
string(attr, a_len),
1283 with_ghost,
string(ptnname, p_len).c_str(), val);
1287 (
const char *wname,
const char *attr,
const int &with_ghost,
1288 const char *ptnname,
const int &val,
1289 int w_len,
int a_len,
int p_len)
1293 copy_attribute(
string(wname, w_len),
string(attr, a_len),
1294 with_ghost,
string(ptnname, p_len).c_str(), val);
1298 COM_COPY_ATTR_GHOST_SUB_HDLS)
1299 (
const int &trg_hdl,
const int &src_hdl,
const int &with_ghost,
1300 const int &pnt_hdl,
const int &val)
1307 (
const char *wa_str,
int wa_len)
1314 (
const char *wa_str,
const int &pid,
int wa_len)
1321 (
const char *wa_str,
const int &pane_id,
int *size,
int len)
1322 {
COM_get_roccom()->get_size( std::string(wa_str,len), pane_id, size); }
1325 (
const char *wa_str,
const int &pane_id,
int *size,
int *ng,
int len)
1326 {
COM_get_roccom()->get_size( std::string(wa_str,len), pane_id, size, ng); }
1329 (
const char *wa_str,
char *loc,
int *type,
int *size,
1330 char *u_str,
int wa_len,
int l_len,
int u_len)
1334 COM_get_roccom()->get_attribute(
string( wa_str,wa_len), loc, type,
1337 int len=unit.size(),
n=
std::min(len,
int(u_len));
1339 int u_len_int = u_len;
1341 ( unit.c_str(), &
n, u_str, &u_len_int,
n, u_len);
1345 (
const char *wf_str,
Func_ptr func,
const char *intents,
1346 const COM_Type *types,
int wf_len,
int i_len)
1350 string(intents,i_len), types,
true);
1353 extern "C" void COM_F_FUNC2(com_set_member_function, COM_SET_MEMBER_FUNCTION)
1354 (
const char *wf_str,
Func_ptr func,
const char *wa_str,
const char *intents,
1355 const COM_Type *types,
int wf_len,
int a_len,
int i_len)
1358 COM_get_roccom()->set_member_function(
string(wf_str,wf_len), func,
1359 string(wa_str,a_len),
1360 string(intents,i_len),
1364 extern "C" void COM_F_FUNC2(com_get_communicator,COM_GET_COMMUNICATOR)
1365 (
const char *wname,
int *comm,
int w_len)
1369 get_communicator(
string(wname, w_len)));
1372 extern "C" void COM_F_FUNC2(com_get_pane_ids_on_rank,COM_GET_PANE_IDS_ON_RANK)
1373 (
const char *wname,
int *npanes,
void *panes_ids,
const int &
rank,
1376 int f90ptr_treat = get_f90ptr_treat();
1379 std::vector<int> vec;
1382 *npanes = vec.size();
1385 int tonull = *npanes == 0;
1386 typedef void(*Func)(
void*,
int*,
void*,
void*,int);
1388 ( panes_ids, &tonull, pids, npanes, l1);
1391 int tonull = *npanes == 0;
1394 typedef void(*Func)(
void*,
int*,
void*,
void*,int);
1396 ( panes_ids, &tonull, pids, npanes, l2);
1399 typedef void(*Func)(
void*,
int*,
void*,
void*);
1401 ( panes_ids, &tonull, pids, npanes);
1407 (
const char *wname,
int *npanes,
void *panes_ids,
1410 COM_F_FUNC2(com_get_pane_ids_on_rank,COM_GET_PANE_IDS_ON_RANK)
1411 ( wname, npanes, panes_ids, -2, l1, l2);
1415 (
const char *wname,
int *npanes,
int w_len)
1418 std::vector<int> vec;
1420 *npanes = vec.size();
1423 static void mapcharptr(
char *str,
void *names,
int f90ptr_treat,
1426 int len = std::strlen( str), tonull=(len==0);
1427 typedef void(*Func)(
void*,
int*,
void*,
void*, int);
1429 ( names, &tonull, str, &len, l1);
1432 int len = std::strlen( str), tonull=(len==0);
1435 typedef void(*Func)(
void*,
int*,
void*,
void*, int);
1437 ( names, &tonull, str, &len, l2);
1440 typedef void(*Func)(
void*,
int*,
void*,
void*);
1442 ( names, &tonull, str, &len);
1448 (
const char *wname,
int *na,
void *names,
1451 int f90ptr_treat = get_f90ptr_treat();
1456 COM_get_roccom()->get_attributes(
string(wname, w_len), na, str, &atts);
1458 mapcharptr( atts, names, f90ptr_treat, l1, l2);
1461 extern "C" void COM_F_FUNC2(com_get_connectivities,COM_GET_CONNECTIVITIES)
1462 (
const char *wname,
const int &pane_id,
int *nc,
void *names,
1465 int f90ptr_treat = get_f90ptr_treat();
1471 COM_get_roccom()->get_connectivities(
string(wname, w_len), pane_id,
1474 mapcharptr( conns, names, f90ptr_treat, l1, l2);
1478 (
const char *waname,
const int &pane_id,
void *parent,
1481 int f90ptr_treat = get_f90ptr_treat();
1486 COM_get_roccom()->get_parent(
string(waname, w_len), pane_id, str, &name);
1488 mapcharptr( name, parent, f90ptr_treat, l1, l2);
1492 (
const char *waname,
const int &pane_id,
int len)
1495 return COM_get_roccom()->get_status( std::string(waname,len), pane_id);
1498 extern "C" void COM_F_FUNC2(com_free_buffer_char,COM_FREE_BUFFER_CHAR)
1499 (
void *buf,
int l2)
1502 typedef void(*Func)(
void*,
void**);
1504 ( buf, &(
void*&)ptr);
1509 int one=1, zero = 0;
1510 typedef void(*Func)(
void*,
int*,
void*,
void*);
1513 ( buf, &one, ptr, &zero);
1518 (
void *buf,
int l2)
1521 typedef void(*Func)(
void*,
void**);
1523 ( buf, &(
void*&)ptr);
1528 int one=1, zero = 0;
1529 typedef void(*Func)(
void*,
int*,
void*,
void*);
1532 ( buf, &one, ptr, &zero);
1536 extern "C" int COM_F_FUNC2( com_get_window_handle, COM_GET_WINDOW_HANDLE)
1537 (
const char *wname,
int len)
1540 return COM_get_roccom()->get_window_handle( std::string(wname,len));
1543 extern "C" int COM_F_FUNC2(com_get_attribute_handle, COM_GET_ATTRIBUTE_HANDLE)
1544 (
const char *waname,
int len)
1547 return COM_get_roccom()->get_attribute_handle( std::string(waname,len));
1550 extern "C" int COM_F_FUNC2( com_get_attribute_handle_const, COM_GET_ATTRIBUTE_HANDLE_CONST)
1551 (
const char *waname,
int len) {
1554 return COM_get_roccom()->get_attribute_handle_const( std::string(waname,len));
1557 extern "C" int COM_F_FUNC2( com_get_function_handle, COM_GET_FUNCTION_HANDLE)
1558 (
const char *wfname,
int len)
1561 return COM_get_roccom()->get_function_handle( std::string(wfname,len));
1565 (
const int &wf,
const int &argc,
void *a1,
void *a2,
void *a3,
void *a4,
1566 void *a5,
void *a6,
void *a7,
void *a8,
void *a9,
1567 void *aa,
void *ab,
void *ac,
void *ad,
void *ae) {
1568 void *args[] = {a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae};
1570 for (
int i=0;
i<argc; ++
i)
1571 lens[
i] = (
unsigned int)((
char *)(args[argc+
i])-(
char *)(0));
1576 (
const int &wf,
const int &argc,
void *a1,
void *a2,
void *a3,
void *a4,
1577 void *a5,
void *a6,
void *a7,
void *a8,
void *a9,
1578 void *aa,
void *ab,
void *ac,
void *ad,
void *ae,
void *af) {
1579 void *args[] = {a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae};
1582 for (
int i=0;
i<argc-1; ++
i)
1583 lens[
i] = (
unsigned int)((
char *)(args[argc+
i])-(
char *)(0));
1589 (
const int &reqid,
int *status)
1593 if ( *status ==
true)
1606 (
const char *waname,
void *ptr,
Func_ptr func,
1612 int len=l2;
CHKLEN( len);
1613 COM_get_roccom()->set_f90pointer( std::string(waname,len), ptr, func, l1);
1616 int len=l1;
CHKLEN( len);
1617 COM_get_roccom()->set_f90pointer( std::string(waname,len), ptr, func, l2);
1622 (
const char *waname,
void *ptr,
Func_ptr func,
1625 int f90ptr_treat = get_f90ptr_treat();
1630 int len=l2;
CHKLEN( len);
1631 COM_get_roccom()->get_f90pointer( std::string(waname,len), ptr, func, l1);
1634 int len=l1;
CHKLEN( len);
1635 COM_get_roccom()->get_f90pointer( std::string(waname,len), ptr, func, l2);
1640 (
const char *waname,
void *ptr,
Func_ptr func,
1643 COM_F_FUNC2( com_set_pointer, COM_SET_POINTER)( waname, ptr, func, l1, l2);
1647 (
const char *waname,
void *ptr,
Func_ptr func,
1650 COM_F_FUNC2( com_get_pointer, COM_GET_POINTER)( waname, ptr, func, l1, l2);
1658 extern "C" void COM_F_FUNC2(com_set_verbose,COM_SET_VERBOSE)(
const int &
i)
1661 extern "C" void COM_F_FUNC2(com_set_debug,COM_SET_DEBUG)(
const bool &debug)
1664 extern "C" void COM_F_FUNC2( com_set_profiling_barrier, COM_SET_PROFILING_BARRIER)
1665 (
const int &hdl,
const int &comm)
1671 extern "C" void COM_F_FUNC2(com_set_profiling, COM_SET_PROFILING) (
const int &
i)
1677 (
const char *fname,
const char *header,
1682 std::string(header,hlen));
1692 COM_BEGIN_NAME_SPACE
1701 int get_sizeof_f90pointer() {
1706 if (w.
a[0] != 333331) {
1710 for (
int i = 0;
i < 512;
i++) {
1711 if (w.
a[
i] == 333332) {
1712 return (
i-1)*
sizeof(int);
1721 extern "C" int COM_F_FUNC2( com_get_sizeof_f90pointer, COM_GET_SIZEOF_F90POINTER) ()
1722 {
return get_sizeof_f90pointer(); }
1727 (
const char *str1,
void *ptr1,
const char *str2,
void *ptr2,
1728 int len1,
int len2,
int len3,
int len4);
1730 extern "C" int COM_F_FUNC2( com_chkptr_c, COM_CHKPTR_C)
1731 (
const int &stage,
const char *str1,
void *ptr1,
1732 const char *str2,
void *ptr2,
1733 int len1,
int len2,
int len3,
int len4) {
1735 static int insert_or_append;
1736 static int ptrinfo1, ptrinfo2;
1741 ptrinfo1 = ptrinfo2 = 0;
1746 if ( (
int)len3 == 17 && (int)len4 == 33)
1750 "Incorrect handling of Fortran 90 pointers");
1753 ptrinfo1 =
len1 - ((
char*)ptr1-(
char*)NULL);
1754 ptrinfo2 =
len2 - ((
char*)ptr2-(
char*)NULL);
1757 ptrinfo1 = len3 - ((
char*)ptr1-(
char*)NULL);
1758 ptrinfo2 = len4 - ((
char*)ptr2-(
char*)NULL);
1762 ( str1, ptr1, str2, ptr2,
len1,
len2, len3, len4);
1769 ptrinfo2 == len1-((
char*)ptr1-(
char*)NULL),
1770 "Incorrect handling of Fortran 90 pointers");
1772 std::cerr <<
"Roccom: Setting f90 pointer treatment to INSERT" << std::endl;
1775 if ( ptrinfo1 != 0 && ptrinfo1 == len4-((
char*)ptr2-(
char*)NULL) &&
1776 ptrinfo2 != 0 && ptrinfo2 == len3-((
char*)ptr1-(
char*)NULL)) {
1778 std::cerr <<
"Roccom: Setting f90 pointer treatment to APPEND. \n";
1782 std::cerr <<
"Roccom: Setting f90 pointer treatment to NONE.\n";
1784 if ( verb && (verb|1)==0)
1785 std::cerr <<
"\tAt pass 1, " <<
"ptrinfo1 is " << ptrinfo1
1786 <<
" and ptrinfo2 is " << ptrinfo2
1787 <<
" and\n\tat pass 2, ptrinfo1 is "
1788 << len3-((
char*)ptr1-(
char*)NULL)
1789 <<
" and ptrinfo2 is "
1790 << len4-((
char*)ptr2-(
char*)NULL) << std::endl;
1797 return insert_or_append;
void const int char const int long int long int len2
#define COM_OBTAIN_ARRAY_STRD(func, FUNC, dim, type, mode)
static void abort(int ierr)
int COM_Type
Indices for derived data types.
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
#define COM_SET_ARRAY_CONST_STRD_PTR(func, FUNC, dim, type)
void com_obtain_array_f(const char *waname, int pane_id, void *addr, int &strd, int &cap, int offset, int l1, int l2)
#define COM_SET_ARRAY_CONST_PTR(func, FUNC, dim, type)
#define COM_SET_ARRAY_STRD_SCALAR(func, FUNC)
subroutine com_getptr_int0d(p, x)
#define COM_assertion_msg(EX, msg)
subroutine com_getptr_dbl2d(p, x)
#define COM_SET_ARRAY_SCALAR(func, FUNC)
subroutine com_settypeinfo(wrapper)
subroutine com_getptr_flt3d(p, x)
This file contains the prototypes for Roccom API.
T COMMPI_Comm_f2c(int c, T)
void com_obtain_array_helper(const std::string &waname, int pane_id, void *addr, int &strd, int &cap, int offset, int l=0)
subroutine com_getptr_int1d(p, x)
static void init(int *argc, char ***argv)
subroutine com_getptr_chr1d(p, x)
real *8 function offset(vNorm, x2, y2, z2)
#define COM_COPY_ARRAY_OFF(func, FUNC, dim, type)
#define COM_SET_ARRAY_CONST_DYN_PTR(func, FUNC, dim, type)
subroutine com_mapptr_flt2d(p, tonull, x, n1, n2)
subroutine com_mapptr_int0d(p, tonull, x)
#define COM_F_FUNC2(lowcase, uppercase)
int a[512]
Some arbitrary big array.
subroutine com_getptr_dbl1d(p, x)
#define COM_APPEND_ARRAY(func, FUNC, dim, type)
subroutine com_getptr_dbl0d(p, x)
subroutine com_getptr_int3d(p, x)
subroutine com_set_false(i)
subroutine com_copy_string(str_frm, len_frm, str_to, len_to)
int _f90ptr_treat
Treatement of F90 pointers.
subroutine com_mapptr_flt0d(p, tonull, x)
#define COM_SET_ARRAY_CONST_DYN_SCALAR(func, FUNC)
subroutine com_mapptr_int2d(p, tonull, x, n1, n2)
subroutine com_getptr_flt1d(p, x)
void com_set_array_const_helper(const std::string &waname, int pane_id, void *addr, int strd, int cap, int l=0)
#define COM_SET_ARRAY_PTR(func, FUNC, dim, type)
void com_append_array_f(const char *waname, int pane_id, const void *val, int v_strd, int v_size, int l1, int l2)
subroutine com_mapptr_chr1d(p, tonull, x, n)
void(* Func_ptr)()
Pointer of functions.
static bool initialized()
Checks whether Roccom has been initialized.
void const int char const int long int len1
void com_set_array_helper(const std::string &waname, int pane_id, void *addr, int strd, int cap, int l=0)
#define COM_SET_ARRAY_CONST_SCALAR(func, FUNC)
void com_set_address_f(Roccom_base::Pointer_descriptor &ptr, void *addr, int l=0)
#define COM_OBTAIN_ARRAY(func, FUNC, dim, type, mode)
This file contains a set of routines for error assertion.
subroutine com_mapptr_dbl0d(p, tonull, x)
subroutine com_set_true(i)
#define COM_APPEND_ARRAY_SCALAR(func, FUNC)
#define COM_SET_ARRAY_DYN_PTR(func, FUNC, dim, type)
int system(const char *const command, const char *const module_name=0)
subroutine com_getptr_flt2d(p, x)
void com_append_array_helper(const std::string &waname, int pane_id, const void *val, int v_strd, int v_size, int l=0)
subroutine com_getptr_int2d(p, x)
subroutine com_getptr_dbl3d(p, x)
#define COM_SET_ARRAY_CONST_STRD_SCALAR(func, FUNC)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine com_mapptr_flt1d(p, tonull, x, n)
#define COM_SET_ARRAY_STRD_PTR(func, FUNC, dim, type)
static MPI_Comm get_default_communicator()
Get the default communicator of Roccom.
This file indirectly includes the following files: iostream, map, string, vector, and roccom_basic...
#define COM_SET_BOUNDS(func, FUNC)
void com_set_array_f(const char *waname, int pane_id, void *addr, int strd, int cap, int l1, int l2)
subroutine com_chkptr_end(str1, ptr1, str2, ptr2)
subroutine com_mapptr_int1d(p, tonull, x, n)
#define COM_OBTAIN_ARRAY_DYN(func, FUNC, dim, type, mode)
subroutine com_mapptr_dbl2d(p, tonull, x, n1, n2)
Some big array to help determining the size of a Fortran 90 pointer.
void * com_get_address_f(void *addr, int l=0)
subroutine com_getptr_flt0d(p, x)
static void set_default_communicator(MPI_Comm comm)
Set the default communicator of Roccom.
COM_END_NAME_SPACE COM::Roccom_base * COM_get_roccom()
subroutine com_mapptr_dbl1d(p, tonull, x, n)
#define COM_GET_BOUNDS(func, FUNC)
void com_set_array_const_f(const char *waname, int pane_id, void *addr, int strd, int cap, int l1, int l2)
subroutine com_chkptr_begin
This file contains the prototypes of the Fortran 90 subroutines for mapping C routines into Fortran p...
#define COM_SET_ARRAY_DYN_SCALAR(func, FUNC)
static void mapcharptr(char *str, void *names, int f90ptr_treat, int l1, int l2)