Skip to content

Commit 2f22241

Browse files
committed
remove the seed option
1 parent acde430 commit 2f22241

File tree

7 files changed

+12
-33
lines changed

7 files changed

+12
-33
lines changed

doc/gpumd/input_parameters/ensemble_qtb.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ Syntax
2222

2323
Run an NVT simulation with the QTB thermostat::
2424

25-
ensemble nvt_qtb <T_1> <T_2> <T_coup> [f_max <value>] [N_f <value>] [seed <value>]
25+
ensemble nvt_qtb <T_1> <T_2> <T_coup> [f_max <value>] [N_f <value>]
2626

2727
* :attr:`<T_1>` and :attr:`<T_2>`: Initial and final target temperature (K). The target temperature varies linearly during the run.
2828
* :attr:`<T_coup>`: Thermostat coupling parameter (in units of timestep). Controls the friction coefficient: :math:`\gamma = 1 / (\text{T\_coup} \times dt)`.
2929
* :attr:`f_max`: (Optional, default 200) Maximum frequency of the QTB filter in ps\ :sup:`-1`. Should be larger than the highest phonon frequency in the system.
3030
* :attr:`N_f`: (Optional, default 100) Number of frequency points in the filter. The filter uses :math:`2 N_f` points total.
31-
* :attr:`seed`: (Optional, default 880302) Random number seed for the colored noise generator.
3231

3332
:attr:`npt_qtb`
3433
^^^^^^^^^^^^^^^
3534

3635
Run an NPT simulation with the QTB thermostat and Parrinello-Rahman (MTTK) barostat::
3736

38-
ensemble npt_qtb <direction> <p_1> <p_2> temp <T_1> <T_2> tperiod <tau_T> pperiod <tau_p> [f_max <value>] [N_f <value>] [seed <value>]
37+
ensemble npt_qtb <direction> <p_1> <p_2> temp <T_1> <T_2> tperiod <tau_T> pperiod <tau_p> [f_max <value>] [N_f <value>]
3938

4039
Pressure control parameters:
4140

@@ -52,7 +51,6 @@ QTB-specific optional parameters (same as :attr:`nvt_qtb`):
5251

5352
* :attr:`f_max`: Maximum frequency (ps\ :sup:`-1`, default 200).
5453
* :attr:`N_f`: Number of frequency points (default 100).
55-
* :attr:`seed`: Random seed (default 880302).
5654

5755

5856
Examples
@@ -84,7 +82,7 @@ Run at 300 K and 0 GPa with isotropic pressure control.
8482

8583
.. code-block:: rst
8684
87-
ensemble npt_qtb aniso 0 0 temp 300 300 tperiod 100 pperiod 1000 f_max 200 N_f 100 seed 12345
85+
ensemble npt_qtb aniso 0 0 temp 300 300 tperiod 100 pperiod 1000 f_max 200 N_f 100
8886
8987
Anisotropic pressure control with explicit QTB parameters.
9088

src/integrate/ensemble_npt_qtb.cu

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ Ensemble_NPT_QTB::Ensemble_NPT_QTB(const char** params, int num_params)
118118
// QTB defaults
119119
qtb_f_max = 200.0;
120120
int qtb_n_f_input = 100;
121-
qtb_seed = 880302;
122121

123122
// Parse parameters: npt_qtb <pressure_args> temp <T1> <T2> tperiod <tp> [f_max ...] [N_f ...] [seed ...]
124123
int i = 2; // skip "ensemble" and "npt_qtb"
@@ -190,10 +189,6 @@ Ensemble_NPT_QTB::Ensemble_NPT_QTB(const char** params, int num_params)
190189
if (!is_valid_int(params[i + 1], &qtb_n_f_input)) PRINT_INPUT_ERROR("N_f should be an integer.");
191190
if (qtb_n_f_input <= 0) PRINT_INPUT_ERROR("N_f should > 0.");
192191
i += 2;
193-
} else if (strcmp(params[i], "seed") == 0) {
194-
if (i + 1 >= num_params) PRINT_INPUT_ERROR("seed requires a value.");
195-
if (!is_valid_int(params[i + 1], &qtb_seed)) PRINT_INPUT_ERROR("seed should be an integer.");
196-
i += 2;
197192
} else {
198193
PRINT_INPUT_ERROR("Unknown npt_qtb keyword.");
199194
}
@@ -211,7 +206,7 @@ Ensemble_NPT_QTB::Ensemble_NPT_QTB(const char** params, int num_params)
211206
printf(" Parrinello-Rahman barostat + quantum thermal bath thermostat.\n");
212207
printf(" QTB temperature: t_start=%g K, t_stop=%g K\n", t_start, t_stop);
213208
printf(" QTB tperiod=%g timesteps\n", t_period);
214-
printf(" QTB f_max=%g ps^-1, N_f=%d, seed=%d\n", qtb_f_max, qtb_N_f, qtb_seed);
209+
printf(" QTB f_max=%g ps^-1, N_f=%d\n", qtb_f_max, qtb_N_f);
215210

216211
const char* sc[3][3] = {{"xx","xy","xz"},{"yx","yy","yz"},{"zx","zy","zz"}};
217212
for (int a = 0; a < 3; a++)
@@ -258,7 +253,7 @@ void Ensemble_NPT_QTB::init_qtb()
258253

259254
qtb_curand_states.resize(qtb_number_of_atoms);
260255
initialize_curand_states<<<(qtb_number_of_atoms - 1) / 128 + 1, 128>>>(
261-
qtb_curand_states.data(), qtb_number_of_atoms, qtb_seed);
256+
qtb_curand_states.data(), qtb_number_of_atoms, rand());
262257
GPU_CHECK_KERNEL
263258

