This example show how to use merge data across ranks in FasTensor .
- Author
- Bin Dong (dbin@.nosp@m.lbl..nosp@m.gov)
- Version
- 0.1
- Date
- 2021-05-28
- Copyright
- Copyright (c) 2021
#include <iostream>
#include <stdarg.h>
#include <vector>
#include <stdlib.h>
using namespace std;
std::vector<unsigned long long>
H_size = {4};
{
if (iStencil(0) < 40)
{
H->SetValue(
H->GetValue(0) + 1, 0);
}
else if (iStencil(0) >= 40 && iStencil(0) < 80)
{
H->SetValue(
H->GetValue(1) + 1, 1);
}
else if (iStencil(0) >= 80 && iStencil(0) < 120)
{
H->SetValue(
H->GetValue(2) + 1, 2);
}
else if (iStencil(0) >= 120)
{
H->SetValue(
H->GetValue(3) + 1, 3);
}
return 0;
}
int main(
int argc,
char *argv[])
{
std::vector<int> chunk_size = {32};
std::vector<int> overlap_size = {0};
H =
new Array<float>(
"EP_MEMORY",
H_size);
Array<float> *A = new Array<float>("EP_HDF5:./test-data/testf-16-reduce.h5:/testg/testd", chunk_size, overlap_size);
for (int i = 0; i < 4; i++)
{
}
std::cout << "Enable Local Mirros: " << std::endl;
H->Nonvolatile(
"EP_HDF5:./test-data/testf-16-reduce-hist.h5:/testg/testd");
delete A;
return 0;
}
Definition: ft_stencil.h:100
#define AU_Init(argc, argv)
Definition: ft.h:112
#define AU_Finalize()
Definition: ft.h:113
int main(int argc, char *argv[])
Definition: ft_example_reduce.cpp:126
Array< float > * H
Definition: ft_example_reduce.cpp:101
Stencil< float > udf_hist(const Stencil< float > &iStencil)
Definition: ft_example_reduce.cpp:104
std::vector< unsigned long long > H_size
Definition: ft_example_reduce.cpp:100
#define AU_SUM
Definition: ft_merge.h:92
Definition: ft_array.h:113