Skip to content

Commit e76c1a4

Browse files
committed
delete -march-native in Makefile.gnu or else we can not use valgrind
1 parent f3c9691 commit e76c1a4

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

source/module_pw/pw_gatherscatter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void PW_Basis:: gatherp_scatters(complex<double> *in, complex<double> *out)
2323
return;
2424
}
2525
#ifdef __MPI
26-
std::complex<double> * tmp;
26+
std::complex<double> * tmp = NULL;
2727
if(this->poolrank == 0) tmp = new std::complex<double> [this->nz * this->nstot];
2828

2929
//gather planes of different processors
@@ -40,7 +40,7 @@ void PW_Basis:: gatherp_scatters(complex<double> *in, complex<double> *out)
4040
MPI_Scatterv(tmp, this->nstnz_per, this->startnsz_per,mpicomplex,out,
4141
this->nstnz,mpicomplex,0, POOL_WORLD);
4242

43-
if(this->poolrank == 0) delete[] tmp;
43+
if(tmp!=NULL) delete[] tmp;
4444
#endif
4545
return;
4646
}
@@ -107,7 +107,7 @@ void PW_Basis:: gathers_scatterp(complex<double> *in, complex<double> *out)
107107
}
108108
#ifdef __MPI
109109
if(this->poolnproc == 1) return;
110-
std::complex<double> * tmp;
110+
std::complex<double> * tmp = NULL;
111111
if(this->poolrank == 0) tmp = new std::complex<double> [this->nz * this->nstot];
112112

113113
//scatter sticks to different processors
@@ -121,7 +121,7 @@ void PW_Basis:: gathers_scatterp(complex<double> *in, complex<double> *out)
121121
MPI_Scatterv(&tmp[istot*this->nz], this->numz,this->startz, mpicomplex, &out[ixy*this->nplane],
122122
this->nplane,mpicomplex,0,POOL_WORLD);
123123
}
124-
if(this->poolrank == 0) delete[] tmp;
124+
if(tmp!=NULL) delete[] tmp;
125125
#endif
126126
return;
127127
}

source/module_pw/unittest/Makefile.gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ FFTW_LIB = -L${FFTW_LIB_DIR} -lfftw3 -Wl,-rpath=${FFTW_LIB_DIR}
6969
# CUDA_LIB = -L${CUDA_LIB_DIR} -lcufft -lcublas -lcudart
7070

7171
LIBS = ${FFTW_LIB} ${CUDA_LIB}
72-
OPTS = -I${FFTW_INCLUDE_DIR} ${HONG} -Ofast -march=native -std=c++11 -Wall -g
72+
OPTS = -I${FFTW_INCLUDE_DIR} ${HONG} -Ofast -std=c++11 -Wall -g
7373
#==========================
7474
# MAKING OPTIONS
7575
#==========================

source/module_pw/unittest/test2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main(int argc,char **argv)
5555
GT = latvec.Inverse();
5656
G = GT.Transpose();
5757
GGT = G * GT;
58-
complex<double> *tmp;
58+
complex<double> *tmp = NULL;
5959
if(myrank == 0)
6060
{
6161
tmp = new complex<double> [nx*ny*nz];
@@ -157,6 +157,6 @@ int main(int argc,char **argv)
157157
MPI_Barrier(MPI_COMM_WORLD);
158158
delete [] rhog;
159159
delete [] rhor;
160-
if(myrank == 0) delete [] tmp;
160+
if(tmp!=NULL) delete []tmp;
161161
return 0;
162162
}

source/module_pw/unittest/test3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main(int argc,char **argv)
5555
GT = latvec.Inverse();
5656
G = GT.Transpose();
5757
GGT = G * GT;
58-
complex<double> *tmp;
58+
complex<double> *tmp = NULL;
5959
if(myrank == 0)
6060
{
6161
tmp = new complex<double> [nx*ny*nz];
@@ -155,6 +155,6 @@ int main(int argc,char **argv)
155155
MPI_Barrier(MPI_COMM_WORLD);
156156
delete [] rhog;
157157
delete [] rhor;
158-
if(myrank == 0) delete [] tmp;
158+
if(tmp!=NULL) delete []tmp;
159159
return 0;
160160
}

0 commit comments

Comments
 (0)