264259
gpu_initialize_qtb_history<<<(qtb_number_of_atoms - 1) / 128 + 1, 128>>>(

src/integrate/ensemble_npt_qtb.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public:
4646

4747
private:
4848
int qtb_number_of_atoms;
49-
int qtb_seed;
5049
int qtb_N_f;
5150
int qtb_nfreq2;
5251
int qtb_alpha;

src/integrate/ensemble_qtb.cu

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,12 @@ static __global__ void gpu_apply_qtb_half_step(
122122
// PLACEHOLDER_METHODS
123123

124124
void Ensemble_QTB::init_qtb_common(
125-
int N, double T, double Tc, double dt_input, double f_max_input, int N_f_input, int seed_input)
125+
int N, double T, double Tc, double dt_input, double f_max_input, int N_f_input)
126126
{
127127
number_of_atoms = N;
128128
temperature = T;
129129
temperature_coupling = Tc;
130130
dt = dt_input;
131-
seed = seed_input;
132131
N_f = N_f_input;
133132
nfreq2 = 2 * N_f;
134133

@@ -156,7 +155,7 @@ void Ensemble_QTB::init_qtb_common(
156155

157156
curand_states.resize(number_of_atoms);
158157
initialize_curand_states<<<(number_of_atoms - 1) / 128 + 1, 128>>>(
159-
curand_states.data(), number_of_atoms, seed);
158+
curand_states.data(), number_of_atoms, rand());
160159
GPU_CHECK_KERNEL
161160

162161
gpu_initialize_qtb_history<<<(number_of_atoms - 1) / 128 + 1, 128>>>(
@@ -171,11 +170,11 @@ void Ensemble_QTB::init_qtb_common(
171170

172171
// NVT-QTB constructor
173172
Ensemble_QTB::Ensemble_QTB(
174-
int t, int N, double T, double Tc, double dt_input, double f_max, int N_f, int seed)
173+
int t, int N, double T, double Tc, double dt_input, double f_max, int N_f)
175174
{
176175
type = t;
177176
num_target_pressure_components = 0;
178-
init_qtb_common(N, T, Tc, dt_input, f_max, N_f, seed);
177+
init_qtb_common(N, T, Tc, dt_input, f_max, N_f);
179178
}
180179

181180
Ensemble_QTB::~Ensemble_QTB(void)

src/integrate/ensemble_qtb.cuh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Ensemble_QTB : public Ensemble
2828
{
2929
public:
3030
// NVT-QTB constructor
31-
Ensemble_QTB(int t, int N, double T, double Tc, double dt, double f_max, int N_f, int seed);
31+
Ensemble_QTB(int t, int N, double T, double Tc, double dt, double f_max, int N_f);
3232

3333
~Ensemble_QTB(void);
3434

@@ -48,7 +48,6 @@ public:
4848

4949
private:
5050
int number_of_atoms;
51-
int seed;
5251
int N_f;
5352
int nfreq2;
5453
int alpha;
@@ -68,7 +67,7 @@ private:
6867
GPU_Vector<double> fran;
6968
GPU_Vector<gpurandState> curand_states;
7069

71-
void init_qtb_common(int N, double T, double Tc, double dt_input, double f_max_input, int N_f_input, int seed_input);
70+
void init_qtb_common(int N, double T, double Tc, double dt_input, double f_max_input, int N_f_input);
7271
void update_time_filter(const double target_temperature);
7372
void refresh_colored_random_force();
7473
void apply_qtb_half_step();

src/integrate/integrate.cu

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ void Integrate::initialize(
108108
temperature_coupling,
109109
time_step,
110110
qtb_f_max,
111-
qtb_n_f,
112-
qtb_seed));
111+
qtb_n_f));
113112
break;
114113
case 11: // NPT-Berendsen
115114
ensemble.reset(new Ensemble_BER(
@@ -362,7 +361,6 @@ void Integrate::parse_ensemble(
362361
{
363362
qtb_f_max = 200.0;
364363
qtb_n_f = 100;
365-
qtb_seed = 880302;
366364

367365
// 1. Determine the integration method
368366
if (strcmp(param[1], "nve") == 0) {
@@ -544,13 +542,6 @@ void Integrate::parse_ensemble(
544542
if (qtb_n_f <= 0) {
545543
PRINT_INPUT_ERROR("N_f should > 0.");
546544
}
547-
} else if (strcmp(param[i], "seed") == 0) {
548-
if (!is_valid_int(param[i + 1], &qtb_seed)) {
549-
PRINT_INPUT_ERROR("seed should be an integer.");
550-
}
551-
if (qtb_seed <= 0) {
552-
PRINT_INPUT_ERROR("seed should > 0.");
553-
}
554545
} else {
555546
PRINT_INPUT_ERROR("Unknown nvt_qtb optional keyword.");
556547
}
@@ -871,7 +862,6 @@ void Integrate::parse_ensemble(
871862
printf(" tau_T is %g time_step.\n", temperature_coupling);
872863
printf(" f_max is %g ps^-1.\n", qtb_f_max);
873864
printf(" N_f is %d.\n", qtb_n_f);
874-
printf(" seed is %d.\n", qtb_seed);
875865
break;
876866
case 11:
877867
if (temperature_coupling <= 100000) {

src/integrate/integrate.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public:
8787
double temperature_coupling;
8888
double qtb_f_max = 200.0; // in ps^-1
8989
int qtb_n_f = 100;
90-
int qtb_seed = 880302;
9190
double tau_p;
9291
double elastic_modulus[6];
9392
double pressure_coupling[6];

0 commit comments

Comments
 (0)