Commit 72dd71c
Fix potential Data race in OpenMP (#7345)
* fix data race
* fix potential data race
* fix data race in pw
* fix potential data race
* update format
* fix data race in fft
* fix
* Fix data race in evolve_ofdft.cpp for TDOFDFT calculation. Cache shared member variables (nspin, nrxx, npw, gg, tpiba, tpiba2, gcar) to local const variables before OpenMP parallel regions to eliminate ThreadSanitizer false positive warnings.
* Fix OpenMP barrier placement in pw_gatherscatter.h. The #pragma omp barrier directive must be inside an explicit #pragma omp parallel region, not after #pragma omp for which ends the implicit parallel region. This fixes undefined behavior when compiled with OpenMP enabled.
* Remove obsolete OMP barrier comments from pw_gatherscatter.h
* Rename local variables with underscore suffix in pw_gatherscatter.h to distinguish from member variables (nst -> nst_, nz -> nz_, etc.)
* Rename local variables with underscore suffix in pw_transform.cpp to distinguish from member variables (nrxx -> nrxx_, npw -> npw_, nxyz -> nxyz_, nst -> nst_, nz -> nz_, nx -> nx_, ny -> ny_, nplane -> nplane_, ig2isz -> ig2isz_)
* Rename local variables with underscore suffix in fft_cpu.cpp to distinguish from member variables (npy -> npy_, nx -> nx_, lixy -> lixy_, rixy -> rixy_, nplane -> nplane_, and FFTW plan objects)
* Remove redundant #pragma omp barrier directives in pw_gatherscatter.h. The #pragma omp for directive already performs implicit synchronization at the end of the loop, making explicit barrier redundant.
* add WARNING_QUIT
---------
Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>1 parent 6095b84 commit 72dd71c
8 files changed
Lines changed: 472 additions & 321 deletions
File tree
- source
- source_base
- module_fft
- source_basis/module_pw
- source_cell
- source_estate/module_charge
- source_pw
- module_ofdft
- module_pwdft
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
348 | 355 | | |
349 | 356 | | |
350 | 357 | | |
351 | | - | |
| 358 | + | |
| 359 | + | |
352 | 360 | | |
353 | | - | |
| 361 | + | |
| 362 | + | |
354 | 363 | | |
355 | | - | |
| 364 | + | |
356 | 365 | | |
| 366 | + | |
357 | 367 | | |
358 | | - | |
| 368 | + | |
| 369 | + | |
359 | 370 | | |
360 | | - | |
| 371 | + | |
361 | 372 | | |
362 | 373 | | |
363 | 374 | | |
364 | 375 | | |
| 376 | + | |
365 | 377 | | |
366 | | - | |
| 378 | + | |
| 379 | + | |
367 | 380 | | |
368 | | - | |
| 381 | + | |
369 | 382 | | |
370 | | - | |
371 | | - | |
| 383 | + | |
| 384 | + | |
372 | 385 | | |
373 | 386 | | |
374 | 387 | | |
375 | 388 | | |
376 | 389 | | |
377 | 390 | | |
378 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
379 | 399 | | |
380 | 400 | | |
| 401 | + | |
381 | 402 | | |
382 | | - | |
| 403 | + | |
| 404 | + | |
383 | 405 | | |
384 | | - | |
| 406 | + | |
385 | 407 | | |
| 408 | + | |
386 | 409 | | |
387 | | - | |
| 410 | + | |
| 411 | + | |
388 | 412 | | |
389 | | - | |
| 413 | + | |
390 | 414 | | |
391 | | - | |
| 415 | + | |
392 | 416 | | |
393 | 417 | | |
394 | 418 | | |
395 | | - | |
396 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
397 | 422 | | |
398 | | - | |
| 423 | + | |
| 424 | + | |
399 | 425 | | |
400 | | - | |
| 426 | + | |
401 | 427 | | |
402 | 428 | | |
403 | 429 | | |
| |||
417 | 443 | | |
418 | 444 | | |
419 | 445 | | |
420 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
421 | 453 | | |
422 | 454 | | |
423 | | - | |
| 455 | + | |
| 456 | + | |
424 | 457 | | |
425 | | - | |
| 458 | + | |
| 459 | + | |
426 | 460 | | |
427 | | - | |
| 461 | + | |
428 | 462 | | |
429 | 463 | | |
430 | 464 | | |
431 | 465 | | |
| 466 | + | |
432 | 467 | | |
433 | | - | |
| 468 | + | |
| 469 | + | |
434 | 470 | | |
435 | | - | |
| 471 | + | |
436 | 472 | | |
437 | | - | |
| 473 | + | |
438 | 474 | | |
439 | 475 | | |
440 | 476 | | |
441 | 477 | | |
442 | 478 | | |
443 | 479 | | |
444 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
445 | 487 | | |
446 | 488 | | |
| 489 | + | |
447 | 490 | | |
448 | | - | |
| 491 | + | |
| 492 | + | |
449 | 493 | | |
450 | | - | |
| 494 | + | |
451 | 495 | | |
452 | | - | |
| 496 | + | |
453 | 497 | | |
454 | 498 | | |
455 | 499 | | |
456 | | - | |
| 500 | + | |
| 501 | + | |
457 | 502 | | |
458 | | - | |
| 503 | + | |
| 504 | + | |
459 | 505 | | |
460 | | - | |
| 506 | + | |
461 | 507 | | |
462 | 508 | | |
463 | 509 | | |
| |||
0 commit comments