25 int shapeN4[] = {
NS,
NS,
NS,NS};
26 int sizeN4[] = {n+1,n,n+2,n+3};
32 if (dw.
rank < n*n*n*n){
34 int str_len = drand48()*255;
37 std::fill(my_obj.
name, my_obj.
name+str_len,
'a');
38 my_obj.
name[str_len]=
'\0';
40 int64_t idx = dw.
rank;
41 A.write(1, &idx, &my_obj);
43 A.write(0, NULL, NULL);
52 A.get_local_data(&nloc, &indices, &loc_data,
true);
56 for (int64_t i=0; i<nloc; i++){
57 if ((
int)strlen(loc_data[i].name) != loc_data[i].len_name) pass = 0;
60 MPI_Allreduce(MPI_IN_PLACE, &pass, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
64 printf(
"{ A[\"ijkl\"] = comp_len(A[\"ijkl\"]) } passed\n");
66 printf(
"{ A[\"ijkl\"] = comp_len(A[\"ijkl\"]) } failed\n");
82 char ** itr = std::find(begin, end, option);
83 if (itr != end && ++itr != end){
90 int main(
int argc,
char ** argv){
92 int const in_num = argc;
93 char ** input_str = argv;
95 MPI_Init(&argc, &argv);
96 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
97 MPI_Comm_size(MPI_COMM_WORLD, &np);
100 n = atoi(
getCmdOption(input_str, input_str+in_num,
"-n"));
106 World dw(MPI_COMM_WORLD, argc, argv);
109 printf(
"Computing user-defined endomorphism on a tensor over a set, A_ijkl = f(A_ijkl)\n");
Set class defined by a datatype and a min/max function (if it is partially ordered i...
char * getCmdOption(char **begin, char **end, const std::string &option)
an instance of the CTF library (world) on a MPI communicator
int endomorphism_cust_sp(int n, World &dw)
int rank
rank of local processor
int main(int argc, char **argv)
an instance of a tensor within a CTF world
void comp_len(cust_sp_type &a)