Skip to content

Commit 783e207

Browse files
committed
change nthreads variables to PARAM.globalv.nthread_per_proc
1 parent 5d635e7 commit 783e207

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

source/module_base/global_variable.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace GlobalV
1717
//----------------------------------------------------------
1818

1919
int NPROC = 1; ///< global number of process
20-
int NTHREAD_PER_PROC = 1; ///< global number of thread per process
2120
int KPAR = 1; ///< global number of pools
2221
int KPAR_LCAO = 1; ///< global number of pools for LCAO diagonalization only
2322
int MY_RANK = 0; ///< global index of process

source/module_base/global_variable.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace GlobalV
1717
// EXPLAIN : Parallel information
1818
// GLOBAL VARIABLES :
1919
// NAME : NPROC( global number of process )
20-
// NAME : NTHREAD_PER_PROC ( global number of threads per process )
2120
// NAME : KPAR( global number of pools )
2221
// NAME : MY_RANK( global index of process )
2322
// NAME : MY_POOL( global index of pool (count in pool))
@@ -32,7 +31,6 @@ namespace GlobalV
3231
// NAME : KPAR_LCAO ( global number of pools for LCAO diagonalization only)
3332
//========================================================================
3433
extern int NPROC;
35-
extern int NTHREAD_PER_PROC;
3634
extern int KPAR;
3735
extern int MY_RANK;
3836
extern int MY_POOL;

source/module_base/parallel_global.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AUTHOR : fangwei, mohan
33
// DATE : 2009-11-08
44
//==========================================================
5-
#include "parallel_global.h"
5+
// #include "parallel_global.h"
66

77
#ifdef __MPI
88
#include <mpi.h>
@@ -14,6 +14,7 @@
1414
#include "module_base/global_function.h"
1515
#include "module_base/parallel_common.h"
1616
#include "module_base/parallel_reduce.h"
17+
#include "module_parameter/parameter.h"
1718
#include "version.h"
1819

1920
#include <iostream>
@@ -139,7 +140,7 @@ void Parallel_Global::read_mpi_parameters(int argc, char** argv, int& NPROC, int
139140
#endif
140141
mpi_number = process_num;
141142
omp_number = current_thread_num;
142-
GlobalV::NTHREAD_PER_PROC = current_thread_num;
143+
PARAM.globalv.nthread_per_proc = current_thread_num;
143144
if (current_thread_num * process_num > max_thread_num && local_rank == 0)
144145
{
145146
std::stringstream mess;

source/module_io/print_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void setup_parameters(UnitCell& ucell, K_Vectors& kv)
9191
}
9292

9393
std::cout << std::setw(12) << GlobalV::NPROC
94-
<< std::setw(12) << GlobalV::NTHREAD_PER_PROC * GlobalV::NPROC;
94+
<< std::setw(12) << PARAM.globalv.nthread_per_proc * GlobalV::NPROC;
9595
if (orbinfo) { std::cout << std::setw(12) << PARAM.globalv.nlocal; }
9696

9797
std::cout << std::endl;

source/module_parameter/system_parameter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct System_para
1010
// ---------------------------------------------------------------
1111
int myrank = 0;
1212
int nproc = 1;
13+
int nthread_per_proc = 1;
1314
int mypool = 0;
1415
int npool = 1;
1516
int nproc_in_pool = 1;

0 commit comments

Comments
 (0)