Skip to content

Commit

Permalink
initial change of define MPI to TM_USE_MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
urbach committed May 19, 2016
1 parent 960721b commit a7e285b
Show file tree
Hide file tree
Showing 151 changed files with 657 additions and 657 deletions.
2 changes: 1 addition & 1 deletion DirectPut.c
Expand Up @@ -24,7 +24,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <stdint.h>
#ifdef MPI
#ifdef TM_USE_MPI
# include <mpi.h>
#endif
#ifdef OMP
Expand Down
8 changes: 4 additions & 4 deletions GPU/ASYNC.cuh
Expand Up @@ -78,7 +78,7 @@ __global__ void dev_Hopping_Matrix_ASYNC (const dev_su3_2v * gf,

#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_site[pos]) < (dev_T-1)*spatialvol) || (dev_rank < dev_nproc-1) ) {
//if ((gfindex_site[pos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -143,7 +143,7 @@ __global__ void dev_Hopping_Matrix_ASYNC (const dev_su3_2v * gf,
//color
#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) || (dev_rank > 0) ) {
//if ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -1205,7 +1205,7 @@ __global__ void dev_Hopping_Matrix_half_ASYNC (const dev_su3_2v_half * gf,

#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_site[pos]) < (dev_T-1)*spatialvol) || (dev_rank < dev_nproc-1) ) {
//if ((gfindex_site[pos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -1282,7 +1282,7 @@ __global__ void dev_Hopping_Matrix_half_ASYNC (const dev_su3_2v_half * gf,
//color
#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) || (dev_rank > 0) ) {
//if ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down
8 changes: 4 additions & 4 deletions GPU/Hopping_Matrix.cuh
Expand Up @@ -497,7 +497,7 @@ __global__ void dev_Hopping_Matrix(const dev_su3_2vM(RealT) * gf, const dev_spin

#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_site[pos]) < (dev_T-1)*spatialvol) || (dev_rank < dev_nproc-1) ) {
//if ((gfindex_site[pos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -562,7 +562,7 @@ __global__ void dev_Hopping_Matrix(const dev_su3_2vM(RealT) * gf, const dev_spin
//color
#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) || (dev_rank > 0) ) {
//if ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -977,7 +977,7 @@ __global__ void dev_Hopping_Matrix_half(const dev_su3_2v_half * gf, const dev_sp

#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_site[pos]) < (dev_T-1)*spatialvol) || (dev_rank < dev_nproc-1) ) {
//if ((gfindex_site[pos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down Expand Up @@ -1054,7 +1054,7 @@ __global__ void dev_Hopping_Matrix_half(const dev_su3_2v_half * gf, const dev_sp
//color
#ifdef TEMPORALGAUGE
// gf == ID for t != T-1 => just read the spinor
#ifdef MPI
#ifdef TM_USE_MPI
if ( ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) || (dev_rank > 0) ) {
//if ((gfindex_nextsite[hoppos]) < (dev_T-1)*spatialvol) { // FAKE TEMPORALGAUGE
#else
Expand Down
2 changes: 1 addition & 1 deletion GPU/MACROS.cuh
Expand Up @@ -70,7 +70,7 @@



#ifndef MPI // non-MPI ////////////////////////////////////////////////////////////
#ifndef[blank]* TM_USE_MPI // non-MPI ////////////////////////////////////////////////////////////



Expand Down
4 changes: 2 additions & 2 deletions GPU/gauge_reconstruction.cuh
Expand Up @@ -963,7 +963,7 @@ __global__ void dev_check_gauge_reconstruction_8(typename dev_su3_2vT<RealT>::ty
template<class RealT>
void su3to2vf4(su3** gf, typename dev_su3_2vT<RealT>::type* h2d_gf){
int i,j;
#ifndef MPI
#ifndef[blank]* TM_USE_MPI
for (i = 0; i < VOLUME; i++) {
#else
for (i = 0; i < (VOLUME+RAND); i++) {
Expand Down Expand Up @@ -996,7 +996,7 @@ void su3to2vf4(su3** gf, typename dev_su3_2vT<RealT>::type* h2d_gf){
template<class RealT>
void su3to8(su3** gf, typename dev_su3_8T<RealT>::type* h2d_gf){
int i,j;
#ifndef MPI
#ifndef[blank]* TM_USE_MPI
for (i = 0; i < VOLUME; i++) {
#else
for (i = 0; i < (VOLUME+RAND); i++) {
Expand Down
8 changes: 4 additions & 4 deletions GPU/half.cuh
Expand Up @@ -433,7 +433,7 @@ extern "C" int bind_halfspinor_texture(dev_spinor_half* sh, float* shnorm){
size_t size, sizenorm;
int gridsize;

#ifdef MPI
#ifdef TM_USE_MPI
if(even_odd_flag){
size = sizeof(short4)*6*(VOLUME+RAND)/2;
sizenorm = sizeof(float)*(VOLUME+RAND)/2;
Expand Down Expand Up @@ -577,7 +577,7 @@ return(0);
extern "C" int bind_texture_gf_half(dev_su3_2v_half * gf){
//printf("Binding texture to gaugefield\n");

#ifdef MPI
#ifdef TM_USE_MPI
#ifdef GF_8
size_t size = sizeof(short4)*2*(VOLUME+RAND)*4;
#else
Expand Down Expand Up @@ -1054,7 +1054,7 @@ float dotprod_half(dev_spinor_half* x, float* x_norm, dev_spinor_half* y, float*
for(i=0; i<blas_half_redblocks; i++){
finalsum += blas_half_sredfield[i];
}
#ifdef MPI
#ifdef TM_USE_MPI
MPI_Allreduce(&finalsum, &result, 1, MPI_FLOAT, MPI_SUM, MPI_COMM_WORLD);
finalsum=result;
#endif
Expand Down Expand Up @@ -1089,7 +1089,7 @@ float squarenorm_half(dev_spinor_half* x, float * xnorm){
for(i=0; i<blas_half_redblocks; i++){
finalsum += blas_half_sredfield[i];
}
#ifdef MPI
#ifdef TM_USE_MPI
MPI_Allreduce(&finalsum, &result, 1, MPI_FLOAT, MPI_SUM, MPI_COMM_WORLD);
finalsum=result;
#endif
Expand Down
6 changes: 3 additions & 3 deletions GPU/half_solvers.cuh
Expand Up @@ -202,7 +202,7 @@ extern "C" int dev_cg_eo_half(

//use full volume here as we need the complete gauge field!!!
int Vol;
#ifndef MPI
#ifndef[blank]* TM_USE_MPI
Vol = VOLUME;
#else
Vol = VOLUME+RAND;
Expand Down Expand Up @@ -285,7 +285,7 @@ extern "C" int dev_cg_eo_half(
for(i=0;i<maxit;i++){ //MAIN LOOP

// Q_{-}Q{+}
#ifndef MPI
#ifndef[blank]* TM_USE_MPI
dev_Qtm_pm_psi_half(spin2, spin2_norm, spin3, spin3_norm, griddim3, blockdim3, griddim4, blockdim4);
#else
dev_Qtm_pm_psi_half_mpi(spin2, spin2_norm, spin3, spin3_norm, griddim3, blockdim3, griddim4, blockdim4);
Expand Down Expand Up @@ -367,7 +367,7 @@ extern "C" int dev_cg_eo_half(
// DO NOT USE tm_dirac_dagger_kappa here, otherwise spin2 will be overwritten!!!

// Q_{-}Q{+}
#ifndef MPI
#ifndef[blank]* TM_USE_MPI
dev_Qtm_pm_psi_half(spin1, spin1_norm, spin3, spin3_norm, griddim3, blockdim3, griddim4, blockdim4);
#else
dev_Qtm_pm_psi_half_mpi(spin1, spin1_norm, spin3, spin3_norm, griddim3, blockdim3, griddim4, blockdim4);
Expand Down

0 comments on commit a7e285b

Please sign in to comment.