Skip to content

Commit cb2c911

Browse files
committed
rebase roman's app_context (direct file copy)
1 parent 0436f15 commit cb2c911

67 files changed

Lines changed: 981 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# this is a sample input file for cloverdet + cloverdetratio using
2+
# DDalphaAMG as a solver
3+
4+
L=8
5+
T=8
6+
Measurements = 20
7+
Startcondition = hot
8+
2KappaMu = 0.01
9+
CSW = 1.00
10+
kappa = 0.138
11+
NSave = 500000
12+
ThetaT = 1.0
13+
UseEvenOdd = yes
14+
ReversibilityCheck = yes
15+
ReversibilityCheckIntervall = 4
16+
InitialStoreCounter = 0
17+
DebugLevel = 1
18+
19+
BeginPTBC
20+
21+
BeginPTBCDefect 0
22+
Extents = 2, 2, 2
23+
Along = Y
24+
EndPTBCDefect
25+
26+
BeginPTBCInstance 0
27+
Coefficients = 1.0
28+
Defects = 0
29+
EndPTBCInstance
30+
31+
BeginPTBCInstance 1
32+
Coefficients = 0.0
33+
Defects = 0
34+
EndPTBCInstance
35+
36+
BeginPTBCInstance 2
37+
Coefficients = 0.75
38+
Defects = 0
39+
EndPTBCInstance
40+
41+
BeginPTBCInstance 3
42+
Coefficients = 0.5
43+
Defects = 0
44+
EndPTBCInstance
45+
46+
EndPTBC
47+
48+
49+
50+
# since this is a test file, we employ the reproducible random numbers mode
51+
ReproduceRandomNumbers = yes
52+
Seed = 127782
53+
54+
BeginMeasurement CORRELATORS
55+
Frequency = 2
56+
EndMeasurement
57+
58+
BeginMonomial GAUGE
59+
Type = Wilson
60+
beta = 5.60
61+
Timescale = 0
62+
EndMonomial
63+
64+
BeginMonomial CLOVERDET
65+
Timescale = 1
66+
2KappaMu = 0.01
67+
CSW = 1.00
68+
# nominator shift
69+
rho = 0.1
70+
kappa = 0.138
71+
AcceptancePrecision = 1.e-20
72+
ForcePrecision = 1.e-14
73+
Name = cloverdet
74+
solver = rgmixedcg
75+
usesloppyprecision = single
76+
EndMonomial
77+
78+
BeginMonomial CLOVERDETRATIO
79+
Timescale = 2
80+
2KappaMu = 0.01
81+
# nominator shift
82+
rho = 0.0
83+
# denominator shift, should match CLOVERDET shift
84+
rho2 = 0.1
85+
CSW = 1.00
86+
kappa = 0.138
87+
AcceptancePrecision = 1.e-20
88+
ForcePrecision = 1.e-16
89+
Name = cloverdetratio
90+
solver = rgmixedcg
91+
usesloppyprecision = single
92+
EndMonomial
93+
94+
BeginIntegrator
95+
Type0 = 2MNFG
96+
Type1 = 2MNFG
97+
Type2 = 2MNFG
98+
IntegrationSteps0 = 1
99+
IntegrationSteps1 = 1
100+
IntegrationSteps2 = 4
101+
tau = 1.00
102+
Lambda0 = 0.16666667
103+
Lambda1 = 0.16666667
104+
Lambda2 = 0.16666667
105+
NumberOfTimescales = 3
106+
EndIntegrator
107+
108+
BeginOperator CLOVER
109+
2KappaMu = 0.01
110+
CSW = 1.00
111+
kappa = 0.138
112+
SolverPrecision = 1e-16
113+
MaxSolverIterations = 1000
114+
useevenodd = yes
115+
solver = rgmixedcg
116+
usesloppyprecision = single
117+
EndOperator

