82 #ifndef END_POINT_MEMORY_H
83 #define END_POINT_MEMORY_H
92 #define DASH_READ_FLAG 0
93 #define DASH_WRITE_FLAG 1
95 #define DASH_NONVOLATILE_CODE 0
96 #define DASH_VOLATILE_CODE 1
97 #define DASH_ENABLE_LOCAL_MIRROR_CODE 2
98 #define DASH_MERGE_MIRRORS_CODE 3
100 #define MEMORY_BACKUP 0
101 #define MEMORY_RESTORE 1
102 #define MEMORY_CLONE 2
103 #define MEMORY_MERGE 3
104 #define MEMORY_SYNC_OVERLAP 4
106 #ifdef HAS_DASH_ENDPOINT
114 using dash::io::hdf5::hdf5_options;
115 using dash::io::hdf5::StoreHDF;
123 void *local_mirror_buffer;
124 bool local_mirror_flag =
false;
125 unsigned long long local_mirror_size;
191 int Read(std::vector<unsigned long long> start, std::vector<unsigned long long> end,
void *data)
override;
201 int Write(std::vector<unsigned long long> start, std::vector<unsigned long long> end,
void *data)
override;
208 int Close()
override;
229 int Control(
int opt_code, std::vector<std::string> ¶meter_v)
override;
245 int Volatile(std::string parameter);
262 #define CreateDashMatrix(dash_matrix_p_p, rank_const_p, element_type_code_p, array_size) \
264 dash::SizeSpec<rank_const_p, unsigned long> dash_size_spec = dash::SizeSpec<rank_const_p, unsigned long>(); \
265 size_t num_units = dash::Team::All().size(); \
266 dash::TeamSpec<rank_const_p, unsigned long> teamspec; \
267 teamspec.balance_extents(); \
268 dash::DistributionSpec<rank_const_p> distspec; \
269 for (int i = 0; i < rank_const_p; i++) \
271 dash_size_spec.resize(i, array_size[i]); \
273 switch (element_type_code_p) \
277 dash_matrix_p_p = new dash::Matrix<short, rank_const_p, unsigned long>(dash_size_spec); \
282 dash_matrix_p_p = new dash::Matrix<int, rank_const_p, unsigned long>(dash_size_spec); \
287 dash_matrix_p_p = new dash::Matrix<long, rank_const_p, unsigned long>(dash_size_spec); \
292 dash_matrix_p_p = new dash::Matrix<long long, rank_const_p, unsigned long>(dash_size_spec); \
297 dash_matrix_p_p = new dash::Matrix<unsigned short, rank_const_p, unsigned long>(dash_size_spec); \
302 dash_matrix_p_p = new dash::Matrix<unsigned int, rank_const_p, unsigned long>(dash_size_spec); \
307 dash_matrix_p_p = new dash::Matrix<unsigned long, rank_const_p, unsigned long>(dash_size_spec); \
312 dash_matrix_p_p = new dash::Matrix<unsigned long long, rank_const_p, unsigned long>(dash_size_spec); \
317 dash_matrix_p_p = new dash::Matrix<float, rank_const_p, unsigned long>(dash_size_spec); \
322 dash_matrix_p_p = new dash::Matrix<double, rank_const_p, unsigned long>(dash_size_spec); \
325 case AU_DOUBLE_COMPLEX: \
327 dash_matrix_p_p = new dash::Matrix<std::complex<double>, rank_const_p, unsigned long>(dash_size_spec); \
331 AU_EXIT("Unsupported datatype in CreateDashMatrix !"); \
335 #define AccessDashData1D(dash_array_p_p, start_p, end_p, data_p, element_type_code_p, RW_flag) \
337 switch (element_type_code_p) \
341 dash::Matrix<short, 1, unsigned long> *dash_array_typed = (dash::Matrix<short, 1, unsigned long> *)dash_array_p_p; \
342 short *typed_data_p = (short *)data_p; \
343 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
345 if (RW_flag == DASH_READ_FLAG) \
347 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
351 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
358 dash::Matrix<int, 1, unsigned long> *dash_array_typed = (dash::Matrix<int, 1, unsigned long> *)dash_array_p_p; \
359 int *typed_data_p = (int *)data_p; \
360 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
362 if (RW_flag == DASH_READ_FLAG) \
364 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
368 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
375 dash::Matrix<long, 1, unsigned long> *dash_array_typed = (dash::Matrix<long, 1, unsigned long> *)dash_array_p_p; \
376 long *typed_data_p = (long *)data_p; \
377 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
379 if (RW_flag == DASH_READ_FLAG) \
381 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
385 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
392 dash::Matrix<long long, 1, unsigned long> *dash_array_typed = (dash::Matrix<long long, 1, unsigned long> *)dash_array_p_p; \
393 long long *typed_data_p = (long long *)data_p; \
394 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
396 if (RW_flag == DASH_READ_FLAG) \
398 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
402 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
409 dash::Matrix<unsigned short, 1, unsigned long> *dash_array_typed = (dash::Matrix<unsigned short, 1, unsigned long> *)dash_array_p_p; \
410 unsigned short *typed_data_p = (unsigned short *)data_p; \
411 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
413 if (RW_flag == DASH_READ_FLAG) \
415 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
419 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
426 dash::Matrix<unsigned int, 1, unsigned long> *dash_array_typed = (dash::Matrix<unsigned int, 1, unsigned long> *)dash_array_p_p; \
427 unsigned int *typed_data_p = (unsigned int *)data_p; \
428 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
430 if (RW_flag == DASH_READ_FLAG) \
432 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
436 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
443 dash::Matrix<unsigned long, 1, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long, 1, unsigned long> *)dash_array_p_p; \
444 unsigned long *typed_data_p = (unsigned long *)data_p; \
445 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
447 if (RW_flag == DASH_READ_FLAG) \
449 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
453 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
460 dash::Matrix<unsigned long long, 1, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long long, 1, unsigned long> *)dash_array_p_p; \
461 unsigned long long *typed_data_p = (unsigned long long *)data_p; \
462 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
464 if (RW_flag == DASH_READ_FLAG) \
466 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
470 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
477 dash::Matrix<float, 1, unsigned long> *dash_array_typed = (dash::Matrix<float, 1, unsigned long> *)dash_array_p_p; \
478 float *typed_data_p = (float *)data_p; \
479 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
481 if (RW_flag == DASH_READ_FLAG) \
483 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
487 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
494 dash::Matrix<double, 1, unsigned long> *dash_array_typed = (dash::Matrix<double, 1, unsigned long> *)dash_array_p_p; \
495 double *typed_data_p = (double *)data_p; \
496 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
498 if (RW_flag == DASH_READ_FLAG) \
500 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
504 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
509 case AU_DOUBLE_COMPLEX: \
511 dash::Matrix<std::complex<double>, 1, unsigned long> *dash_array_typed = (dash::Matrix<std::complex<double>, 1, unsigned long> *)dash_array_p_p; \
512 std::complex<double> *typed_data_p = (std::complex<double> *)data_p; \
513 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
515 if (RW_flag == DASH_READ_FLAG) \
517 typed_data_p[i - start_p[0]] = dash_array_typed->at(i); \
521 dash_array_typed->at(i) = typed_data_p[i - start_p[0]]; \
527 AU_EXIT("Unsupported datatype in AccessDashData !"); \
531 #define AccessDashData2D(dash_array_p_p, start_p, end_p, data_p, element_type_code_p, RW_flag) \
533 unsigned long offset = 0; \
534 switch (element_type_code_p) \
538 dash::Matrix<short, 2, unsigned long> *dash_array_typed = (dash::Matrix<short, 2, unsigned long> *)dash_array_p_p; \
539 short *typed_data_p = (short *)data_p; \
540 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
542 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
544 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
545 if (RW_flag == DASH_READ_FLAG) \
547 typed_data_p[offset] = dash_array_typed->at(i, j); \
551 dash_array_typed->at(i, j) = typed_data_p[offset]; \
559 dash::Matrix<int, 2, unsigned long> *dash_array_typed = (dash::Matrix<int, 2, unsigned long> *)dash_array_p_p; \
560 int *typed_data_p = (int *)data_p; \
561 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
563 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
565 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
566 if (RW_flag == DASH_READ_FLAG) \
568 typed_data_p[offset] = dash_array_typed->at(i, j); \
572 dash_array_typed->at(i, j) = typed_data_p[offset]; \
580 dash::Matrix<long, 2, unsigned long> *dash_array_typed = (dash::Matrix<long, 2, unsigned long> *)dash_array_p_p; \
581 long *typed_data_p = (long *)data_p; \
582 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
584 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
586 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
587 if (RW_flag == DASH_READ_FLAG) \
589 typed_data_p[offset] = dash_array_typed->at(i, j); \
593 dash_array_typed->at(i, j) = typed_data_p[offset]; \
601 dash::Matrix<long long, 2, unsigned long> *dash_array_typed = (dash::Matrix<long long, 2, unsigned long> *)dash_array_p_p; \
602 long long *typed_data_p = (long long *)data_p; \
603 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
605 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
607 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
608 if (RW_flag == DASH_READ_FLAG) \
610 typed_data_p[offset] = dash_array_typed->at(i, j); \
614 dash_array_typed->at(i, j) = typed_data_p[offset]; \
622 dash::Matrix<unsigned short, 2, unsigned long> *dash_array_typed = (dash::Matrix<unsigned short, 2, unsigned long> *)dash_array_p_p; \
623 unsigned short *typed_data_p = (unsigned short *)data_p; \
624 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
626 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
628 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
629 if (RW_flag == DASH_READ_FLAG) \
631 typed_data_p[offset] = dash_array_typed->at(i, j); \
635 dash_array_typed->at(i, j) = typed_data_p[offset]; \
643 dash::Matrix<unsigned int, 2, unsigned long> *dash_array_typed = (dash::Matrix<unsigned int, 2, unsigned long> *)dash_array_p_p; \
644 unsigned int *typed_data_p = (unsigned int *)data_p; \
645 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
647 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
649 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
650 if (RW_flag == DASH_READ_FLAG) \
652 typed_data_p[offset] = dash_array_typed->at(i, j); \
656 dash_array_typed->at(i, j) = typed_data_p[offset]; \
664 dash::Matrix<unsigned long, 2, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long, 2, unsigned long> *)dash_array_p_p; \
665 unsigned long *typed_data_p = (unsigned long *)data_p; \
666 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
668 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
670 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
671 if (RW_flag == DASH_READ_FLAG) \
673 typed_data_p[offset] = dash_array_typed->at(i, j); \
677 dash_array_typed->at(i, j) = typed_data_p[offset]; \
685 dash::Matrix<unsigned long long, 2, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long long, 2, unsigned long> *)dash_array_p_p; \
686 unsigned long long *typed_data_p = (unsigned long long *)data_p; \
687 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
689 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
691 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
692 if (RW_flag == DASH_READ_FLAG) \
694 typed_data_p[offset] = dash_array_typed->at(i, j); \
698 dash_array_typed->at(i, j) = typed_data_p[offset]; \
706 dash::Matrix<float, 2, unsigned long> *dash_array_typed = (dash::Matrix<float, 2, unsigned long> *)dash_array_p_p; \
707 float *typed_data_p = static_cast<float *>(data_p); \
708 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
710 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
712 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
713 if (RW_flag == DASH_READ_FLAG) \
715 typed_data_p[offset] = dash_array_typed->at(i, j); \
719 dash_array_typed->at(i, j) = typed_data_p[offset]; \
727 dash::Matrix<double, 2, unsigned long> *dash_array_typed = (dash::Matrix<double, 2, unsigned long> *)dash_array_p_p; \
728 double *typed_data_p = (double *)data_p; \
729 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
731 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
733 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
734 if (RW_flag == DASH_READ_FLAG) \
736 typed_data_p[offset] = dash_array_typed->at(i, j); \
740 dash_array_typed->at(i, j) = typed_data_p[offset]; \
746 case AU_DOUBLE_COMPLEX: \
748 dash::Matrix<std::complex<double>, 2, unsigned long> *dash_array_typed = (dash::Matrix<std::complex<double>, 2, unsigned long> *)dash_array_p_p; \
749 std::complex<double> *typed_data_p = (std::complex<double> *)data_p; \
750 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
752 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
754 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
755 if (RW_flag == DASH_READ_FLAG) \
757 typed_data_p[offset] = dash_array_typed->at(i, j); \
761 dash_array_typed->at(i, j) = typed_data_p[offset]; \
768 AU_EXIT("Unsupported datatype in AccessDashData !"); \
772 #define AccessDashData3D(dash_array_p_p, start_p, end_p, data_p, element_type_code_p, RW_flag) \
774 unsigned long offset = 0; \
775 switch (element_type_code_p) \
779 dash::Matrix<short, 3, unsigned long> *dash_array_typed = (dash::Matrix<short, 3, unsigned long> *)dash_array_p_p; \
780 short *typed_data_p = (short *)data_p; \
781 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
783 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
785 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
787 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
788 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
789 if (RW_flag == DASH_READ_FLAG) \
791 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
795 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
804 dash::Matrix<int, 3, unsigned long> *dash_array_typed = (dash::Matrix<int, 3, unsigned long> *)dash_array_p_p; \
805 int *typed_data_p = (int *)data_p; \
806 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
808 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
810 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
812 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
813 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
814 if (RW_flag == DASH_READ_FLAG) \
816 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
820 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
829 dash::Matrix<long, 3, unsigned long> *dash_array_typed = (dash::Matrix<long, 3, unsigned long> *)dash_array_p_p; \
830 long *typed_data_p = (long *)data_p; \
831 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
833 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
835 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
837 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
838 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
839 if (RW_flag == DASH_READ_FLAG) \
841 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
845 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
854 dash::Matrix<long long, 3, unsigned long> *dash_array_typed = (dash::Matrix<long long, 3, unsigned long> *)dash_array_p_p; \
855 long long *typed_data_p = (long long *)data_p; \
856 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
858 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
860 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
862 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
863 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
864 if (RW_flag == DASH_READ_FLAG) \
866 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
870 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
879 dash::Matrix<unsigned short, 3, unsigned long> *dash_array_typed = (dash::Matrix<unsigned short, 3, unsigned long> *)dash_array_p_p; \
880 unsigned short *typed_data_p = (unsigned short *)data_p; \
881 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
883 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
885 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
887 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
888 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
889 if (RW_flag == DASH_READ_FLAG) \
891 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
895 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
904 dash::Matrix<unsigned int, 3, unsigned long> *dash_array_typed = (dash::Matrix<unsigned int, 3, unsigned long> *)dash_array_p_p; \
905 unsigned int *typed_data_p = (unsigned int *)data_p; \
906 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
908 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
910 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
912 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
913 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
914 if (RW_flag == DASH_READ_FLAG) \
916 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
920 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
929 dash::Matrix<unsigned long, 3, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long, 3, unsigned long> *)dash_array_p_p; \
930 unsigned long *typed_data_p = (unsigned long *)data_p; \
931 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
933 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
935 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
937 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
938 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
939 if (RW_flag == DASH_READ_FLAG) \
941 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
945 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
954 dash::Matrix<unsigned long long, 3, unsigned long> *dash_array_typed = (dash::Matrix<unsigned long long, 3, unsigned long> *)dash_array_p_p; \
955 unsigned long long *typed_data_p = (unsigned long long *)data_p; \
956 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
958 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
960 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
962 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
963 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
964 if (RW_flag == DASH_READ_FLAG) \
966 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
970 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
979 dash::Matrix<float, 3, unsigned long> *dash_array_typed = (dash::Matrix<float, 3, unsigned long> *)dash_array_p_p; \
980 float *typed_data_p = (float *)data_p; \
981 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
983 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
985 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
987 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
988 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
989 if (RW_flag == DASH_READ_FLAG) \
991 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
995 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
1004 dash::Matrix<double, 3, unsigned long> *dash_array_typed = (dash::Matrix<double, 3, unsigned long> *)dash_array_p_p; \
1005 double *typed_data_p = (double *)data_p; \
1006 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
1008 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
1010 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
1012 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
1013 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
1014 if (RW_flag == DASH_READ_FLAG) \
1016 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
1020 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
1027 case AU_DOUBLE_COMPLEX: \
1029 dash::Matrix<std::complex<double>, 3, unsigned long> *dash_array_typed = (dash::Matrix<std::complex<double>, 3, unsigned long> *)dash_array_p_p; \
1030 std::complex<double> *typed_data_p = (std::complex<double> *)data_p; \
1031 for (unsigned long i = start_p[0]; i <= end_p[0]; i++) \
1033 for (unsigned long j = start_p[1]; j <= end_p[1]; j++) \
1035 for (unsigned long k = start_p[2]; k <= end_p[2]; k++) \
1037 offset = (i - start_p[0]) * (end_p[1] - start_p[1] + 1) + (j - start_p[1]); \
1038 offset = offset * (end_p[2] - start_p[2] + 1) + (k - start_p[2]); \
1039 if (RW_flag == DASH_READ_FLAG) \
1041 typed_data_p[offset] = dash_array_typed->at(i, j, k); \
1045 dash_array_typed->at(i, j, k) = typed_data_p[offset]; \
1053 AU_EXIT("Unsupported datatype in AccessDashData !"); \
1069 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1078 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1084 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1094 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1104 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1115 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1126 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1138 int Read(std::vector<unsigned long long> start, std::vector<unsigned long long> end,
void *data)
1140 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1151 int Write(std::vector<unsigned long long> start, std::vector<unsigned long long> end,
void *data)
1153 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1164 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1170 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1176 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1182 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1193 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1205 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1217 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1229 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1240 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
1251 std::cout <<
"EP_MEMORY is not configured and compiled ! \n";
Define the class for the Endpoint used by ArrayUDF to store the data. It contains basic infomation fo...
Definition: ft_endpoint.h:106
void SetCreateFlag(bool open_flag_p)
Definition: ft_endpoint.cpp:166
void SetEndpointType(AuEndpointType endpoint_type_p)
Set the Endpoint Type object.
Definition: ft_endpoint.cpp:355
void SetOpenFlag(bool open_flag_p)
Definition: ft_endpoint.cpp:156
std::string endpoint_info
Definition: ft_endpoint.h:109
virtual int Control(int opt_code, std::vector< std::string > ¶meter_v)
call a special operator on endpoint such as, enable collective I/O for HDF5 dump file from MEMORY to ...
Definition: ft_endpoint.cpp:421
Definition: ft_endpoint_memory.h:1059
int Write(std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data)
write the data to the end-point
Definition: ft_endpoint_memory.h:1151
int Read(std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data)
read the data from end-point
Definition: ft_endpoint_memory.h:1138
int Create()
create the endpoint
Definition: ft_endpoint_memory.h:1113
EndpointMEMORY(std::string endpoint_info_p)
Construct a new EndpointMEMORY object.
Definition: ft_endpoint_memory.h:1067
int PrintInfo()
print information about the endpoint
Definition: ft_endpoint_memory.h:1102
void EnableCollectiveIO()
Definition: ft_endpoint_memory.h:1174
~EndpointMEMORY()
Definition: ft_endpoint_memory.h:1082
int SpecialOperator(int opt_code, std::vector< std::string > parameter_v)
call a special operator on endpoint to dump file from MEMORY to HDF5, or in verse
Definition: ft_endpoint_memory.h:1203
void Map2MyType()
call the finalize to close everything (like call Destractor)
Definition: ft_endpoint_memory.h:1168
int ParseEndpointInfo()
parse endpoint_info to my own info In MEMORY, it map endpoint_info to filename, group name and datase...
Definition: ft_endpoint_memory.h:1191
void DisableCollectiveIO()
Definition: ft_endpoint_memory.h:1180
EndpointMEMORY()
Construct a new Endpoint in MEMORY Nothing to do there, can be used as sub-endpoint of directory.
Definition: ft_endpoint_memory.h:1076
int MergeMirrors(std::string op_str)
Merger mirrors on all processes.
Definition: ft_endpoint_memory.h:1238
int Volatile(std::string parameter)
Volatile the data from HDF5 to MEMORY.
Definition: ft_endpoint_memory.h:1227
int ExtractMeta()
extracts metadata, possbile endpoint_ranks/endpoint_dim_size/data_element_type
Definition: ft_endpoint_memory.h:1092
int Nonvolatile(std::string parameter)
Nonvolatile the data in MEMORY to HDF5.
Definition: ft_endpoint_memory.h:1215
int Close()
close the end-point
Definition: ft_endpoint_memory.h:1162
int CreateLocalMirror(std::string init_value_str)
Create a Local Mirror object.
Definition: ft_endpoint_memory.h:1249
int Open()
open the endpoint
Definition: ft_endpoint_memory.h:1124
@ EP_MEMORY
Definition: ft_type.h:101
#define AU_EXIT(info)
Definition: ft_utility_macro.h:147