94 int main(
int argc,
char *argv[]) {
95 int choice1, choice2, choice3=0, choice4=0;
100 std::cout <<
"Initializing Roccom" << std::endl;
103 std::cout <<
"Creating window \"twin\"" << std::endl;
135 for(
int pid = 0; pid <
NPANE; pid++) {
172 std::string a1(
"twin.x"), a2(
"twin.y"), a3(
"twin.z"), ap(
"twin.p"),
173 aa(
"twin.a"), am(
"twin.m");
176 cout <<
"\nChoose type of data:\n\n"
178 <<
"\t2) Elemental\n\n"
179 <<
"Enter your choice: ";
183 a1.append(
"n"); a2.append(
"n"); a3.append(
"n");
184 ap.append(
"n"); am.append(
"n");
186 else if (choice1 == 2) {
187 a1.append(
"e"); a2.append(
"e"); a3.append(
"e");
188 ap.append(
"e"); am.append(
"e");
191 cout <<
"\nChoose organization of data:\n\n"
192 <<
"\t1) Contiguous\n"
194 <<
"\t3) Contiguous -> Strided\n"
195 <<
"\t4) Strided -> Contiguous\n\n"
196 <<
"Enter your choice: ";
200 { a1.append(
"s"); a2.append(
"s"); a3.append(
"s"); }
201 else if ( choice2 == 3)
203 else if ( choice2 == 4)
204 { a1.append(
"s"); a2.append(
"s"); }
207 cout <<
"\nChoose data shape of second parameter:\n\n"
208 <<
"\t1) Vector / Matrix\n"
209 <<
"\t2) 1D Scalar (Windowed)\n"
210 <<
"\t3) 1D Scalar (Panel)\n"
211 <<
"\t4) 3D Scalar (Windowed)\n"
212 <<
"\t5) 3D Scalar (Panel)\n"
213 <<
"\t6) Scalar (Pointer)\n"
214 <<
"\t7) 1D Scalar (Windowed with multipliers)\n\n"
215 <<
"Enter your choice: ";
218 if ( choice3 == 2) aa.append(
"sw");
219 else if ( choice3 == 3) aa.append(
"sp");
220 else if ( choice3 == 4) aa.append(
"w");
221 else if ( choice3 == 5) aa.append(
"p");
222 else if ( choice3 == 7) aa.append(
"w");
224 cout <<
"\nChoose which operation:\n\n"
226 <<
"\t2) Subtraction\n"
227 <<
"\t3) Multiplication\n"
234 <<
"Enter your choice: ";
239 std::string op(
"TEST.");
242 case 1: op.append(
"add");
break;
243 case 2: op.append(
"sub");
break;
244 case 3: op.append(
"mul");
break;
245 case 4: op.append(
"div");
break;
246 case 5: op.append(
"swap");
break;
247 case 6: op.append(
"copy");
break;
248 case 7: op.append(
"dot");
break;
249 case 8: op.append(
"nrm2");
break;
250 default: op.append(
"axpy");
252 if ( choice3 == 6) op.append(
"_scalar");
255 if ( choice1 == 1 && choice2 == 1)
257 else if ( choice1 == 1 && choice2 == 2)
259 else if ( choice1 == 1)
261 else if ( choice1 == 2 && choice2 == 1)
263 else if ( choice1 == 2 && choice2 == 2)
265 else if ( choice1 == 2)
272 std::cout <<
"Performing operation " << op << std::endl;
290 if ( choice3 == 2 || choice3 == 3 || choice3 == 4 || choice3 == 5) {
294 else if ( choice3 == 6) {
302 if ( choice3 == 2 || choice3 == 3 || choice3 == 4 || choice3 == 5) {
305 else if ( choice3 == 6)
312 if ( choice3 == 2 || choice3 == 3 || choice3 == 4 || choice3 == 5)
314 else if ( choice3 == 7)
317 { std::cout <<
"Unavailable option" << std::endl; exit(-1); }
320 if ( choice3 == 2 || choice3 == 3 || choice3 == 4 || choice3 == 5)
322 else if ( choice3 == 7)
328 if ( choice3 == 2 || choice3 == 3 || choice3 == 4 || choice3 == 5)
330 else if ( choice3 == 6)
332 else if ( choice3 == 1)
335 { std::cout <<
"Unavailable option" << std::endl; exit(-1); }
340 if ( choice1 == 1 && choice2 == 1)
342 else if ( choice1 == 1 && choice2 == 2)
344 else if ( choice1 == 1)
346 else if ( choice1 == 2 && choice2 == 1)
348 else if ( choice1 == 2 && choice2 == 2)
350 else if ( choice1 == 2)
357 std::cout <<
"\nDeleting windows" << std::endl;
361 std::cout <<
"Finalizing Roccom" << std::endl;
369 for(i = 0; i <
NPANE; i++) {
406 for(j = 0; j < (
NROW-1)*(NCOL-1); j++) {
443 std::cout <<
"\n" << title <<
"\nx =\n";
444 for(i = 0; i <
NPANE; i++) {
446 for(k = 0; k < 3; k++)
447 std::cout <<
testxn[i][j][k] <<
" ";
453 std::cout <<
"\ny =\n";
454 for(i = 0; i <
NPANE; i++) {
456 for(k = 0; k < 3; k++)
457 std::cout <<
testyn[i][j][k] <<
" ";
463 std::cout <<
"\nz =\n";
464 for(i = 0; i <
NPANE; i++) {
466 for(k = 0; k < 3; k++)
467 std::cout <<
testzn[i][j][k] <<
" ";
473 std::cout <<
"\n\np =\n";
474 for(i = 0; i <
NPANE; i++) {
480 std::cout <<
"\n\naw =\n";
481 for(i = 0; i < 3; i++)
482 std::cout <<
scalWin[i] <<
" ";
484 std::cout <<
"\n\nap =\n";
485 for(i = 0; i <
NPANE; i++) {
486 for(j = 0; j < 3; j++)
491 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
493 std::cout <<
"\nasp =\n";
494 for(i = 0; i <
NPANE; i++)
497 std::cout <<
"\n\ns = " <<
s <<
"\n";
504 std::cout <<
"\n" << title <<
"\nxs =\n";
505 for(i = 0; i <
NPANE; i++) {
506 for(j = 0; j < 3; j++) {
508 std::cout <<
testxns[i][j][k] <<
" ";
514 std::cout <<
"\nys =\n";
515 for(i = 0; i <
NPANE; i++) {
516 for(j = 0; j < 3; j++) {
518 std::cout <<
testyns[i][j][k] <<
" ";
524 std::cout <<
"\nzs =\n";
525 for(i = 0; i <
NPANE; i++) {
526 for(j = 0; j < 3; j++) {
528 std::cout <<
testzns[i][j][k] <<
" ";
534 std::cout <<
"\n\np =\n";
535 for(i = 0; i <
NPANE; i++) {
541 std::cout <<
"\n\naw =\n";
542 for(i = 0; i < 3; i++)
543 std::cout <<
scalWin[i] <<
" ";
545 std::cout <<
"\n\nap =\n";
546 for(i = 0; i <
NPANE; i++) {
547 for(j = 0; j < 3; j++)
552 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
554 std::cout <<
"\nasp =\n";
555 for(i = 0; i <
NPANE; i++)
558 std::cout <<
"\n\ns = " <<
s <<
"\n";
565 std::cout <<
"\n" << title <<
"\nx =\n";
566 for(i = 0; i <
NPANE; i++) {
568 for(k = 0; k < 3; k++)
569 std::cout <<
testxn[i][j][k] <<
" ";
575 std::cout <<
"\ny =\n";
576 for(i = 0; i <
NPANE; i++) {
578 for(k = 0; k < 3; k++)
579 std::cout <<
testyn[i][j][k] <<
" ";
585 std::cout <<
"\nz =\n";
586 for(i = 0; i <
NPANE; i++) {
588 for(k = 0; k < 3; k++)
589 std::cout <<
testzn[i][j][k] <<
" ";
595 std::cout <<
"\n" <<
"\nxs =\n";
596 for(i = 0; i <
NPANE; i++) {
597 for(j = 0; j < 3; j++) {
599 std::cout <<
testxns[i][j][k] <<
" ";
605 std::cout <<
"\nys =\n";
606 for(i = 0; i <
NPANE; i++) {
607 for(j = 0; j < 3; j++) {
609 std::cout <<
testyns[i][j][k] <<
" ";
615 std::cout <<
"\nzs =\n";
616 for(i = 0; i <
NPANE; i++) {
617 for(j = 0; j < 3; j++) {
619 std::cout <<
testzns[i][j][k] <<
" ";
625 std::cout <<
"\n\np =\n";
626 for(i = 0; i <
NPANE; i++) {
632 std::cout <<
"\n\naw =\n";
633 for(i = 0; i < 3; i++)
634 std::cout <<
scalWin[i] <<
" ";
636 std::cout <<
"\n\nap =\n";
637 for(i = 0; i <
NPANE; i++) {
638 for(j = 0; j < 3; j++)
643 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
645 std::cout <<
"\nasp =\n";
646 for(i = 0; i <
NPANE; i++)
649 std::cout <<
"\n\ns = " <<
s <<
"\n";
656 std::cout <<
"\n" << title <<
"\nx =\n";
657 for(i = 0; i <
NPANE; i++) {
658 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
659 for(k = 0; k < 3; k++)
660 std::cout <<
testxe[i][j][k] <<
" ";
666 std::cout <<
"\ny =\n";
667 for(i = 0; i <
NPANE; i++) {
668 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
669 for(k = 0; k < 3; k++)
670 std::cout <<
testye[i][j][k] <<
" ";
676 std::cout <<
"\nz =\n";
677 for(i = 0; i <
NPANE; i++) {
678 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
679 for(k = 0; k < 3; k++)
680 std::cout <<
testze[i][j][k] <<
" ";
686 std::cout <<
"\n\np =\n";
687 for(i = 0; i <
NPANE; i++) {
688 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++)
693 std::cout <<
"\n\naw =\n";
694 for(i = 0; i < 3; i++)
695 std::cout <<
scalWin[i] <<
" ";
697 std::cout <<
"\n\nap =\n";
698 for(i = 0; i <
NPANE; i++) {
699 for(j = 0; j < 3; j++)
704 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
706 std::cout <<
"\nasp =\n";
707 for(i = 0; i <
NPANE; i++)
710 std::cout <<
"\n\ns = " <<
s <<
"\n";
717 std::cout <<
"\n" << title <<
"\nxs =\n";
718 for(i = 0; i <
NPANE; i++) {
719 for(j = 0; j < 3; j++) {
720 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
721 std::cout <<
testxes[i][j][k] <<
" ";
727 std::cout <<
"\nys =\n";
728 for(i = 0; i <
NPANE; i++) {
729 for(j = 0; j < 3; j++) {
730 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
731 std::cout <<
testyes[i][j][k] <<
" ";
737 std::cout <<
"\nzs =\n";
738 for(i = 0; i <
NPANE; i++) {
739 for(j = 0; j < 3; j++) {
740 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
741 std::cout <<
testzes[i][j][k] <<
" ";
747 std::cout <<
"\n\np =\n";
748 for(i = 0; i <
NPANE; i++) {
749 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++)
754 std::cout <<
"\n\naw =\n";
755 for(i = 0; i < 3; i++)
756 std::cout <<
scalWin[i] <<
" ";
758 std::cout <<
"\n\nap =\n";
759 for(i = 0; i <
NPANE; i++) {
760 for(j = 0; j < 3; j++)
765 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
767 std::cout <<
"\nasp =\n";
768 for(i = 0; i <
NPANE; i++)
771 std::cout <<
"\n\ns = " <<
s <<
"\n";
778 std::cout <<
"\n" << title <<
"\nx =\n";
779 for(i = 0; i <
NPANE; i++) {
780 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
781 for(k = 0; k < 3; k++)
782 std::cout <<
testxe[i][j][k] <<
" ";
788 std::cout <<
"\ny =\n";
789 for(i = 0; i <
NPANE; i++) {
790 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
791 for(k = 0; k < 3; k++)
792 std::cout <<
testye[i][j][k] <<
" ";
798 std::cout <<
"\nz =\n";
799 for(i = 0; i <
NPANE; i++) {
800 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++) {
801 for(k = 0; k < 3; k++)
802 std::cout <<
testze[i][j][k] <<
" ";
808 std::cout <<
"\n" << title <<
"\nxs =\n";
809 for(i = 0; i <
NPANE; i++) {
810 for(j = 0; j < 3; j++) {
811 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
812 std::cout <<
testxes[i][j][k] <<
" ";
818 std::cout <<
"\nys =\n";
819 for(i = 0; i <
NPANE; i++) {
820 for(j = 0; j < 3; j++) {
821 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
822 std::cout <<
testyes[i][j][k] <<
" ";
828 std::cout <<
"\nzs =\n";
829 for(i = 0; i <
NPANE; i++) {
830 for(j = 0; j < 3; j++) {
831 for(k = 0; k < (
NROW-1)*(
NCOL-1); k++)
832 std::cout <<
testzes[i][j][k] <<
" ";
838 std::cout <<
"\n\np =\n";
839 for(i = 0; i <
NPANE; i++) {
840 for(j = 0; j < (
NROW-1)*(
NCOL-1); j++)
845 std::cout <<
"\n\naw =\n";
846 for(i = 0; i < 3; i++)
847 std::cout <<
scalWin[i] <<
" ";
849 std::cout <<
"\n\nap =\n";
850 for(i = 0; i <
NPANE; i++) {
851 for(j = 0; j < 3; j++)
856 std::cout <<
"\n\nasw = " <<
testscal <<
"\n";
858 std::cout <<
"\nasp =\n";
859 for(i = 0; i <
NPANE; i++)
862 std::cout <<
"\n\ns = " <<
s <<
"\n";
void printBothNodalData(const char *title)
int nmults[NPANE][NROW *NCOL]
double testzns[NPANE][3][NROW *NCOL]
int emults[NPANE][(NROW-1)*(NCOL-1)]
void COM_delete_window(const char *wname)
double testxns[NPANE][3][NROW *NCOL]
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 printBothElementalData(const char *title)
int coord[NPANE][NROW *NCOL][3]
int COM_get_attribute_handle(const char *waname)
double testyns[NPANE][3][NROW *NCOL]
void printStridedElementalData(const char *title)
void printElementalData(const char *title)
void Rocblas_unload_module(const char *name)
double testxn[NPANE][NROW *NCOL][3]
double scalPane[NPANE][3]
void COM_window_init_done(const char *w_str, int pane_changed=true)
double testzn[NPANE][NROW *NCOL][3]
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_call_function(const int wf, int argc,...)
Definition for Rocblas API.
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 main(int argc, char *argv[])
double testyes[NPANE][3][(NROW-1)*(NCOL-1)]
double paneTeste[NPANE][(NROW-1)*(NCOL-1)]
double testze[NPANE][(NROW-1)*(NCOL-1)][3]
double testzes[NPANE][3][(NROW-1)*(NCOL-1)]
double testyn[NPANE][NROW *NCOL][3]
void COM_init(int *argc, char ***argv)
double testye[NPANE][(NROW-1)*(NCOL-1)][3]
void printNodalData(const char *title)
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
double testxes[NPANE][3][(NROW-1)*(NCOL-1)]
void printStridedNodalData(const char *title)
double testxe[NPANE][(NROW-1)*(NCOL-1)][3]
void Rocblas_load_module(const char *name)
Calls Rocblas initialization function.
int COM_get_function_handle(const char *wfname)
double paneTestn[NPANE][NROW *NCOL]