Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/source_base/kernels/math_kernel_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct matrixTranspose_op<T, base_device::DEVICE_CPU>
T* temp = nullptr;
base_device::memory::resize_memory_op<T, base_device::DEVICE_CPU>()(temp, row * col, "MTransOp");
#ifdef _OPENMP
#pragma omp parallel for collapse(2) schedule(static, 8192 / sizeof(T))
#pragma omp parallel for collapse(2) schedule(static)
#endif
for (int j = 0; j < col; j++)
{
Expand All @@ -91,7 +91,7 @@ struct matrixTranspose_op<T, base_device::DEVICE_CPU>
}
}
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(T))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < row * col; i++)
{
Expand All @@ -107,7 +107,7 @@ struct matrixCopy<T, base_device::DEVICE_CPU>
void operator()(const int& n1, const int& n2, const T* A, const int& LDA, T* B, const int& LDB)
{
#ifdef _OPENMP
#pragma omp parallel for collapse(2) schedule(static, 8192 / sizeof(T))
#pragma omp parallel for collapse(2) schedule(static)
#endif
for (int i = 0; i < n1; i++)
{
Expand All @@ -130,7 +130,7 @@ struct matrix_mul_vector_op<T, base_device::DEVICE_CPU> {
T *c,
const int &ldc){
#ifdef _OPENMP
#pragma omp parallel for collapse(2) schedule(static, 8192 / sizeof(T))
#pragma omp parallel for collapse(2) schedule(static)
#endif
for (int j = 0; j < n; j++){
for (int i = 0; i < m; i++){
Expand Down
12 changes: 6 additions & 6 deletions source/source_base/kernels/math_kernel_op_vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct vector_mul_real_op<T, base_device::DEVICE_CPU>
void operator()(const int dim, T* result, const T* vector, const Real constant)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -42,7 +42,7 @@ struct vector_mul_vector_op<T, base_device::DEVICE_CPU>
if (add)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -52,7 +52,7 @@ struct vector_mul_vector_op<T, base_device::DEVICE_CPU>
else
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -69,7 +69,7 @@ struct vector_div_constant_op<T, base_device::DEVICE_CPU>
void operator()(const int& dim, T* result, const T* vector, const Real constant)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -85,7 +85,7 @@ struct vector_div_vector_op<T, base_device::DEVICE_CPU>
void operator()(const int& dim, T* result, const T* vector1, const Real* vector2)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand Down Expand Up @@ -121,7 +121,7 @@ struct vector_add_vector_op<T, base_device::DEVICE_CPU>
const Real constant2)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(T))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/module_device/memory_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct cast_memory_op<FPTYPE_out, FPTYPE_in, base_device::DEVICE_CPU, base_devic
const size_t size)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE_out))
#pragma omp parallel for schedule(static)
#endif
for (int ii = 0; ii < size; ii++)
{
Expand Down
12 changes: 6 additions & 6 deletions source/source_base/module_external/blas_connector_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void vector_mul_vector(const int& dim, T* result, const T* vector1, const T* vec
using Real = typename GetTypeReal<T>::type;
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -391,7 +391,7 @@ void vector_div_vector(const int& dim, T* result, const T* vector1, const T* vec
using Real = typename GetTypeReal<T>::type;
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(Real))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -412,7 +412,7 @@ void vector_add_vector(const int& dim, float *result, const float *vector1, cons
{
if (device_type == base_device::CpuDevice){
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(float))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -433,7 +433,7 @@ void vector_add_vector(const int& dim, double *result, const double *vector1, co
{
if (device_type == base_device::CpuDevice){
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(double))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -454,7 +454,7 @@ void vector_add_vector(const int& dim, std::complex<float> *result, const std::c
{
if (device_type == base_device::CpuDevice){
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(std::complex<float>))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand All @@ -475,7 +475,7 @@ void vector_add_vector(const int& dim, std::complex<double> *result, const std::
{
if (device_type == base_device::CpuDevice){
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 8192 / sizeof(std::complex<double>))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < dim; i++)
{
Expand Down
8 changes: 4 additions & 4 deletions source/source_base/module_mixing/broyden_mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void Broyden_Mixing::tem_push_data(Mixing_Data& mdata,
const size_t length = mdata.length;
std::vector<FPTYPE> F_tmp(length);
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand Down Expand Up @@ -72,7 +72,7 @@ void Broyden_Mixing::tem_push_data(Mixing_Data& mdata,
dF = malloc(sizeof(FPTYPE) * length * mixing_ndim);
FP_dF = static_cast<FPTYPE*>(dF);
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand All @@ -84,7 +84,7 @@ void Broyden_Mixing::tem_push_data(Mixing_Data& mdata,
this->ndim_cal_dF = std::min(this->ndim_cal_dF + 1, this->mixing_ndim);
start_dF = (this->start_dF + 1) % this->mixing_ndim;
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ void Broyden_Mixing::tem_cal_coef(const Mixing_Data& mdata, std::function<double

FPTYPE* dFnext = FP_dF + dFindex_move(1) * length;
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/module_mixing/mixing_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Mixing_Data
++this->ndim_history;
FPTYPE* FP_startdata = static_cast<FPTYPE*>(this->data) + this->start * this->length;
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096/sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (std::size_t i = 0; i < length; ++i)
{
Expand Down
8 changes: 4 additions & 4 deletions source/source_base/module_mixing/plain_mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void Plain_Mixing::tem_push_data(Mixing_Data& mdata,
const size_t length = mdata.length;
std::vector<FPTYPE> F_tmp(length);
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand Down Expand Up @@ -68,7 +68,7 @@ void Plain_Mixing::simple_mix(FPTYPE* data_new,
if (screen == nullptr)
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int ig = 0; ig < length; ig++)
{
Expand All @@ -79,15 +79,15 @@ void Plain_Mixing::simple_mix(FPTYPE* data_new,
{
std::vector<FPTYPE> F_tmp(length);
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
F_tmp[i] = data_out[i] - data_in[i];
}
screen(F_tmp.data());
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (int i = 0; i < length; ++i)
{
Expand Down
6 changes: 3 additions & 3 deletions source/source_base/module_mixing/pulay_mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
std::vector<FPTYPE> F_tmp(length);

#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (std::size_t i = 0; i < length; ++i)
{
Expand Down Expand Up @@ -67,7 +67,7 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
F = malloc(sizeof(FPTYPE) * length * mixing_ndim);
FP_F = static_cast<FPTYPE*>(F);
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (std::size_t i = 0; i < length; ++i)
{
Expand All @@ -79,7 +79,7 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
start_F = (this->start_F + 1) % this->mixing_ndim;
FPTYPE* FP_startF = FP_F + start_F * length;
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
#pragma omp parallel for schedule(static)
#endif
for (std::size_t i = 0; i < length; ++i)
{
Expand Down
4 changes: 2 additions & 2 deletions source/source_basis/module_pw/pw_gatherscatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void PW_Basis::gathers_scatterp(std::complex<T>* in, std::complex<T>* out) const
if(this->poolnproc == 1) //In this case nrxx=fftnx*fftny*nz, nst = nstot,
{
#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096/sizeof(T))
#pragma omp parallel for schedule(static)
#endif
for(int i = 0; i < this->nrxx; ++i)
{
Expand Down Expand Up @@ -160,7 +160,7 @@ void PW_Basis::gathers_scatterp(std::complex<T>* in, std::complex<T>* out) const
}

#ifdef _OPENMP
#pragma omp parallel for schedule(static, 4096/sizeof(T))
#pragma omp parallel for schedule(static)
#endif
for(int i = 0; i < this->nrxx; ++i)
{
Expand Down
Loading
Loading