Skip to content

Commit d1aa8cd

Browse files
committed
change function name to involve omp info
1 parent 5bdcef8 commit d1aa8cd

File tree

12 files changed

+20
-15
lines changed

12 files changed

+20
-15
lines changed

source/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ int main(int argc, char** argv)
2828
int nproc = 1;
2929
int my_rank = 0;
3030
int nthread_per_proc = 1;
31-
Parallel_Global::read_mpi_parameters(argc, argv, nproc, nthread_per_proc, my_rank);
31+
Parallel_Global::read_pal_param(argc, argv, nproc, nthread_per_proc, my_rank);
3232
#ifdef _OPENMP
3333
// ref: https://www.fftw.org/fftw3_doc/Usage-of-Multi_002dthreaded-FFTW.html
3434
fftw_init_threads();
3535
fftw_plan_with_nthreads(omp_get_max_threads());
3636
#endif
37-
PARAM.set_rank_nproc(my_rank, nproc, nthread_per_proc);
37+
PARAM.set_pal_param(my_rank, nproc, nthread_per_proc);
3838

3939
/*
4040
main program for doing electronic structure calculations.

source/module_base/parallel_global.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ void Parallel_Global::split_grid_world(const int diag_np, const int& nproc, cons
8787
return;
8888
}
8989

90-
void Parallel_Global::read_mpi_parameters(int argc,
90+
// changed from read_mpi_parameters in 2024-1018
91+
void Parallel_Global::read_pal_param(int argc,
9192
char** argv,
9293
int& NPROC,
9394
int& NTHREAD_PER_PROC,
@@ -158,7 +159,7 @@ void Parallel_Global::read_mpi_parameters(int argc,
158159
{
159160
// usage of WARNING_QUIT need module_base/tool_quit.cpp
160161
// lead to undefined error in unit_test building
161-
// ModuleBase::WARNING_QUIT( "Parallel_Global::read_mpi_parameters","OMP_NUM_THREADS setting is invalid. Please set it to a proper value.");
162+
// ModuleBase::WARNING_QUIT( "Parallel_Global::read_pal_param","OMP_NUM_THREADS setting is invalid. Please set it to a proper value.");
162163
std::cerr << "ERROR: OMP_NUM_THREADS setting is invalid. Please set it to a proper value." << std::endl;
163164
exit(1);
164165
}

source/module_base/parallel_global.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ extern int omp_number;
1818
//---------------------------
1919
// call at the very first.
2020
//---------------------------
21-
void read_mpi_parameters(int argc, char** argv, int& NPROC, int& NTHREAD_PER_PROC, int& MY_RANK);
21+
22+
// changed from read_mpi_parameters in 2024-1018
23+
void read_pal_param(int argc, char** argv, int& NPROC, int& NTHREAD_PER_PROC, int& MY_RANK);
2224
#ifdef __MPI
2325
void myProd(std::complex<double>* in, std::complex<double>* inout, int* len, MPI_Datatype* dptr);
2426
#endif

source/module_cell/module_symmetry/run_symmetry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
1414
std::cout << "Hello, this is the 'symmetry' module of ABACUS." << std::endl;
1515

1616
std::cout << "The module does symmetry analysis for an input geometry." << std::endl;
17-
Parallel_Global::read_mpi_parameters(argc,argv);
17+
Parallel_Global::read_pal_param(argc,argv);
1818
//std::cout << "Right now, the module is still empty, soon we will have more tests." << std::endl;
1919

2020
calculate();

source/module_parameter/parameter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Parameter PARAM;
44

5-
void Parameter::set_rank_nproc(const int& myrank, const int& nproc, const int& nthread_per_proc)
5+
// changed from set_rank_nproc in 2024-1018
6+
void Parameter::set_pal_param(const int& myrank, const int& nproc, const int& nthread_per_proc)
67
{
78
sys.myrank = myrank;
89
sys.nproc = nproc;

source/module_parameter/parameter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ class Parameter
2727
// We can only read the value of globalv parameters, but cannot modify it.
2828
const System_para& globalv = sys;
2929

30-
// Set the rank & nproc
31-
void set_rank_nproc(const int& myrank, const int& nproc, const int& nthread_per_proc);
30+
// Set the rank & nproc & nthreads_per_proc
31+
// changed from set_rank_nproc in 2024-1018
32+
void set_pal_param(const int& myrank, const int& nproc, const int& nthread_per_proc);
3233
// Set the start time
3334
void set_start_time(const std::time_t& start_time);
3435

tools/SIAB/SimulatedAnnealing/backup_old_version/1_Source/src_parallel/parallel_global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void Parallel_Global::myProd(complex<double> *in,complex<double> *inout,int *len
2727
}
2828
#endif
2929

30-
void Parallel_Global::read_mpi_parameters(int argc,char **argv)
30+
void Parallel_Global::read_pal_param(int argc,char **argv)
3131
{
3232
#if defined __MPI
3333
//for test

tools/SIAB/SimulatedAnnealing/backup_old_version/1_Source/src_parallel/parallel_global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern MPI_Comm POOL_WORLD;
1818

1919
namespace Parallel_Global
2020
{
21-
void read_mpi_parameters(int argc, char **argv);
21+
void read_pal_param(int argc, char **argv);
2222

2323
#ifdef __MPI
2424
void myProd(complex<double> *in,complex<double> *inout,int *len,MPI_Datatype *dptr);

tools/SIAB/SimulatedAnnealing/backup_old_version/1_Source/src_spillage/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
1919

2020
// (2) if parallel, prepare.
2121
cout << " First read in the parameters from INPUT." << endl;
22-
Parallel_Global::read_mpi_parameters(argc,argv);
22+
Parallel_Global::read_pal_param(argc,argv);
2323

2424
// (2) init class input.
2525
input.init();

tools/SIAB/SimulatedAnnealing/source/src_parallel/parallel_global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void Parallel_Global::myProd(complex<double> *in,complex<double> *inout,int *len
2525
}
2626
#endif
2727

28-
void Parallel_Global::read_mpi_parameters(int argc,char **argv)
28+
void Parallel_Global::read_pal_param(int argc,char **argv)
2929
{
3030
#if defined __MPI
3131
//for test

0 commit comments

Comments
 (0)