src/bin/benchmark.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int main(int argc, char *argv[]) {
102102
#else
103103
MPI_Init(&argc, &argv);
104104
#endif
105-
MPI_Comm_rank(MPI_COMM_WORLD, &g_proc_id);
105+
MPI_Comm_rank(app()->mpi.comm, &g_proc_id);
106106

107107
#else
108108
g_proc_id = 0;
@@ -234,7 +234,7 @@ int main(int argc, char *argv[]) {
234234
antioptaway = 0.0;
235235
/* compute approximately how many applications we need to do to get a reliable measurement */
236236
#ifdef TM_USE_MPI
237-
MPI_Barrier(MPI_COMM_WORLD);
237+
MPI_Barrier(app()->mpi.comm);
238238
#endif
239239
t1 = gettime();
240240
for (j = 0; j < j_max; j++) {
@@ -248,14 +248,14 @@ int main(int argc, char *argv[]) {
248248
// division by g_nproc because we will average over processes
249249
j = (int)(ceil(j_max * 31.0 / dt / g_nproc));
250250
#ifdef TM_USE_MPI
251-
MPI_Allreduce(&j, &j_max, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
251+
MPI_Allreduce(&j, &j_max, 1, MPI_INT, MPI_SUM, app()->mpi.comm);
252252
#else
253253
j_max = j;
254254
#endif
255255

256256
/* perform the actual benchmark */
257257
#ifdef TM_USE_MPI
258-
MPI_Barrier(MPI_COMM_WORLD);
258+
MPI_Barrier(app()->mpi.comm);
259259
#endif
260260
t1 = gettime();
261261
antioptaway = 0.0;
@@ -268,14 +268,14 @@ int main(int argc, char *argv[]) {
268268
}
269269
dt = gettime() - t1;
270270
#ifdef TM_USE_MPI
271-
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
271+
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
272272
#else
273273
sdt = dt;
274274
#endif
275275

276276
qdt = dt * dt;
277277
#ifdef TM_USE_MPI
278-
MPI_Allreduce(&qdt, &sqdt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
278+
MPI_Allreduce(&qdt, &sqdt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
279279
#else
280280
sqdt = qdt;
281281
#endif
@@ -321,9 +321,9 @@ int main(int argc, char *argv[]) {
321321
dt2 = t2 - t1;
322322
/* compute the bandwidth */
323323
dt = dts - dt2;
324-
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
324+
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
325325
sdt = sdt / ((double)g_nproc);
326-
MPI_Allreduce(&dt2, &dt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
326+
MPI_Allreduce(&dt2, &dt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
327327
dt = dt / ((double)g_nproc);
328328
dt = 1.0e6f * dt / ((double)(k_max * j_max * (VOLUME)));
329329
if (g_proc_id == 0) {
@@ -365,7 +365,7 @@ int main(int argc, char *argv[]) {
365365

366366
/* estimate a reasonable number of applications to get a reliable measurement */
367367
#ifdef TM_USE_MPI
368-
MPI_Barrier(MPI_COMM_WORLD);
368+
MPI_Barrier(app()->mpi.comm);
369369
#endif
370370
t1 = gettime();
371371
for (j = 0; j < j_max; j++) {
@@ -379,14 +379,14 @@ int main(int argc, char *argv[]) {
379379
// division by g_nproc because we will average over processes using MPI_SUM
380380
j = (int)(ceil(j_max * 31.0 / dt / g_nproc));
381381
#ifdef TM_USE_MPI
382-
MPI_Allreduce(&j, &j_max, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
382+
MPI_Allreduce(&j, &j_max, 1, MPI_INT, MPI_SUM, app()->mpi.comm);
383383
#else
384384
j_max = j;
385385
#endif
386386

387387
/* perform the actual measurement */
388388
#ifdef TM_USE_MPI
389-
MPI_Barrier(MPI_COMM_WORLD);
389+
MPI_Barrier(app()->mpi.comm);
390390
#endif
391391
t1 = gettime();
392392
for (j = 0; j < j_max; j++) {
@@ -398,13 +398,13 @@ int main(int argc, char *argv[]) {
398398
t2 = gettime();
399399
dt = t2 - t1;
400400
#ifdef TM_USE_MPI
401-
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
401+
MPI_Allreduce(&dt, &sdt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
402402
#else
403403
sdt = dt;
404404
#endif
405405
qdt = dt * dt;
406406
#ifdef TM_USE_MPI
407-
MPI_Allreduce(&qdt, &sqdt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
407+
MPI_Allreduce(&qdt, &sqdt, 1, MPI_DOUBLE, MPI_SUM, app()->mpi.comm);
408408
#else
409409
sqdt = qdt;
410410
#endif
@@ -451,7 +451,7 @@ int main(int argc, char *argv[]) {
451451
free_spinor_field();
452452
free_moment_field();
453453
#ifdef TM_USE_MPI
454-
MPI_Barrier(MPI_COMM_WORLD);
454+
MPI_Barrier(app()->mpi.comm);
455455
MPI_Finalize();
456456
#endif
457457
return (0);

src/bin/deriv_mg_tune.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ int main(int argc, char *argv[]) {
357357
_endQuda();
358358
#endif
359359
#ifdef TM_USE_MPI
360-
MPI_Barrier(MPI_COMM_WORLD);
360+
MPI_Barrier(app()->mpi.comm);
361361
MPI_Finalize();
362362
#endif
363363

src/bin/hmc_tm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ int main(int argc, char *argv[]) {
479479

480480
sleep(io_timeout);
481481
#ifdef TM_USE_MPI
482-
MPI_Barrier(MPI_COMM_WORLD);
482+
MPI_Barrier(app()->mpi.comm);
483483
#endif
484484
}
485485
/* Now move .conf.tmp into place */
@@ -528,7 +528,7 @@ int main(int argc, char *argv[]) {
528528
}
529529

530530
#ifdef TM_USE_MPI
531-
MPI_Barrier(MPI_COMM_WORLD);
531+
MPI_Barrier(app()->mpi.comm);
532532
#endif
533533
if (ix == 0 && g_proc_id == 0) {
534534
countfile = fopen("history_hmc_tm", "a");
@@ -581,7 +581,7 @@ int main(int argc, char *argv[]) {
581581
_endQuda();
582582
#endif
583583
#ifdef TM_USE_MPI
584-
MPI_Barrier(MPI_COMM_WORLD);
584+
MPI_Barrier(app()->mpi.comm);
585585
MPI_Finalize();
586586
#endif
587587

src/bin/invert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ int main(int argc, char *argv[]) {
448448
_endQuda();
449449
#endif
450450
#ifdef TM_USE_MPI
451-
MPI_Barrier(MPI_COMM_WORLD);
451+
MPI_Barrier(app()->mpi.comm);
452452
MPI_Finalize();
453453
#endif
454454
return (0);

src/bin/offline_measurement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ int main(int argc, char *argv[]) {
294294
free(input_filename);
295295

296296
#ifdef TM_USE_MPI
297-
MPI_Barrier(MPI_COMM_WORLD);
297+
MPI_Barrier(app()->mpi.comm);
298298
MPI_Finalize();
299299
#endif
300300
return (0);

src/bin/tests/hopping_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ int main(int argc, char *argv[]) {
318318
}
319319

320320
#ifdef TM_USE_MPI
321-
MPI_Barrier(MPI_COMM_WORLD);
321+
MPI_Barrier(app()->mpi.comm);
322322
MPI_Finalize();
323323
#endif
324324
}

src/bin/tests/qphix_test_Dslash.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int main(int argc, char* argv[]) {
221221
source_location, 12345 /* seed */);
222222

223223
#ifdef TM_USE_MPI
224-
MPI_Barrier(MPI_COMM_WORLD);
224+
MPI_Barrier(app()->mpi.comm);
225225
#endif
226226

227227
tm_t1 = gettime();
@@ -231,7 +231,7 @@ int main(int argc, char* argv[]) {
231231
tm_t2 = gettime();
232232

233233
#ifdef TM_USE_MPI
234-
MPI_Barrier(MPI_COMM_WORLD);
234+
MPI_Barrier(app()->mpi.comm);
235235
#endif
236236
q_t1 = gettime();
237237
Mfull_qphix(qphix_out_cb_spinors[0], qphix_out_cb_spinors[1], op->sr0, op->sr1, op->type);
@@ -297,15 +297,15 @@ int main(int argc, char* argv[]) {
297297
free_spinor_field();
298298
free_moment_field();
299299
#ifdef TM_USE_MPI
300-
MPI_Barrier(MPI_COMM_WORLD);
300+
MPI_Barrier(app()->mpi.comm);
301301
MPI_Finalize();
302302
#endif
303303
return (failed);
304304
}
305305

306306
double compare_spinors(spinor* s1, spinor* s2) {
307307
#ifdef TM_USE_MPI
308-
MPI_Barrier(MPI_COMM_WORLD);
308+
MPI_Barrier(app()->mpi.comm);
309309
#endif
310310
int coords[4];
311311
int x, y, z, t, id = 0;
@@ -352,7 +352,7 @@ double compare_spinors(spinor* s1, spinor* s2) {
352352
}
353353
}
354354
#ifdef TM_USE_MPI
355-
MPI_Barrier(MPI_COMM_WORLD);
355+
MPI_Barrier(app()->mpi.comm);
356356
#endif
357357
} // z
358358
} // y
@@ -361,7 +361,7 @@ double compare_spinors(spinor* s1, spinor* s2) {
361361
} // if( SourceInfo.type == SRC_TYPE_POINT )
362362

363363
#ifdef TM_USE_MPI
364-
MPI_Barrier(MPI_COMM_WORLD);
364+
MPI_Barrier(app()->mpi.comm);
365365
#endif
366366
if (g_proc_id == 0) {
367367
printf("\n");
@@ -376,7 +376,7 @@ double compare_spinors(spinor* s1, spinor* s2) {
376376
double squarenorm = diff_and_square_norm(s1, s2, VOLUME);
377377

378378
#ifdef TM_USE_MPI
379-
MPI_Barrier(MPI_COMM_WORLD);
379+
MPI_Barrier(app()->mpi.comm);
380380
#endif
381381
id = 0;
382382
for (int t_global = 0; t_global < g_nproc_t * T; t_global++) {
@@ -408,7 +408,7 @@ double compare_spinors(spinor* s1, spinor* s2) {
408408
}
409409
}
410410
#ifdef TM_USE_MPI
411-
MPI_Barrier(MPI_COMM_WORLD);
411+
MPI_Barrier(app()->mpi.comm);
412412
#endif
413413
} // z
414414
} // y

src/bin/tests/test_eigenvalues.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,14 @@ int main(int argc, char *argv[]) {
390390
}
391391
rlxd_get(rlxd_state);
392392
#ifdef TM_USE_MPI
393-
MPI_Send(&rlxd_state[0], 105, MPI_INT, 1, 99, MPI_COMM_WORLD);
394-
MPI_Recv(&rlxd_state[0], 105, MPI_INT, g_nproc - 1, 99, MPI_COMM_WORLD, &status);
393+
MPI_Send(&rlxd_state[0], 105, MPI_INT, 1, 99, app()->mpi.comm);
394+
MPI_Recv(&rlxd_state[0], 105, MPI_INT, g_nproc - 1, 99, app()->mpi.comm, &status);
395395
rlxd_reset(rlxd_state);
396396
#endif
397397
}
398398
#ifdef TM_USE_MPI
399399
else {
400-
MPI_Recv(&rlxd_state[0], 105, MPI_INT, g_proc_id - 1, 99, MPI_COMM_WORLD, &status);
400+
MPI_Recv(&rlxd_state[0], 105, MPI_INT, g_proc_id - 1, 99, app()->mpi.comm, &status);
401401
rlxd_reset(rlxd_state);
402402
/* hot */
403403
if (startoption == 1) {
@@ -408,7 +408,7 @@ int main(int argc, char *argv[]) {
408408
k = 0;
409409
}
410410
rlxd_get(rlxd_state);
411-
MPI_Send(&rlxd_state[0], 105, MPI_INT, k, 99, MPI_COMM_WORLD);
411+
MPI_Send(&rlxd_state[0], 105, MPI_INT, k, 99, app()->mpi.comm);
412412
}
413413
#endif
414414

0 commit comments

Comments
 (0)