Skip to content
Open
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
22 changes: 18 additions & 4 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [System variables](#system-variables)
- [suffix](#suffix)
- [ntype](#ntype)
- [cell\_replica](#cell_replica)
- [calculation](#calculation)
- [esolver\_type](#esolver_type)
- [symmetry](#symmetry)
Expand Down Expand Up @@ -354,6 +355,7 @@
- [md\_restart](#md_restart)
- [md\_restartfreq](#md_restartfreq)
- [md\_dumpfreq](#md_dumpfreq)
- [md\_out\_force](#md_out_force)
- [dump\_force](#dump_force)
- [dump\_vel](#dump_vel)
- [dump\_virial](#dump_virial)
Expand Down Expand Up @@ -580,6 +582,12 @@
- **Description**: Number of different atom species in the calculation.
- **Default**: 0

### cell_replica

- **Type**: Three Integers
- **Description**: Replicate the input STRU by Na, Nb, and Nc along its lattice vectors for distributed MDCell workflows. The default is 1 1 1, which preserves the input structure.
- **Default**: 1 1 1

### calculation

- **Type**: String
Expand Down Expand Up @@ -3447,15 +3455,21 @@
### md_restartfreq

- **Type**: Integer
- **Description**: The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail.
- **Description**: The output frequency of OUT.{suffix}/STRU_MD_*, which are used to restart molecular dynamics calculations, see md_restart in detail. Set to 0 to disable MD restart output.
- **Default**: 5

### md_dumpfreq

- **Type**: Integer
- **Description**: The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms.
- **Description**: The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which includes lattice and atomic information. Set to 0 to disable MD_dump output; scalar MD progress remains printed to the terminal and running_md.log every step.
- **Default**: 1

### md_out_force

- **Type**: Boolean
- **Description**: Whether to output the TOTAL-FORCE table in OUT.${suffix}/running_md.log for MDCell molecular dynamics. This does not affect force calculation or molecular dynamics integration.
- **Default**: True

### dump_force

- **Type**: Boolean
Expand All @@ -3478,8 +3492,8 @@

- **Type**: Integer
- **Description**: The random seed to initialize random numbers used in molecular dynamics calculations.
- < 0: No srand() function is called.
- >= 0: The function srand(md_seed) is called.
- < 0: Each MPI rank uses the default seed 1 plus its rank.
- >= 0: Each MPI rank uses md_seed plus its rank.
- **Default**: -1

### md_tfreq
Expand Down
24 changes: 20 additions & 4 deletions docs/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ parameters:
default_value: "0"
unit: ""
availability: ""
- name: cell_replica
category: System variables
type: Three Integers
description: |
Replicate the input STRU by Na, Nb, and Nc along its lattice vectors for distributed MDCell workflows. The default is 1 1 1, which preserves the input structure.
default_value: "1 1 1"
unit: ""
availability: ""
- name: calculation
category: System variables
type: String
Expand Down Expand Up @@ -1435,18 +1443,26 @@ parameters:
category: Molecular dynamics
type: Integer
description: |
The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail.
The output frequency of OUT.{suffix}/STRU_MD_*, which are used to restart molecular dynamics calculations, see md_restart in detail. Set to 0 to disable MD restart output.
default_value: "5"
unit: ""
availability: ""
- name: md_dumpfreq
category: Molecular dynamics
type: Integer
description: |
The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms.
The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which includes lattice and atomic information. Set to 0 to disable MD_dump output; scalar MD progress remains printed to the terminal and running_md.log every step.
default_value: "1"
unit: ""
availability: ""
- name: md_out_force
category: Molecular dynamics
type: Boolean
description: |
Whether to output the TOTAL-FORCE table in OUT.${suffix}/running_md.log for MDCell molecular dynamics. This does not affect force calculation or molecular dynamics integration.
default_value: "True"
unit: ""
availability: ""
- name: dump_force
category: Molecular dynamics
type: Boolean
Expand Down Expand Up @@ -1476,8 +1492,8 @@ parameters:
type: Integer
description: |
The random seed to initialize random numbers used in molecular dynamics calculations.
* < 0: No srand() function is called.
* >= 0: The function srand(md_seed) is called.
* < 0: Each MPI rank uses the default seed 1 plus its rank.
* >= 0: Each MPI rank uses md_seed plus its rank.
default_value: "-1"
unit: ""
availability: ""
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ add_library(
tool_title.cpp
ylm.cpp
parallel_common.cpp
communication_domain.cpp
parallel_cell.cpp
parallel_global.cpp
parallel_comm.cpp
parallel_reduce.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source_base/communication_domain.h"
#include "source_base/parallel_cell.h"

namespace ModuleBase
{
Expand All @@ -12,7 +12,6 @@ CommunicationDomain::CommunicationDomain(MPI_Comm communicator) : communicator_(
if (communicator_ != MPI_COMM_NULL)
{
MPI_Comm_rank(communicator_, &rank_);
MPI_Comm_size(communicator_, &size_);
}
}

Expand All @@ -27,11 +26,6 @@ int CommunicationDomain::rank() const
return rank_;
}

int CommunicationDomain::size() const
{
return size_;
}

CommunicationDomain world_communication_domain()
{
#ifdef __MPI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef COMMUNICATION_DOMAIN_H
#define COMMUNICATION_DOMAIN_H
#ifndef PARALLEL_CELL_H
#define PARALLEL_CELL_H

#ifdef __MPI
#include <mpi.h>
Expand All @@ -16,14 +16,12 @@ class CommunicationDomain
MPI_Comm communicator() const;
#endif
int rank() const;
int size() const;

private:
#ifdef __MPI
MPI_Comm communicator_ = MPI_COMM_NULL;
#endif
int rank_ = 0;
int size_ = 1;
};

CommunicationDomain world_communication_domain();
Expand Down
6 changes: 4 additions & 2 deletions source/source_cell/base_cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "source_base/matrix3.h"

#include <cstdint>

class BaseCell
{
public:
Expand All @@ -19,7 +21,7 @@ class BaseCell
return get_kind();
}

int nat() const
std::int64_t nat() const
{
return get_nat();
}
Expand Down Expand Up @@ -48,7 +50,7 @@ class BaseCell

private:
virtual Kind get_kind() const = 0;
virtual int get_nat() const = 0;
virtual std::int64_t get_nat() const = 0;
virtual double get_lat0() const = 0;
virtual double get_omega() const = 0;
virtual const ModuleBase::Matrix3& get_latvec() const = 0;
Expand Down
Loading
Loading