24 P.get_local_data(&nloc, &inds, &loc_parts);
28 for (int64_t i=0; i<nloc; i++){
29 loc_parts[i].
dx = drand48();
30 loc_parts[i].
dy = drand48();
31 loc_parts[i].
coeff = .001*drand48();
32 loc_parts[i].
id = 777;
34 P.write(nloc, inds, loc_parts);
43 F[
"i"] += fGF(P[
"i"],P[
"j"]);
47 F_all[
"ij"] = fGF(P[
"i"],P[
"j"]);
54 f_mgn[
"i"] += get_mgn(F_all[
"ij"]);
55 -1.0*f_mgn[
"i"] += get_mgn(F[
"i"]);
57 int pass = (f_mgn.norm2() < 1.E-6);
58 MPI_Allreduce(MPI_IN_PLACE, &pass, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
62 printf(
"{ F[\"i\"] = get_force(P[\"i\"],P[\"j\"]) } passed\n");
64 printf(
"{ F[\"i\"] = get_force(P[\"i\"],P[\"j\"]) } failed\n");
79 char ** itr = std::find(begin, end, option);
80 if (itr != end && ++itr != end){
87 int main(
int argc,
char ** argv){
89 int const in_num = argc;
90 char ** input_str = argv;
92 MPI_Init(&argc, &argv);
93 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
94 MPI_Comm_size(MPI_COMM_WORLD, &np);
97 n = atoi(
getCmdOption(input_str, input_str+in_num,
"-n"));
103 World dw(MPI_COMM_WORLD, argc, argv);
106 printf(
"Computing particle_interaction A_ijkl = f(B_ijkl, A_ijkl)\n");
Set class defined by a datatype and a min/max function (if it is partially ordered i...
int main(int argc, char **argv)
Matrix class which encapsulates a 2D tensor.
char * getCmdOption(char **begin, char **end, const std::string &option)
Vector class which encapsulates a 1D tensor.
an instance of the CTF library (world) on a MPI communicator
int particle_interaction(int n, World &dw)
int rank
rank of local processor
Group is a Monoid with operator '-' defined special case (parent) of a ring.