20 int shapeN4[] = {
NS,
NS,
NS,NS};
21 int sizeN4[] = {n+1,n,n+2,n+3};
28 double * all_start_data;
38 double * all_end_data;
42 int pass = (nall == nall2);
44 for (int64_t i=0; i<nall; i++){
45 fdbl(all_start_data[i]);
46 if (fabs(all_start_data[i]-all_end_data[i])>=1.E-6) pass =0;
49 MPI_Allreduce(MPI_IN_PLACE, &pass, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
53 printf(
"{ A[\"ijkl\"] = A[\"ijkl\"]^3 } passed\n");
55 printf(
"{ A[\"ijkl\"] = A[\"ijkl\"]^3 } failed\n");
59 delete [] all_start_data;
60 delete [] all_end_data;
71 char ** itr = std::find(begin, end, option);
72 if (itr != end && ++itr != end){
79 int main(
int argc,
char ** argv){
81 int const in_num = argc;
82 char ** input_str = argv;
84 MPI_Init(&argc, &argv);
85 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
86 MPI_Comm_size(MPI_COMM_WORLD, &np);
89 n = atoi(
getCmdOption(input_str, input_str+in_num,
"-n"));
95 World dw(MPI_COMM_WORLD, argc, argv);
98 printf(
"Computing endomorphism A_ijkl = f(A_ijkl)\n");
int main(int argc, char **argv)
void read_all(int64_t *npair, dtype **data, bool unpack=false)
collects the entire tensor data on each process (not memory scalable)
an instance of the CTF library (world) on a MPI communicator
char * getCmdOption(char **begin, char **end, const std::string &option)
int endomorphism(int n, World &dw)
void fill_random(dtype rmin, dtype rmax)
fills local unique tensor elements to random values in the range [min,max] works only for dtype in {f...
int rank
rank of local processor
an instance of a tensor within a CTF world