2. Getting Started¶
このセクションでは、新規ユーザーと経験豊富 なユーザーの両方にLIGGGHTS(R)-PUBLICをビルドして実行する方法について説明します。
This section describes how to build and run LIGGGHTS(R)-PUBLIC, for both new and experienced users.
2.1. How to obtain LIGGGHTS(R)-PUBLIC¶
gitを使用して LIGGGHTS(R)-PUBLICパッケージをダウンロードすることをお勧めします。 ご使用のシステムでgitコマンドが使用可能であることを確認してください。 Ubuntu / Debianのボックスでこれは
We recommend to use git to download the LIGGGHTS(R)-PUBLIC package. Make sure that the git command is available on your system. On a Ubuntu/Debian box this can be achieved by
sudo apt-get install git
Note
LIGGGHTS-
PREMIUMバージョンのユーザーは、下に示すLIGGGHTS-PUBLIC文字列をそれぞれのバージョン文字
列で置き換える必要があります。 この文字列は、
"(R)"のないLIGGGHTS(R)-PUBLICと等価です。
Users of a LIGGGHTS-PREMIUM version will need to replace the LIGGGHTS-PUBLIC strings shown below by their respective version string. This string is equal to LIGGGHTS(R)-PUBLIC without the “(R)”.
LIGGGHTS(R)-PUBLICを ダウンロードするには、次のように入力します。
LIGGGHTS(R)-PUBLIC can then be downloaded by typing
git clone git@github.com:CFDEMproject/LIGGGHTS-PUBLIC.git
特定の状況(会社のファイアウォールな ど)では、これが失敗する可能性があります。代わりに下記を使用してください。
Under certain circumstances (e.g. company firewall) this might fail and instead you can use
git clone https://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git
これらの2つのコマンドのいずれかを使用 する利点は、
to obtain LIGGGHTS(R)-PUBLIC. The advantage of using one of these two commands is that you can use
git pull
新しいバージョンをリリースするときに、
最新バージョンのコードを簡単に取得できます。
このコマンドはLIGGGHTS-PUBLICフォルダで実行する必要があることに注意してください。
クローンコマンドのどれも動作しない場合は、gitを使わなくてもここでパッケージをダウンロードできます。
この場合、git pullは機能しません。代わりに完全なzipファイルを再度ダウンロードする必要があります。
LIGGGHTS-PUBLICディレクトリには、2つのファイルと複数のディレクトリがあります。
to easily fetch the latest version of the code when we release a new version. Note that this command needs to be executed in your LIGGGHTS-PUBLIC folder.
If none of the clone commands work you can download the package here without having to use git. Note that git pull will not work in this case, instead you will have to download the full zip file again.
The LIGGGHTS-PUBLIC directory contains two files and several directories:
| README | text file |
| LICENSE | the GNU General Public License (GPL) |
| doc | documentation |
| examples | simple test problems |
| lib | libraries LIGGGHTS(R)-PUBLIC can be linked with |
| python | Python wrapper on LIGGGHTS(R)-PUBLIC as a library |
| src | source files |
2.2. Making LIGGGHTS(R)-PUBLIC¶
This section has the following sub-sections:
- Read this first
- Steps to build a LIGGGHTS(R)-PUBLIC executable
- Advanced building using custom makefiles
- Common errors that can occur when making LIGGGHTS(R)-PUBLIC
- Additional build tips
- Building for a Mac
- Building for Windows
2.2.1. Read this first:¶
LIGGGHTS(R)-
PUBLICをビルドするのは簡単ではありません。
makefileを編集する必要があるかもしれません、考慮するコンパイラオプションがあり、追加のライブラリ(MPI、FFT、JPEG、PNG)を使うことができ、
LIGGGHTS(R)-PUBLICパッケージをincludeしたりexcludeしたりすることができます。
これらのパッケージの中には、事前ビルドなどが必要な補助ライブラリを使用するものがあります。
このセクションをよくお読みください。あなたがMakefileやUnixプラットフォームのコードを作成したり、
マシン上でMPIジョブを実行したりするのに慣れていない場合は、ローカルの専門家を探して手伝ってもらってくださ
い。
多くのコンパイル、リンク、および実行の問題は、LIGGGHTS(R)-PUBLICの問題ではなく、ユーザのシステム、コンパイラ、ライブラリなどに特有の問題です。
そのような質問は、ローカルの専門家が良い答えをくれます。
ビルド問題に対してLIGGGHTS(R)-PUBLICの問題だと確信がある場合は、(例えば、コンパイラが
LIGGGHTS(R)-PUBLICソース
コードの行について苦情を立てるなど)、LIGGGHTS(R)パブリックフォー ラムに投稿ください。
src /
MAKEディレクトリに似たMakefileがない新しい種類のマシンにLIGGGHTS(R)-PUBLICをビルドするのに成功した場合は、それを開発者に送ってくだ
さい。LIGGGHTS(R
)-PUBLICディストリビューションにincludeします。特に、私たちはMakefile.autoがうまくいかない場合のために、その性能を向上させることに興
味があり ます。
Building LIGGGHTS(R)-PUBLIC can be non-trivial. You may need to edit a makefile, there are compiler options to consider, additional libraries can be used (MPI, FFT, JPEG, PNG), LIGGGHTS(R)-PUBLIC packages may be included or excluded, some of these packages use auxiliary libraries which need to be pre-built, etc.
Please read this section carefully. If you are not comfortable with makefiles, or building codes on a Unix platform, or running an MPI job on your machine, please find a local expert to help you. Many compiling, linking, and run problems that users have are often not LIGGGHTS(R)-PUBLIC issues - they are peculiar to the user’s system, compilers, libraries, etc. Such questions are better answered by a local expert.
If you have a build problem that you are convinced is a LIGGGHTS(R)-PUBLIC issue (e.g. the compiler complains about a line of LIGGGHTS(R)-PUBLIC source code), then please post a question to the LIGGGHTS(R)-PUBLIC forum.
If you succeed in building LIGGGHTS(R)-PUBLIC on a new kind of machine, for which there isn’t a similar Makefile for in the src/MAKE directory, send it to the developers and we can include it in the LIGGGHTS(R)-PUBLIC distribution. In particular, we are interested in cases where Makefile.auto does not work, so that we can improve its performance.
2.2.2. Steps to build a LIGGGHTS(R)-PUBLIC executable:¶
LIGGGHTSバージョン
3.5.1では、LIGGGHTSのビルドを可能な限りシンプルにするために、うまくいけば、すべて新しい魔法の
Makefile.autoを公開しました。
次の手順がうまくいかない場合は、ここで詳細なビルド方法の説明をご覧ください。
ビルドを試みる前に、システムに必要な前提条件がすべてインストールされていることを確認してください。
いくつかの一般的なオペレーティングシステムのしっかりとした強固な基礎を以下に示します。
With LIGGGHTS version 3.5.1 we have rolled out a all new and magic Makefile.auto which hopefully will make building LIGGGHTS as simple as possible. If the following steps do not work for you please see the advanced building description here.
Before attempting a build ensure that your system has all required prerequisites installed. A solid basis for several popular operating systems are listed below:
Ubuntu 16.04LTS:
sudo apt-get install openmpi-bin libopenmpi-dev libvtk6.2 libvtk6-dev
-----
Ubuntu 17.10:
sudo apt-get install openmpi-bin libopenmpi-dev libvtk6.3 libvtk6-dev
-----
Fedora 25:
su -
dnf install openmpi openmpi-devel paraview-openmpi paraview-openmpi-devel gcc-c++
exit
echo "export PATH=$PATH:/usr/lib64/openmpi/bin" >> ~/.bashrc
echo "export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib64/openmpi/lib:/usr/lib64/openmpi/lib/paraview" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib:/usr/lib64/openmpi/lib/paraview" >> ~/.bashrc
echo "export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/lib64/openmpi/include/paraview" >> ~/.bashrc
echo "export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/lib64/openmpi/include/paraview" >> ~/.bashrc
Step 0
srcディレクトリには、 LIGGGHTS(R)-PUBLICのC ++ソースファイルとヘッダーファイルが含まれています。 また、トップレベルのMakefileと、いくつかのMakefile.*ファイルを持つMAKEサブディレクトリも含まれています。 srcディレクトリから "make"または "gmake"と入力します。 利用可能な選択肢のリストが表示されます。 特に重要なのは、autoオプションです。それは私たちのためにすべての重労働をしなければならないからです。 なので、以下を
The src directory contains the C++ source and header files for LIGGGHTS(R)-PUBLIC. It also contains a top-level Makefile and a MAKE sub-directory with several Makefile.* files for many machines. From within the src directory, type “make” or “gmake”. You should see a list of available choices. Of particular interest is the auto option, as it should do all the heavy lifting for us. So start by typing
make auto
コマンドラインに入力します。 これを初めて実行している場合は、次のメッセージが表示されます。
into the command line. If you are running this for the first time you will see the following message:
>>> WARNING <<<
Created MAKE/Makefile.user for the first time. Please check that the options
in that file are set correctly and run make again.
MAKE / Makefile.userはデフォルトでは存在せず、いくつかのデフォルトオプションが含まれているので、これは完全に正常です。 コンパイルが続行され、あなたが十分に幸運であれば、src /フォルダーにlmp_autoという実行可能ファイルが実際に生成されます。 この場合、すでに完了しており、LIGGGHTS(R)-PUBLICの実行に移行できます。
コンパイルが中断した場合は、エラー メッセージを慎重に検討してください。 次の手順では、make autoのコンパイル変数を設定する方法について説明します。
That is perfectly normal as MAKE/Makefile.user does not exist by default and contains some default options. The compilation will continue and if you are lucky enough it will actually produce an executable called lmp_auto in your src/ folder. If this is the case you are done and can move on to Running LIGGGHTS(R)-PUBLIC
Should the compilation interupt please carefully study the error message. The following procedure will explain how to set compilation variables for make auto.
Step 1
これらのオプションを設定するには、 MAKE / Makefile.userを好みのテキストエディタで開きます。 このファイルには2つのセクションがあります。 最初のオプションは、LIGGGHTS(R)-PUBLICのどのオプションと機能を有効にするかを指定します。 最初の3行はMPIと関連しています:
To configure these options open MAKE/Makefile.user with your favourite text editor. There are two sections in this file. The first one specifies which options and features in LIGGGHTS(R)-PUBLIC you would like to activate. The first three lines are related to MPI and read:
# MPI: "ON" or "OFF"
# Description: Use the message passing interface for parallel execution
USE_MPI = "ON"
最初のコメント行は、
"ON"または "OFF"のいずれかが変数USE_MPIの有効なパラメータであることを示します。
オプションの簡単な説明が続き、最後の行は実際にオプションを "ON"に設定します。 デフォルトのMAKE /
Makefile.userには、賢明に設定されたデフォルトがあります。
だから、何も変更する必要はありません。
このファイルの2番目の部分は、デフォルトですべてコメント化され、ユーザーおよびマシン固有のパスを扱います。
USE_VTKが "ON"に設定されていてVTKのインストールがあなたの/ usrパスではなく、/ home
/ liggghts / vtkにあるとします。 その場合、次の行を見てください:
The first, commented line indicates that either “ON” or “OFF” are valid parameters of the variable called USE_MPI. A short description of the option follows and the last line actually sets the option to “ON”. The default MAKE/Makefile.user comes with some sensibly set defaults. So you might not need to change anything at all.
The second part of this file is by default all commented out and deals with user and machine specific paths. Say that USE_VTK is set to “ON” and your VTK installation is not in your /usr path, but in /home/liggghts/vtk. In that case have a look at the following lines:
# VTK specific variables
#
# Path that contains the includes (vtkVersion.h)
#VTK_INC_USR=-I/path/to/vtk/include
# Path that contains the VTK libraries
#VTK_LIB_USR=-L/path/to/vtk/lib
# Additional VTK libraries to include
#VTK_ADDLIBS_USR=
この場合、VTK_INC_USRと VTK_LIB_USRを変更して、以下のようになります。
In this case you would want to change VTK_INC_USR and VTK_LIB_USR so that they become
# VTK specific variables
#
# Path that contains the includes (vtkVersion.h)
VTK_INC_USR=-I/home/liggghts/vtk/include
# Path that contains the VTK libraries
VTK_LIB_USR=-L/home/liggghts/vtk/lib
# Additional VTK libraries to include
#VTK_ADDLIBS_USR=
2つの行にはコメントがなく、必要に 応じて値が変更されています。 includeパス(通常は変数名にINCが含まれています)に-Iが付いていて、ライブラリパス(LIBを含む)に-Lが付いている必要があります。 標準外のパスがある場合は、設定が少し難しいかもしれませんので、マシンのセットアップを知っているローカルの専門 家に相談してください。
Note that the two lines were uncommented and their values were changed as required. You can also see that include paths (normally containing INC in the variable name) need to be prefixed with -I and library paths (containing LIB) with -L. If you have non-standard paths, this can be a bit tricky to set up, so if you need any help ask a local expert that knows the setup of your machine.
Note
_USR
変数を設定すると、VTK_INC_USRとそれに対応する非_USR変数(この例ではVTK_INC)が設定
されます。 そうすれば、_USR以外の変数が優先されるので、最初の変数は効果を持ちません。
If you set a _USR variable, such as VTK_INC_USR and its corresponding non-_USR variable (VTK_INC in our example) is set. Then the first will have no effect, as the non-_USR variable will have precedence.
make autoを実行すると、指定したオプションが有効かどうかMakefileが自動的にチェックします。 いくつかのオプションが見つからない場合に役立つエラーメッセージが表示されます。
If you run make auto the Makefile will automatically check if the options you have provided are valid. It will hopefully supply you with helpful error messages in case some options cannot be found.
Note
最初 のコンパイル後にMAKE / Makefile.autoの最初の部分のオプションを変更した場合、make clean-autoを実行してコードを完全に再コンパイルするように要求されます。
If you change any options in the first part of your MAKE/Makefile.auto after a first compilation you will be requested to perform a make clean-auto to do a full recompilation of the code.
Step 2
すべてのオプションが満足のいくもの に設定された後、単に実行し
After all options are set to your satisfaction. Simply run
make auto
再びオプションをテストし、 LIGGGHTS(R)-PUBLICをコンパイルします。 コンパイルが完了すると、実行可能ファイル名lmp_autoが取得され、ここから続行できます。
again to test the options and compile LIGGGHTS(R)-PUBLIC. After the compilation is finished you will obtain a executable name lmp_auto and you can continue here.
Note
MAKE / Makefile.userを調整しても解決できない、Makefile.autoの不備のためにコンパイルがうまくいかない場合は、引き続き読んで自分のマシン用のカス タ ムMakefileを作る方法を見てください。私たちを助けていただけるなら、将来の使用のために改善できるよう、フォーラムを通してMakefileを送ってください。
Should the compilation not work due to some deficiency of the Makefile.auto that cannot be solved by adjusting MAKE/Makefile.user, then continue reading to see how to make a custom Makefile for your machine. If you want to help us, then please send us your finished Makefile via the forums so that we can improve it for future use.
Step 3 (Advanced usage)
Makefile.autoは1つの 変数をpostfixと呼ばれる追加入力として受け付けます。これは次の入力によって使用できます
Makefile.auto accepts one variable as additional input which is called postfix which can be used by typing
make auto postifx=myString
この場合、 Makefile.autoはMAKE / Makefile.userファイルを探すのではなく、MAKE / Makefile.user_myStringを探します。 存在しなければ、MAKE / Makefile.user(デフォルトテンプレートの代わりに)をクローンします。 結果の実行ファイルは、lmp_auto_myString(lmp_autoではなく)と呼ばれます。
初回は、MAKE /
Makefile.user_debugで、USE_DEBUGスイッチが
"ON"に切り替えられているのに対して、デフォルトのMAKE /
Makefile.userは最適化されたコードをコンパイルします。
In this case Makefile.auto will not look for the MAKE/Makefile.user file, but MAKE/Makefile.user_myString. If it does not exist it will clone MAKE/Makefile.user (instead of a default template). The resulting executable will be called lmp_auto_myString (instead of lmp_auto).
The prime use case would be a MAKE/Makefile.user_debug that has USE_DEBUG switched to “ON”, whereas the default MAKE/Makefile.user compiles the optimized version of the code.
Note
この 特定のコンパイルをクリーンにしたい場合は、make clean-autoにもpostfix = myStringを追加する必要があります。
If you want to clean this particular compilation make clean-auto also needs to have the postfix=myString appended.
LIGGGHTS(R)- PUBLICの全モデル組み合わせは、バージョン3.7から自動的に利用可能です。 ただし、それらのサブセットのみが最適化された方法でコンパイルされます。 これにより、5〜20%のパフォーマンス低下を招く可能性があります。 最適化されていないモデルの組み合わせを使用している場合は、LIGGGHTS(R)-PUBLICがこれを通知します。 この場合、LIGGGHTS(R)-PUBLIC src /フォルダにstyle_contact_model_user.whitelistというファイルを作成し、次のようなエントリを入力します。
All model combination of LIGGGHTS(R)-PUBLIC are automatically available starting with version 3.7. However, only a subset of them are compiled in an optimized manner. This might give you performance losses between 5 and 20%. In case you are using a model combination that is not optimized, LIGGGHTS(R)-PUBLIC will notify you of this. In this case you can create a file called style_contact_model_user.whitelist in your LIGGGHTS(R)-PUBLIC src/ folder and fill it with entries such as
GRAN_MODEL(HERTZ, TANGENTIAL_OFF, COHESION_OFF, ROLLING_OFF, SURFACE_DEFAULT)
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD, SURFACE_DEFAULT)
適切なエントリを持つファイルを作成
または変更したら、LIGGGHTS(R)-PUBLICを再コンパイルする必要があります。今回は、このファイル
で指定された最適化されたモデルの組み合わせでビルドされます。
さらに、LIGGGHTS(R)-PUBLIC入力スクリプト用のファイルまたはフォルダを自動的にスキャンし、使
用されている接触モデルを検索することができます。
このリストでは、ホワイトリストへの追加が自動的に作成されます。 LIGGGHTS(R)-PUBLIC
srcディレクトリ内で次のコマンドを実行する
After creating or modifying such a file with the appropriate entries you will need to recompile LIGGGHTS(R)-PUBLIC and this time it will be built with optimized model combinations specified in this file.
In addition you can automatically scan files or folders recursively for LIGGGHTS(R)-PUBLIC input scripts and search them for their used contact model. With this list an addition to the whitelist is automatically created. Running the following commands within the LIGGGHTS(R)-PUBLIC src directory
./genAutoExamplesWhitelist.sh -h
./genAutoExamplesWhitelist.sh ../examples
最初に
genAutoExamplesWhitelist.shのヘルプメッセージが表示されます。
2番目は再帰的にLIGGGHTS(R)-PUBLICインストールのexamplesフォルダーを検索し、使用されている接触モデルのすべての.inファイルをスキャ
ンします。
また、ホワイトリスト形式で一意に使用されるモデルを含むstyle_contact_model_autoExamples.whitelistファイルも作成されま
す。
3番目のホワイトリストは、コンパイル時に自動的に作成され、
style_contact_model.whitelistに保存されます。
このファイルが存在する場合、次のコンパイルはこのファイルを変更しません。
手動で削除してから再作成することができます
The first will display the help message for genAutoExamplesWhitelist.sh. The second will recursively search the examples folder of your LIGGGHTS(R)-PUBLIC installation and scan all in.* files for the used contact models. It will also create the file style_contact_model_autoExamples.whitelist containing the unique used models in the whitelist format.
A third whitelist is automatically created during the compilation and is stored in style_contact_model.whitelist . If this file exists, the next compilation will NOT change this file. You can manually delete it and recreate it with
sh Make.sh models
sh Make.sh models_full
すべてのコンパイル時に、3つのホワ イトリストファイルstyle_contact_model_user.whitelist、 style_contact_model_autoExamples.whitelistおよび style_contact_model.whitelistが自動的にマージされ、ユニークなエントリだけがマー ジされたファイルに保持されます。
During every compilation the three whitelist files style_contact_model_user.whitelist , style_contact_model_autoExamples.whitelist and style_contact_model.whitelist are automatically merged and only unique entries are kept in the merged file.
2.2.3. Advanced building using custom makefiles¶
Step 0
srcディレクトリには、 LIGGGHTS(R)-PUBLICのC ++ソースファイルとヘッダーファイルが含まれています。 また、いくつかの選択されたプラットフォーム用の最下位レベルのMakefileと、下位レベルのMakefile*ファイルを持つMAKEサブディレクトリも含まれてい ます。 srcディレクトリから "make"または "gmake"と入力します。 利用可能な選択肢のリストが表示されます。 そのうちの1つがあなたのマシンとオプションにマッチすれば、次のようなコマンドを入力できます:
The src directory contains the C++ source and header files for LIGGGHTS(R)-PUBLIC. It also contains a top-level Makefile and a MAKE sub-directory with low-level Makefile.* files for a few selected platforms. From within the src directory, type “make” or “gmake”. You should see a list of available choices. If one of those is the machine and options you want, you can type a command like:
make mpi
or
gmake serial
注記 マルチプロセッサまたはマルチ コアのプラットフォームでは、makeコマンドで "-j nprocessors"スイッチを使用すると、LIGGGHTS(R)-PUBLICをより迅速にビルドすることができます。
エラーがなく、lmp_mpiや lmp_serialのような実行可能ファイルが生成された場合は、完了しています。 あなたの幸運な日です。
デフォルトでは、いくつかの LIGGGHTS(R)-PUBLICオプションパッケージのみがインストールされていることに注意してください。 オプションのパッケージを使用してLIGGGHTS(R)-PUBLICをビルドするには、以下のセクションを参照 してください。
NOTE On a multi-processor or multi-core platform you can launch a parallel make, by using the “-j nprocessors” switch with the make command, which will build LIGGGHTS(R)-PUBLIC more quickly.
If you get no errors and an executable like lmp_mpi or lmp_serial is produced, you’re done; it’s your lucky day.
Note that by default only a few of LIGGGHTS(R)-PUBLIC optional packages are installed. To build LIGGGHTS(R)-PUBLIC with optional packages, see this section below.
Step 1
ステップ0がうまくいかなかった場合 は、Makefile.fooのような低レベルのMakefileを作成する必要があります。 既存のsrc / MAKE / Makefile*のコピーを出発点として作成する必要があります。 編集が必要なファイルの最初の行、「comliper/linkerの設定」セクション、および「LIGGGHTS(R)-PUBLIC固有の設定」セクションのみです。
If Step 0 did not work, you will need to create a low-level Makefile for your machine, like Makefile.foo. You should make a copy of an existing src/MAKE/Makefile.* as a starting point. The only portions of the file you need to edit are the first line, the “compiler/linker settings” section, and the “LIGGGHTS(R)-PUBLIC-specific settings” section.
Note
Makefile.auto はかなり複雑なファイルなので、コ ピーしたり変更したりしないでください。専門家 が変更する必要があります。
Do not attempt to copy and modify Makefile.auto as this is a rather complex file and should only be modified by experts.
Step 2
src / MAKE / Makefile.fooの最初の行を "#"の後に単語 "foo"をリストするように変更し、それが設定するその他のオプションを指定します。 これは "make"とタイプすれば表示される行です。
Change the first line of src/MAKE/Makefile.foo to list the word “foo” after the “#”, and whatever other options it will set. This is the line you will see if you just type “make”.
Step 3
「compiler/linker設
定」セクショ ンには、最適化フラグを含むC
++コンパイラのコンパイラおよびリンカーの設定が一覧表示されます。すべてのUnixシステムで利用可能なオープンソースのGNUコンパイラであるg
++を使うことができます。
MPIがあなたのシステムにインストールされている場合には一般的に利用可能なmpiccを使うこともできますが、どの実際のコンパイラがラップするかを確認する必要があ
ります。ベンダーのコンパイラは、より高速なコードを生成することがよくあります。インテルのCPUを搭載したボッ
クスでは、インテルのコンパイラサイトからダウンロードできる市販のインテルiccコンパイラを使用することをお勧
めします。
マシン上のC
++コードをビルドするために追加のライブラリが必要な場合は、それらをLIB変数の一部としてリストする必要があります。
DEPFLAGS設定は、C
++コンパイラがソースファイルの依存関係リストを作成するようにトリガするものです。ソース(.cpp)またはヘッダー(.h)ファイルを編集すると、再コンパイルが速
くなります。一部のコンパイラは依存ファイルの作成をサポートしていないか、-Dとは別のスイッチを使用することが
あります。 GNU g
++は-Dで動作します。コンパイラが依存ファイルを作成できない場合は、Makefile.fooをMakefile.stormの後にパターン化して作成する必要があ
ります。これは依存ファイルを含まない別のルールを使用します。新しいプラットフォームで初めて
LIGGGHTS(R)-PUBLICをビルドすると、*
.dファイルの長いリストが素早く出力されることに注意してください。これはエラーではありません。依存関係の通常の作成を行うのはMakefileです。
The “compiler/linker settings” section lists compiler and linker settings for your C++ compiler, including optimization flags. You can use g++, the open-source GNU compiler, which is available on all Unix systems. You can also use mpicc which will typically be available if MPI is installed on your system, though you should check which actual compiler it wraps. Vendor compilers often produce faster code. On boxes with Intel CPUs, we suggest using the commercial Intel icc compiler, which can be downloaded from Intel’s compiler site.
If building a C++ code on your machine requires additional libraries, then you should list them as part of the LIB variable.
The DEPFLAGS setting is what triggers the C++ compiler to create a dependency list for a source file. This speeds re-compilation when source (.cpp) or header (.h) files are edited. Some compilers do not support dependency file creation, or may use a different switch than -D. GNU g++ works with -D. If your compiler can’t create dependency files, then you’ll need to create a Makefile.foo patterned after Makefile.storm, which uses different rules that do not involve dependency files. Note that when you build LIGGGHTS(R)-PUBLIC for the first time on a new platform, a long list of *.d files will be printed out rapidly. This is not an error; it is the Makefile doing its normal creation of dependencies.
Step 4
「システム固有の設定」セクションに
はいくつかの部分があります。 このセクションの-D設定を変更した場合は、 "make
clean"(異なるクリーンオプションを記述する)と入力した後、完全に再コンパイルする必要があることに注意してください。
LMP_INC変数は、LIGGGHTS(R)-PUBLICコード内でifdefをオンにするオプションを含める
ために使用されます。 現在認識されているオプションは次のとおりです。
The “system-specific settings” section has several parts. Note that if you change any -D setting in this section, you should do a full re-compile, after typing “make clean” (which will describe different clean options).
The LMP_INC variable is used to include options that turn on ifdefs within the LIGGGHTS(R)-PUBLIC code. The options that are currently recogized are:
- -DLAMMPS_GZIP
- -DLAMMPS_JPEG
- -DLAMMPS_PNG
- -DLAMMPS_FFMPEG
- -DLAMMPS_MEMALIGN
- -DLAMMPS_XDR
- -DLAMMPS_SMALLBIG
- -DLAMMPS_BIGBIG
- -DLAMMPS_SMALLSMALL
- -DLAMMPS_LONGLONG_TO_LONG
- -DPACK_ARRAY
- -DPACK_POINTER
- -DPACK_MEMCPY
read_dataコマンドと
dumpコマンドは、-DLAMMPS_GZIPでコンパイルした場合、gzipファイルを読み書きします。あなた
のマシンは標準のランタイムライブラリの
"popen"機能をサポートしている必要があり、gzip実行ファイルは実行中にLIGGGHTS(R)-PUBLICが見つけることができます。
-DLAMMPS_JPEGを使用すると、dump
imageコマンドはJPEGイメージファイルを書き出すことができます。
JPEGファイルの場合は、後述のようにLIGGGHTS(R)-PUBLICをJPEGライブラリにリンクする必要があります。
-DLAMMPS_PNGを使用すると、dump
imageコマンドはPNGイメージファイルを書き出すことができます。
PNGファイルの場合は、後述のようにLIGGGHTS(R)-PUBLICをPNGライブラリにリンクする必要があります。これら2つの定義のどちらも使用されない場
合、LIGGGHTS(R)-PUBLICは圧縮されていないPPMイメージファイルのみを書き出すことができま
す。
-DLAMMPS_FFMPEGを使用すると、dump
movieコマンドを使用して、中間イメージファイルを格納する
必要があるレンダリングされたムービーのon-the-fly生成をサポートすることができます。あなたのマシンは標準のラ
ンタイムライブラリの
"popen"機能をサポートしている必要があり、実行中にLIGGGHTS(R)-PUBLICによってFFmpegの実行ファイルが見つかることが必要です。
-DLAMMPS_MEMALIGN =
<bytes>を使用すると、LIGGGHTS(R)-PUBLICによって大きなチャンクまたはメモリが割り当てられているときに、malloc()の代わ
りにposix_memalign()呼び出しを使用できるようになります。最適な性能を得るためには、動的に割り
当てられたメモリをデフォルトのバイト境界(例えば、x86型プラットフォームでは8バイトではなく16バイト)上
に揃えなければならないので、これは最新のCPUSのベクトル命令をより効率的に使用するのに役立ちます。
-DLAMMPS_XDRを使用する場合は、XDR形式の粒子のダンプを実行するためのXDR互換ファイルが
ビルドに含まれます。これは、プラットフォームに独自のXDRファイルがある場合にのみ必要です。詳細については、
dumpコマンドのRestrictionsセクションを参照してください。
多くの場合、-DLAMMPS_SMALLBIG、-DLAMMPS_BIGBIG、-D-
DLAMMPS_SMALLSMALLのいずれかの設定を使用します。デフォルトは
-DLAMMPS_SMALLBIGです。これらの設定は、src /
lmptype.hで指定されているように、LIGGGHTS(R)-PUBLIC内の4バイト(小)対8バイト(大)整数の使用を参照します。
BIGBIG設定を使用する唯一の理由は、20億個以上のatomを持つ巨大分子システムのシミュレーションを可能
にす ること、またはatomを512以上の周期的ボックスに巻き戻すことを可能にすることです。
SMALLSMALL設定を使用する唯一の理由は、マシンが64ビット整数をサポートしていない場合です。詳細については、以下の追加ビルドのヒントのセクションを参照し
てください。
システムまたはMPIバージョンが「long
long」データ型を認識しない場合は、-DLAMMPS_LONGLONG_TO_LONG設定が必要な場合があります。この場合、「long」データ型は既に64ビッ
トで ある可能性があります。この場合、この設定はそのデータ型に変換されます。
-DPACK_ARRAY、-DPACK_POINTER、および-DPACK_MEMCPYのいずれかのオプショ
ンを使用すると、一部のプラットフォームで高速な並列FFT(PPPMソルバー内)が可能になります。
-DPACK_ARRAY設定がデフォルトです。
PPPMについては、kspace_styleコマンドを参照してください。
FFTライブラリを使用してLIGGGHTS(R)-PUBLICをビルドする方法については、下記のステップ6を参照してください。
The read_data and dump commands will read/write gzipped files if you compile with -DLAMMPS_GZIP. It requires that your machine supports the “popen” function in the standard runtime library and that a gzip executable can be found by LIGGGHTS(R)-PUBLIC during a run.
If you use -DLAMMPS_JPEG, the dump image command will be able to write out JPEG image files. For JPEG files, you must also link LIGGGHTS(R)-PUBLIC with a JPEG library, as described below. If you use -DLAMMPS_PNG, the dump image command will be able to write out PNG image files. For PNG files, you must also link LIGGGHTS(R)-PUBLIC with a PNG library, as described below. If neither of those two defines are used, LIGGGHTS(R)-PUBLIC will only be able to write out uncompressed PPM image files.
If you use -DLAMMPS_FFMPEG, the dump movie command will be available to support on-the-fly generation of rendered movies the need to store intermediate image files. It requires that your machines supports the “popen” function in the standard runtime library and that an FFmpeg executable can be found by LIGGGHTS(R)-PUBLIC during the run.
Using -DLAMMPS_MEMALIGN=<bytes> enables the use of the posix_memalign() call instead of malloc() when large chunks or memory are allocated by LIGGGHTS(R)-PUBLIC. This can help to make more efficient use of vector instructions of modern CPUS, since dynamically allocated memory has to be aligned on larger than default byte boundaries (e.g. 16 bytes instead of 8 bytes on x86 type platforms) for optimal performance.
If you use -DLAMMPS_XDR, the build will include XDR compatibility files for doing particle dumps in XTC format. This is only necessary if your platform does have its own XDR files available. See the Restrictions section of the dump command for details.
Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG, -D-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG. These settings refer to use of 4-byte (small) vs 8-byte (big) integers within LIGGGHTS(R)-PUBLIC, as specified in src/lmptype.h. The only reason to use the BIGBIG setting is to enable simulation of huge molecular systems with more than 2 billion atoms or to allow moving atoms to wrap back through a periodic box more than 512 times. The only reason to use the SMALLSMALL setting is if your machine does not support 64-bit integers. See the Additional build tips section below for more details.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or MPI version does not recognize “long long” data types. In this case a “long” data type is likely already 64-bits, in which case this setting will convert to that data type.
Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY options can make for faster parallel FFTs (in the PPPM solver) on some platforms. The -DPACK_ARRAY setting is the default. See the kspace_style command for info about PPPM. See Step 6 below for info about building LIGGGHTS(R)-PUBLIC with an FFT library.
Step 5
3つのMPI変数は、LAMMPSを
ビルドするMPIライブラリを指定するために使用されます。
LIGGGHTS(R)-PUBLICを並列実行したい場合は、ご使用のプラットフォームにMPIライブラ
リーがインストールされている必要があります。
"mpicc"のようなMPIラップコンパイラを使ってLIGGGHTS(R)-PUBLICをビルドする場合は、これら3つの変数を空白のままにしておく必要がありま
す。 MPIラッパーは必要なファイルをどこに見つけるかを知っています。そうでない場合、MPIが通常の場所(/
usr /
localにあります)にシステムにインストールされている場合、これらの3つの変数を指定する必要もありません。コンパイル/リンク環境に
"モジュール"を使用するいくつかの大規模な並列マシンでは、ビルド環境に正しいモジュールを入れるだけでよいで
しょう。あるいは、並列マシンにベンダー提供のMPIがあると、コンパイラは問題を見つけることができません。
これに失敗すると、これらの3つの変数を使用して、mpi.hファイル(MPI_INC)とMPIライブラリファイ
ル(MPI_PATH)が見つかる場所とライブラリファイル(MPI_LIB)の名前を指定できます。
あなた自身でMPIをインストールする場合は、ArgonneのMPICH2またはOpenMPIをお勧めします。
MPICHはArgonne MPIサイトからダウンロードできます。
OpenMPIは、OpenMPIサイトからダウンロードできます。他のMPIパッケージも動作するはずです。大きな並列プラットフォームで実行している場合は、システム
の担当者またはベンダーがMPIのバージョンをインストールしておく必要があります。そのMPIは、MPICHまた
は OpenMPIよりも高速なので、ビルドとリンク方法がわかります。
MPICHまたはOpenMPIを使用している場合は、ご使用のプラットフォーム用に構成およびビルドする必要があります。
MPI構成スクリプトには、LIGGGHTS(R)-PUBLICビルドで使用しているのと同じコンパイラを使用で
きるようにコンパイラオプションが必要です.LIGGGHTS(R)-PUBLICをMPIライブラリにリンクする
ときに発生する可能性のある問題を回避できます。
単一のプロセッサ上でLIGGGHTS(R)-PUBLICを実行したいだけなら、あなたのシステムに真のMPIラ
イブラリがインストールされている必要はないので、src /
STUBSで提供されるダミーMPIライブラリを使うことができます。この場合、3つのMPI変数を指定する方法については、src
/ MAKE /
Makefile.serialファイルを参照してください。また、LIGGGHTS(R)-PUBLIC自体を作成する前に、ご使用のプラットフォーム用のSTUBSラ
イブラリーをビルドする必要があります。 srcディレクトリからビルドするには、「make
stubs」と入力するか、STUBS
dirから「make」と入力します。これにより、LIGGGHTS(R)-PUBLICへのリンクに適したlibmpi_stubs.aファイルが作成されます。ビルド
に失敗した場合は、ご使用のプラットフォーム用のSTUBS / Makefileを編集する必要があります。
ファイルSTUBS /
mpi.cは、gettimeofday()を呼び出すMPI_Wtime()と呼ばれるCPUタイマー関数を提供します。システムがgettimeofday()をサ
ポートしていない場合は、別のタイマーを呼び出すコードを挿入する必要があります。
ANSI標準の関数clock()は1時間ほど後にロールオーバーするため、長いLIGGGHTS(R)-PUBLICシミュレーションのタイミングには不十分です。
The 3 MPI variables are used to specify an MPI library to build LAMMPS with.
If you want LIGGGHTS(R)-PUBLIC to run in parallel, you must have an MPI library installed on your platform. If you use an MPI-wrapped compiler, such as “mpicc” to build LIGGGHTS(R)-PUBLIC, you should be able to leave these 3 variables blank; the MPI wrapper knows where to find the needed files. If not, and MPI is installed on your system in the usual place (under /usr/local), you also may not need to specify these 3 variables. On some large parallel machines which use “modules” for their compile/link environements, you may simply need to include the correct module in your build environment. Or the parallel machine may have a vendor-provided MPI which the compiler has no trouble finding.
Failing this, with these 3 variables you can specify where the mpi.h file (MPI_INC) and the MPI library file (MPI_PATH) are found and the name of the library file (MPI_LIB).
If you are installing MPI yourself, we recommend Argonne’s MPICH2 or OpenMPI. MPICH can be downloaded from the Argonne MPI site. OpenMPI can be downloaded from the OpenMPI site. Other MPI packages should also work. If you are running on a big parallel platform, your system people or the vendor should have already installed a version of MPI, which is likely to be faster than a self-installed MPICH or OpenMPI, so find out how to build and link with it. If you use MPICH or OpenMPI, you will have to configure and build it for your platform. The MPI configure script should have compiler options to enable you to use the same compiler you are using for the LIGGGHTS(R)-PUBLIC build, which can avoid problems that can arise when linking LIGGGHTS(R)-PUBLIC to the MPI library.
If you just want to run LIGGGHTS(R)-PUBLIC on a single processor, you can use the dummy MPI library provided in src/STUBS, since you don’t need a true MPI library installed on your system. See the src/MAKE/Makefile.serial file for how to specify the 3 MPI variables in this case. You will also need to build the STUBS library for your platform before making LIGGGHTS(R)-PUBLIC itself. To build from the src directory, type “make stubs”, or from the STUBS dir, type “make”. This should create a libmpi_stubs.a file suitable for linking to LIGGGHTS(R)-PUBLIC. If the build fails, you will need to edit the STUBS/Makefile for your platform.
The file STUBS/mpi.c provides a CPU timer function called MPI_Wtime() that calls gettimeofday() . If your system doesn’t support gettimeofday() , you’ll need to insert code to call another timer. Note that the ANSI-standard function clock() rolls over after an hour or so, and is therefore insufficient for timing long LIGGGHTS(R)-PUBLIC simulations.
Step 6
3つのFFT変数を使用すると、
kspace_styleコマンドによってLIGGGHTS(R)-PUBLICが(1d
FFTを実行するために)長距離クーロンの粒子-粒子、粒子-メッシュ(PPPM)オプションを実行するときに使用するFFTライブラリを指定できます。
LIGGGHTS(R)-PUBLICは、この目的のために、さまざまなオープンソースまたはベンダー提供のFFT
ライブラリをサポートしています。これら3つの変数を空白のままにしておくと、LIGGGHTS(R)-
PUBLICはLIGGGHTS(R)-PUBLICディストリビューションに含まれるオープンソースのKISS
FFTライブラリーを使用します。このライブラリはすべてのプラットフォームに移植可能であり、典型的な
LIGGGHTS(R)-PUBLICシミュレーションは、FFTWまたはベンダー最適化ライブラリほど高速です。
KSPACEパッケージをビルドに含めない場合は、3つの変数を空白のままにすることもできます。
それ以外の場合は、-DFFT_XXXという形式のスイッチによって、FFT_INC設定の一部として使用する
FFTの種類を選択します。
XXXの推奨値は、MKL、SCSL、FFTW2、およびFFTW3です。従来のオプションは、INTEL、SGI、ACML、およびT3Eです。下位互換性のために、-
DFFT_FFTWを使用すると、FFTW2ライブラリが使用されます。
-DFFT_NONEを使用すると、上記のKISSライブラリが使用されます。
また、FFT_INC、FFT_PATH、およびFFT_LIB変数を設定する必要があるため、コンパイラとリン
カーは必要なFFTヘッダとライブラリファイルを見つけることができます。コンパイル/リンク環境に
"modules"を使用するいくつかの大規模並列マシンでは、ビルド環境に正しいモジュールを含めるだけでよいことに注意してください。あるいは、並列マシンにベンダー
提供のFFTライブラリがあると、コンパイラは問題を見つけることができません。
FFTWは、すべてのプラットフォームで動作する、高速で移植性の高いライブラリです。
www.fftw.orgからダウンロードできます。レガシーバージョン2.1.Xとそれ以降のバージョン3.Xは両方とも-DFFT_FFTW2または
-DFFT_FFTW3としてサポートされています。あなたのボックスのFFTWをビルドするに
は、./configure;makeと同じくらい簡単にする必要があります。いくつかのプラットフォームでは、
FFTW2があらかじめインストールされており、コンパイルされた精度を示す名前の変更されたファイルが使用されて
いることに注意してください。
sfftw.h、またはdfftw.hをfftw.hの代わりに使用します。この場合、-DFFTW_SIZEというFFT_INCの追加定義変数を指定して、正しい
includeファイルを選択することができます。この場合、FFT_LIBは正しいライブラリ、つまり
-lsfftwまたは-ldfftwも手動で指定する必要があります。
FFT_INC変数では、PPPMで単精度FFTを使用する-DFFT_SINGLE設定も可能です.PPPMを使
用すると、特に並列またはGPUで長距離の計算を高速化できます。フーリエ変換および関連するPPPM演算は、浮動
小数点の切り捨て誤差に幾分敏感であるため、必ずしも倍精度で実行する必要はありません。
-DFFT_SINGLE設定を使用すると、メモリ使用量を減らし、3D
FFTデータを転置するための並列通信コストをわずかに上回ります。単精度FFTは、FFTW3、FFTW2、MKL、およびKISS
FFTオプションでのみテストされています。
The 3 FFT variables allow you to specify an FFT library which LIGGGHTS(R)-PUBLIC uses (for performing 1d FFTs) when running the particle-particle particle-mesh (PPPM) option for long-range Coulombics via the kspace_style command.
LIGGGHTS(R)-PUBLIC supports various open-source or vendor-supplied FFT libraries for this purpose. If you leave these 3 variables blank, LIGGGHTS(R)-PUBLIC will use the open-source KISS FFT library, which is included in the LIGGGHTS(R)-PUBLIC distribution. This library is portable to all platforms and for typical LIGGGHTS(R)-PUBLIC simulations is almost as fast as FFTW or vendor optimized libraries. If you are not including the KSPACE package in your build, you can also leave the 3 variables blank.
Otherwise, select which kinds of FFTs to use as part of the FFT_INC setting by a switch of the form -DFFT_XXX. Recommended values for XXX are: MKL, SCSL, FFTW2, and FFTW3. Legacy options are: INTEL, SGI, ACML, and T3E. For backward compatability, using -DFFT_FFTW will use the FFTW2 library. Using -DFFT_NONE will use the KISS library described above.
You may also need to set the FFT_INC, FFT_PATH, and FFT_LIB variables, so the compiler and linker can find the needed FFT header and library files. Note that on some large parallel machines which use “modules” for their compile/link environements, you may simply need to include the correct module in your build environment. Or the parallel machine may have a vendor-provided FFT library which the compiler has no trouble finding.
FFTW is a fast, portable library that should also work on any platform. You can download it from www.fftw.org. Both the legacy version 2.1.X and the newer 3.X versions are supported as -DFFT_FFTW2 or -DFFT_FFTW3. Building FFTW for your box should be as simple as ./configure; make. Note that on some platforms FFTW2 has been pre-installed, and uses renamed files indicating the precision it was compiled with, e.g. sfftw.h, or dfftw.h instead of fftw.h. In this case, you can specify an additional define variable for FFT_INC called -DFFTW_SIZE, which will select the correct include file. In this case, for FFT_LIB you must also manually specify the correct library, namely -lsfftw or -ldfftw.
The FFT_INC variable also allows for a -DFFT_SINGLE setting that will use single-precision FFTs with PPPM, which can speed-up long-range calulations, particularly in parallel or on GPUs. Fourier transform and related PPPM operations are somewhat insensitive to floating point truncation errors and thus do not always need to be performed in double precision. Using the -DFFT_SINGLE setting trades off a little accuracy for reduced memory use and parallel communication costs for transposing 3d FFT data. Note that single precision FFTs have only been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.
Step 7
3つのJPG変数を使用すると、
LIGGGHTS(R)-PUBLICがJPEGまたはPNGファイルをdump
imageコマンドで書き出すときに使用するJPEGおよび/またはPNGライブラリを指定できます。上記の手順4で説明した-DLAMMPS_JPEGまたは
-DLAMMPS_PNGスイッチを使用しないと、空白のままにすることができます。その場合、JPEG /
PNG出力は無効になるからです。
標準的なJPEGライブラリは、通常、libjpeg.aまたはlibjpeg.soという名前で運ばれ、関連する
ヘッダファイルjpeglib.hを持ちます。プラットフォーム上にあるどのJPEGライブラリであれ、適切な
JPG_INC、JPG_PATH、およびJPG_LIB変数を設定して、コンパイラとリンカーがそれを見つけること
ができるようにする必要があります。
標準的なPNGライブラリは、通常、libpng.aまたはlibpng.soという名前で運ばれ、関連するヘッダ
ファイルpng.hを持ちます。どのプラットフォームのPNGライブラリであれ、適切なJPG_INC、
JPG_PATH、およびJPG_LIB変数を設定して、コンパイラとリンカーがそれを見つけることができるようにす
る必要があります。
前述のように、これらのヘッダーファイルとライブラリファイルがマシン上の通常の場所にある場合、これらの変数を設
定する必要はありません。
The 3 JPG variables allow you to specify a JPEG and/or PNG library which LIGGGHTS(R)-PUBLIC uses when writing out JPEG or PNG files via the dump image command. These can be left blank if you do not use the -DLAMMPS_JPEG or -DLAMMPS_PNG switches discussed above in Step 4, since in that case JPEG/PNG output will be disabled.
A standard JPEG library usually goes by the name libjpeg.a or libjpeg.so and has an associated header file jpeglib.h. Whichever JPEG library you have on your platform, you’ll need to set the appropriate JPG_INC, JPG_PATH, and JPG_LIB variables, so that the compiler and linker can find it.
A standard PNG library usually goes by the name libpng.a or libpng.so and has an associated header file png.h. Whichever PNG library you have on your platform, you’ll need to set the appropriate JPG_INC, JPG_PATH, and JPG_LIB variables, so that the compiler and linker can find it.
As before, if these header and library files are in the usual place on your machine, you may not need to set these variables.
Step 8
デフォルトでは、いくつかの LIGGGHTS(R)-PUBLICオプションパッケージのみがインストールされていることに注意してください。 オプションのパッケージを使用してLIGGGHTS(R)-PUBLICをビルドするには、ステップ9に進む前にこ の セクションを参照してください。
Note that by default only a few of LIGGGHTS(R)-PUBLIC optional packages are installed. To build LIGGGHTS(R)-PUBLIC with optional packages, see this section below, before proceeding to Step 9.
Step 9
それでおしまい。 正しいMakefile.fooを取得したら、ビルドに含めるオプションのLIGGGHTS(R)-PUBLICパッケージをインストールし、他の必要なライブラリ(例え ばMPI、FFT、パッケージライブラリ)をすべてプレビルドしておき、srcディレクトリから次のような入力をす るだけでよい。:
That’s it. Once you have a correct Makefile.foo, you have installed the optional LIGGGHTS(R)-PUBLIC packages you want to include in your build, and you have pre-built any other needed libraries (e.g. MPI, FFT, package libraries), all you need to do from the src directory is type something like this:
make foo
or
gmake foo
ビルドが完了すると、実行可能ファイ ルlmp_fooを取得しておく必要があります。
You should get the executable lmp_foo when the build is complete.
2.2.4. Errors that can occur when making LIGGGHTS(R)-PUBLIC:¶
Warning
LIGGGHTS(R)- PUBLICをビルドするときにエラーが発生した場合、コンパイラーまたはリンカーは問題の内容を明示的に表示 し ます。 エラーメッセージには、上記のどのステップが失敗したか、またそれを修正するために必要なことについてのヒントが表示されます。 Makefileを使ってコードをビルドすることは、非常に論理的なプロセスです。 コンパイラとリンカーは適切なファイルを見つける必要があり、それらのファイルはLIGGGHTS(R)-PUBLICソースファイルと互換性がある必要があります。 makeが失敗した場合は、通常、非常に単純な理由があります。あなたやローカルの専門家が修正する必要が あります。
If an error occurs when building LIGGGHTS(R)-PUBLIC, the compiler or linker will state very explicitly what the problem is. The error message should give you a hint as to which of the steps above has failed, and what you need to do in order to fix it. Building a code with a Makefile is a very logical process. The compiler and linker need to find the appropriate files and those files need to be compatible with LIGGGHTS(R)-PUBLIC source files. When a make fails, there is usually a very simple reason, which you or a local expert will need to fix.
次の2つのエラーが発生する可能性が
あります。
(1)makeコマンドが、名前に「*」が付いたファイルが見つからないというエラーが表示され、中断した場合、
合、マシンのネイティブmakeがmakefile内でワイルドカード展開をサポートしていない可能性がありま
す。 makeの代わりにgmakeを試してみてください。
それでも動作しない場合は、makeコマンドで-fスイッチを使用して、必要なファイルをすべて明示的にリストする事前生成されたMakefile.listを使用してみ
てください。
Here are two non-obvious errors that can occur:
(1) If the make command breaks immediately with errors that indicate it can’t find files with a “*” in their names, this can be because your machine’s native make doesn’t support wildcard expansion in a makefile. Try gmake instead of make. If that doesn’t work, try using a -f switch with your make command to use a pre-generated Makefile.list which explicitly lists all the needed files, e.g.
make makelist
make -f Makefile.list linux
gmake -f Makefile.list mac
最初の
"make"コマンドは、現在のMakefile.listをsrcディレクトリ内のすべてのファイル名で作成します。
2番目の
"make"コマンド(makeまたはgmake)は、それを使ってLIGGGHTS(R)-PUBLICをビルドします。
"make
makelist"コマンドを使用する前に、任意のオプションパッケージをinclude/excludeする必要があることに注意してください。
(2) 'identifier "atoll" is
undefined'というエラーを受け取った場合、マシンは "long
long"整数をサポートしていません。
上記の手順4で説明した-DLAMMPS_LONGLONG_TO_LONG設定を使用してみてください。
The first “make” command will create a current Makefile.list with all the file names in your src dir. The 2nd “make” command (make or gmake) will use it to build LIGGGHTS(R)-PUBLIC. Note that you should include/exclude any desired optional packages before using the “make makelist” command.
(2) If you get an error that says something like ‘identifier “atoll” is undefined’, then your machine does not support “long long” integers. Try using the -DLAMMPS_LONGLONG_TO_LONG setting described above in Step 4.
2.2.5. Additional build tips:¶
複数のプラットフォームに対して同じsrcディレクトリからLIGGGHTS(R)-PUBLICを作ることができま す。各ターゲットは、システム固有の* .oファイルを格納するObj_targetという独自のオブジェクトサブディレクトリを作成します。
(2) クリーンナップ
LIGGGHTS(R)-PUBLICがビルドされたときに作成された* .oオブジェクトファイルは、すべてのビルドまたは特定のマシン用に "make clean-all"または "make clean-machine"と入力すると削除されます。
(3)-DLAMMPS_SMALLBIGまたは-DLAMMPS_BIBIGまたは -DLAMMPS_SMALLSMALLを介してLIGGGHTS(R)-PUBLICサイズ制限を変更する
上で説明したように、これら3つの設定のいずれかは、下位レベルのsrc / MAKE / Makefile.fooのLMP_INC行で指定することができます。
デフォルトは-DLAMMPS_SMALLBIGで、最大2 ^ 63のatomとタイムステップ(約90億分の1)を持つシステムが可能です。atomの限界は、atomIDを必要としないatomシステムのためのものです。 atomIDを必要とする分子 モデルの場合、限界は2 ^ 31atom(約20億)です。この設定では、イメージフラグが32ビット整数で格納されます。これは、atomが周期的なボックスを最大512回だけラップすることがで きる3 次元を意味します。atomがこの限界を超えて周期ボックスを通過すると、画像フラグは「ロールオーバ」します。例えば、511から-512までは、compute msdコマンドで計算された平均二乗変位のような診断を失敗させる可能性があります。
より大きい分子システムまたはより大きなイメージフラグを可能にするには、-DLAMMPS_BIGBIGを使用してコ ンパイルします。これにより、atom数2 ^ 63(約90億)の分子システムが可能になります。画像フラグは2 ^ 20 = 1048576に達するまでロールオーバーしません。
You can make LIGGGHTS(R)-PUBLIC for multiple platforms from the same src directory. Each target creates its own object sub-directory called Obj_target where it stores the system-specific *.o files.
Typing “make clean-all” or “make clean-machine” will delete *.o object files created when LIGGGHTS(R)-PUBLIC is built, for either all builds or for a particular machine.
(3) Changing the LIGGGHTS(R)-PUBLIC size limits via -DLAMMPS_SMALLBIG or -DLAMMPS_BIBIG or -DLAMMPS_SMALLSMALL
As explained above, any of these 3 settings can be specified on the LMP_INC line in your low-level src/MAKE/Makefile.foo.
The default is -DLAMMPS_SMALLBIG which allows for systems with up to 2^63 atoms and timesteps (about 9 billion billion). The atom limit is for atomic systems that do not require atom IDs. For molecular models, which require atom IDs, the limit is 2^31 atoms (about 2 billion). With this setting, image flags are stored in 32-bit integers, which means for 3 dimensions that atoms can only wrap around a periodic box at most 512 times. If atoms move through the periodic box more than this limit, the image flags will “roll over”, e.g. from 511 to -512, which can cause diagnostics like the mean-squared displacement, as calculated by the compute msd command, to be faulty.
To allow for larger molecular systems or larger image flags, compile with -DLAMMPS_BIGBIG. This enables molecular systems with up to 2^63 atoms (about 9 billion billion). And image flags will not “roll over” until they reach 2^20 = 1048576.
Warning
2012 年6月現在、BIGBIGの設定では、分子システムが2 ^ 63ほど大きく成長することはありません。 現在、このコンパイルオプションの影響を受けるのは、イメージフラグロールオーバーだけです。
As of 6/2012, the BIGBIG setting does not yet enable molecular systems to grow as large as 2^63. Only the image flag roll over is currently affected by this compile option.
システムが8バイト整数をサポートし
ていない場合は、-DLAMMPS_SMALLSMALL設定でコンパイルする必要があります。
これにより、atom(atomモデルまたは分子モデルの場合)とタイムステップの合計数が2 ^
31(約20億)に制限されます。 画像フラグは2 ^ 9 = 512でロールオーバーします。
src /
lmptype.hには、atomIDと合計システムサイズを格納する整数に関連するMPIデータ型の設定もあります。
これらは、関連するCデータ型と一致する必要があります。そうしないと、LIGGGHTS(R)-PUBLICがラ
ンタイムエラーを生成します。
いずれの場合でも、プロセッサごとに実行できる問題のサイズは、4バイトの整数ストレージによってプロセッサあたり
2 ^ 31のatom(約20億)に制限されます。
このような問題は、neighborリストのためにプロセッサごとに膨大なメモリ占有量があり、CPU秒/タイムステップの観点から非常にゆっくりと実行されるため、通常
は制限さ れません。
If your system does not support 8-byte integers, you will need to compile with the -DLAMMPS_SMALLSMALL setting. This will restrict your total number of atoms (for atomic or molecular models) and timesteps to 2^31 (about 2 billion). Image flags will roll over at 2^9 = 512.
Note that in src/lmptype.h there are also settings for the MPI data types associated with the integers that store atom IDs and total system sizes. These need to be consistent with the associated C data types, or else LIGGGHTS(R)-PUBLIC will generate a run-time error.
In all cases, the size of problem that can be run on a per-processor basis is limited by 4-byte integer storage to 2^31 atoms per processor (about 2 billion). This should not normally be a restriction since such a problem would have a huge per-processor memory footprint due to neighbor lists and would run very slowly in terms of CPU secs/timestep.
2.2.6. Building for a Mac:¶
OS XはBSD Unixなので、うまくいくはずです。 "make auto"を使うか、 "make serial"をフォールバックとして使ってみてください。 これはテストされていませんが、cfdem.comにフィードバックをお寄せください
OS X is BSD Unix, so it should just work. Try using “make auto” or use “make serial” as fallback. This is untested but feel free to give us feedback on cfdem.com
2.2.7. Building for Windows:¶
これを行うための推奨された方法は、
CMakeとVisual Studioを使用することです。
CMakeをインストールし、関連するGUIを起動します。ソースコードの場所を指定し、:src
/フォルダーに入力し、buildフォルダーをいくつかのフォルダーに設定してください(推奨:LIGGGHTS(R)-PUBLICベースディレクトリーにbuldフォ
ルダー を作成することをお勧めします)。configureを押してシステム設定を取得します。
VTKライブラリをビルドしたフォルダにVTK_DIRオプションを設定する必要があります。これが完了したら、プロジェクトを生成できるようにすべてのエラーが解決され
るまでconfigureをもう一度押します。その後、Open
Projectを押してLIGGGHTS(R)-PUBLICをビルドできるVisual
Studioを開くことができます。
これを行うもう1つの方法は、cygwinをインストールして、標準のLinux
makeを使ってLIGGGHTS(R)-PUBLICをビルドすることです。cygwin環境は、cmake、g
++、gcc、openmpi、makeなどのいくつかのパッケージを必要とします。
VTKをコンパイルするときは、OpenGLが利用できないため、すべてのレンダリングに関連するVTKオプションを無効にする必要があることに注意してください。これは
上級ユーザーのみが使用するオプションであることに注意してください。
The recommened way to do this is using CMake and Visual Studio. Install CMake and launch the associated GUI. Point the Where is your source code: input to your src/ folder and set the build folder to some folder (recommended: make a build folder in your LIGGGHTS(R)-PUBLIC-base directory). Press Configure to get your system settings. You will most likely have to set the VTK_DIR option to the folder in which you built the VTK library. Once this is done press Configure again until all errors are reolved so that you can Generate the project. After that you should be able to press Open Project to open Visual Studio where you can build LIGGGHTS(R)-PUBLIC.
The other way to do this is install and use cygwin to build LIGGGHTS(R)-PUBLIC with a standard Linux make, just as you would on any Linux box. Your cygwin environment will need several packages such as cmake, g++, gcc, openmpi, make. Note that when compiling VTK you need to disable all rendering related VTK options as OpenGL won’t be available. Note that this is an option that should only be used by advanced users.
2.3. Making LIGGGHTS(R)-PUBLIC with optional packages¶
This section has the following sub-sections:
- Package basics
- Including/excluding packages
- Packages that require extra libraries
- Additional Makefile settings for extra libraries
Package basics:
LIGGGHTS(R)-PUBLICの
ソースコードは、常に含まれる一連のコアファイルとオプションのパッケージで構成されています。
パッケージは、特定の一連の機能を有効にするファイルのグループです。
例えば、molecular系やgranular系の力の場はパッケージ化されています。
LIGGGHTS(R)-PUBLICディストリビューションのsrcディレクトリから "make
package"と入力すると、すべてのパッケージのリストを見ることができます。
特定のパッケージに固有のLIGGGHTS(R)-PUBLIC入力スクリプトでコマンドを使用する場合は、そのパッ
ケージでLIGGGHTS(R)-PUBLICをビルドしていなければなりません。そうしないと、スタイルが無効である
というエラーが表示されます。 コマンドは不明です。
すべてのコマンドのdocページは、パッケージの一部である場合に指定します。次のようにも入力することもできます
The source code for LIGGGHTS(R)-PUBLIC is structured as a set of core files which are always included, plus optional packages. Packages are groups of files that enable a specific set of features. For example, force fields for molecular systems or granular systems are in packages. You can see the list of all packages by typing “make package” from within the src directory of the LIGGGHTS(R)-PUBLIC distribution.
If you use a command in a LIGGGHTS(R)-PUBLIC input script that is specific to a particular package, you must have built LIGGGHTS(R)-PUBLIC with that package, else you will get an error that the style is invalid or the command is unknown. Every command’s doc page specfies if it is part of a package. You can also type
lmp_machine -h
オプションの-hコマンドラインスイッチ
(
"help")を使用して実行可能ファイルを実行すると、実行可能ファイルに対して既知のスタイルとコマンドが一覧表示されます。
LIGGGHTS(R)-PUBLICパッケージには標準パッケージとユーザーパッケージの2種類があります。標準パッ
ケージとユーザパッケージの内容に関する詳細は、マニュアルのSection_packagesにあります。標準パッ
ケージとユーザーパッケージの違いは次のとおりです。
標準パッケージは、LIGGGHTS(R)-PUBLIC開発者によってサポートされており、LIGGGHTS(R)-
PUBLICの残りの部分と一致する構文とスタイルで書かれています。これは、私たちがそれらに関する質問に答え、必要
に応じてデバッグし修正し、LIGGGHTS(R)-PUBLICへの将来の変更との互換性を保つことを意味します。
ユーザーパッケージはユーザーによって提供されており、ユーザープレフィックスで始まります。それらが単一のコマンド
(単一ファイル)である場合、それらは通常、ユーザミックスパッケージに含まれます。そうでなければ、それらは一緒にグ
ループ化された一連のファイルであり、コードに特定の機能を追加します。
一部のパッケージ(標準とユーザーの両方)には追加のライブラリが必要です。以下の詳細を参照してください。
to run your executable with the optional -h command-line switch for “help”, which will list the styles and commands known to your executable.
There are two kinds of packages in LIGGGHTS(R)-PUBLIC, standard and user packages. More information about the contents of standard and user packages is given in Section_packages of the manual. The difference between standard and user packages is as follows:
Standard packages are supported by the LIGGGHTS(R)-PUBLIC developers and are written in a syntax and style consistent with the rest of LIGGGHTS(R)-PUBLIC. This means we will answer questions about them, debug and fix them if necessary, and keep them compatible with future changes to LIGGGHTS(R)-PUBLIC.
User packages have been contributed by users, and always begin with the user prefix. If they are a single command (single file), they are typically in the user-misc package. Otherwise, they are a a set of files grouped together which add a specific functionality to the code.
Some packages (both standard and user) require additional libraries. See more details below.
Including/excluding packages:
パッケージを使用するか使用しないかは、 LIGGGHTS(R)-PUBLICをビルドする前にパッケージを含めるか除外する必要があります。 srcディレクトリから、通常は、以下のように簡単にできます:
To use or not use a package you must include or exclude it before building LIGGGHTS(R)-PUBLIC. From the src directory, this is typically as simple as:
make yes-asphere
make g++
or
make no-asphere
make g++
Warning
1つの makeコマンドに複数のターゲット(例:make yes-colloid g ++)を使用することで、パッケージをinclude/excludeしてLIGGGHTS(R)-PUBLICをビルドするべきではありません。 これは、同じコマンド中にパッケージ構成が変更された場合、makeプロシージャがビルドのアウト・オブ・デートに なるソースファイルのリストを作成するためです。
You should NOT include/exclude packages and build LIGGGHTS(R)-PUBLIC in a single make command by using multiple targets, e.g. make yes-colloid g++. This is because the make procedure creates a list of source files that will be out-of-date for the build if the package configuration changes during the same command.
パッケージによっては、含まれている他の
パッケージに依存する個々のファイルがあります。
LIGGGHTS(R)-PUBLICはこれをチェックし、正しいことをします。すなわち、個々のファイルは、依存関係が既に含まれている場合にのみ含まれます。同様に、
パッケージ が除外されている場合、そのパッケージに依存する他のファイルも除外されます。
パッケージを除外する理由は、決して特定の種類のシミュレーションを実行しない場合です。いくつかのパッケージでは、こ
れにより補助ライブラリ(下記参照)をビルドする必要がなくなり、より高速に動作する小さな実行可能ファイルも生成され
ま す。
LIGGGHTS(R)-PUBLIC
tarballをダウンロードすると、これらのパッケージはsrcディレクトリ(KSPACE、MANYBODY、MOLECULE)にあらかじめインストールされていま
す。
SVNリポジトリまたはGitリポジトリからLIGGGHTS(R)-PUBLICソースファイルをダウンロードすると、パッケージはあらかじめインストールされていませ
ん。
パッケージは、 "make yes-name"または "make
no-name"と入力することで、includeまたはexcludeされます。ここで、
"name"は小文字のパッケージ名です。 ASPHEREパッケージの場合、name =
asphere。また、「make yes-all」または「no
all」と入力して、さまざまなパッケージセットを含める/除外することもできます。 "make
package"と入力すると、パッケージ関連のmakeオプションがすべて表示されます。
Some packages have individual files that depend on other packages being included. LIGGGHTS(R)-PUBLIC checks for this and does the right thing. I.e. individual files are only included if their dependencies are already included. Likewise, if a package is excluded, other files dependent on that package are also excluded.
The reason to exclude packages is if you will never run certain kinds of simulations. For some packages, this will keep you from having to build auxiliary libraries (see below), and will also produce a smaller executable which may run a bit faster.
When you download a LIGGGHTS(R)-PUBLIC tarball, these packages are pre-installed in the src directory: KSPACE, MANYBODY,MOLECULE. When you download LIGGGHTS(R)-PUBLIC source files from the SVN or Git repositories, no packages are pre-installed.
Packages are included or excluded by typing “make yes-name” or “make no-name”, where “name” is the name of the package in lower-case, e.g. name = asphere for the ASPHERE package. You can also type “make yes-all” or “make no-all” to include/exclude various sets of packages. Type “make package” to see the all of the package-related make options.
Warning
パッケー ジのinclude/excludeは、パッケージの名前を持つメインのsrcディレクトリとサブディレクトリの間 でファイルを 前後に移動するだけで動作します。 パッケージを組み込んだり除いたりしたら、LIGGGHTS(R)-PUBLICを再ビルドする必要があります。
Inclusion/exclusion of a package works by simply moving files back and forth between the main src directory and sub-directories with the package name. After you have included or excluded a package, you must re-build LIGGGHTS(R)-PUBLIC.
srcディレクトリとパッケージサブディ
レクトリの両方に存在するLIGGGHTS(R)-PUBLICファイルを管理するのに役立つパッケージ関連のmake
オプションが追加されています。
LIGGGHTS(R)-PUBLICファイルを編集している場合や、LIGGGHTS(R)-PUBLIC
WWWサイトからパッチをダウンロードしている場合を除き、通常はこれらのコマンドを使用する必要はありません。
パッケージが含まれている場合、 "make
package-update"と入力すると、パッケージのサブディレクトリのファイルでsrcファイルが上書きされます。パッチはパッケージのサブディレクトリにある
ファイルのみを更新し、srcファイルは更新しないので、パッチをインストールした後に使用する必要があります。
"make
package-overwrite"とタイプするとパッケージのサブディレクトリにあるファイルがsrcファイルで上書きされます。
"make
package-status"と入力すると、現在含まれているパッケージが表示されます。含まれているもののうち、srcディレクトリとpackageサブディレクトリ
で異なるファイルがリストされます。 "make
package-diff"と入力すると、これらのファイル間のすべての相違点が一覧表示されます。ここでも"make
package"と入力すると、パッケージ関連のすべての makeオプションが表示されます。
Additional package-related make options exist to help manage LIGGGHTS(R)-PUBLIC files that exist in both the src directory and in package sub-directories. You do not normally need to use these commands unless you are editing LIGGGHTS(R)-PUBLIC files or have downloaded a patch from the LIGGGHTS(R)-PUBLIC WWW site.
Typing “make package-update” will overwrite src files with files from the package sub-directories if the package has been included. It should be used after a patch is installed, since patches only update the files in the package sub-directory, but not the src files. Typing “make package-overwrite” will overwrite files in the package sub-directories with src files.
Typing “make package-status” will show which packages are currently included. Of those that are included, it will list files that are different in the src directory and package sub-directory. Typing “make package-diff” lists all differences between these files. Again, type “make package” to see all of the package-related make options.
Packages that require extra libraries:
いくつかの標準パッケージとユーザーパッ
ケージには、追加の補助ライブラリが必要です。
LIGGGHTS(R)-PUBLICがビルドされる前に、それらを最初にコンパイルする必要があります。
行方不明のライブラリに関するLIGGGHTS(R)-PUBLICビルドエラーが発生した場合、これが原因である可能性があります。
補助ライブラリを持つパッケージのリストについては、Section_packagesのdocページを参照してくださ
い。
これらの補助ライブラリーの一部のコードは、libディレクトリーの下のLIGGGHTS(R)-PUBLICディスト
リビューションに含まれています。
一部の補助ライブラリはLIGGGHTS(R)-PUBLICには含まれていません。
関連パッケージを使用するには、補助ライブラリをダウンロードしてインストールする必要があります。
例はVORONOIパッケージです。
提供されたソースコードを持つライブラリの場合、各libディレクトリには、そのライブラリをビルドする方法についての
説 明があるREADMEファイル(例:lib / reax / README)があります。
通常、これは次のように入力して行います:
A few of the standard and user packages require additional auxiliary libraries. They must be compiled first, before LIGGGHTS(R)-PUBLIC is built. If you get a LIGGGHTS(R)-PUBLIC build error about a missing library, this is likely the reason. See the Section_packages doc page for a list of packages that have auxiliary libraries.
Code for some of these auxiliary libraries is included in the LIGGGHTS(R)-PUBLIC distribution under the lib directory. Some auxiliary libraries are not included with LIGGGHTS(R)-PUBLIC; to use the associated package you must download and install the auxiliary library yourself. Example is the VORONOI packages.
For libraries with provided source code, each lib directory has a README file (e.g. lib/reax/README) with instructions on how to build that library. Typically this is done by typing something like:
make -f Makefile.g++
提供されているMakefileの1つがシステムに適していない場合は、編集または追加する必要があります。
すべてのMakefileには、上部にEXTRAMAKEの設定があり、Makefile.lammps
*という名前が付けられています。
成功すると、libディレクトリに2つのファイルが生成されます。
If one of the provided Makefiles is not appropriate for your system you will need to edit or add one. Note that all the Makefiles have a setting for EXTRAMAKE at the top that names a Makefile.lammps.* file.
If successful, this will produce 2 files in the lib directory:
libpackage.a
Makefile.lammps
Makefile.lammpsファイル
は、使用したMakefileで指定されたEXTRAMAKEファイルのコピーです。
Makefile.lammpsの設定がシステムに適切であることを保証しなければなりません。そうでない場
合、LIGGGHTS(R)-PUBLICのビルドは失敗します。
lib / package /
READMEファイルで説明されているように、これらはLIGGGHTS(R)-PUBLICが補助ライブラリーでビルドできるように、追加のシステム・ライブラリーとそ
の
ロケーションを指定するために使用されます。たとえば、MEAMまたはREAXパッケージが使用されている場合、補助ラ
イブラリはF90コードで構成され、F90コンパイラでビルドされます。ライブラリをLIGGGHTS(R)-
PUBLIC(C ++コード)とLIGGGHTS(R)-PUBLICがビルドされたC
++コンパイラを介してリンクするには、一般的に追加のFortran-to-Cライブラリをリンクに含める必要があります。もう1つの例は、USER-ATCまたは
USER-AWPMDパッケージを使用するために必要なBLASライブラリとLAPACKライブラリです。
提供されていないライブラリについては、ライブラリの場所とビルド方法については、src / package /
Makefile.lammpsファイルを参照してください。例えば、ファイル src / KIM /
Makefile.lammps。このファイルは、上記のlib / package /
Makefile.lammpsファイルと同じ目的を果たします。
LIGGGHTS(R)-PUBLICが補助ライブラリーとリンクするようにビルドされている場合に必要な設定があります。ここでも、src
/ package /
Makefile.lammpsの設定がシステムに適していることと、補助ライブラリをインストールした場所が適切であることを保証しなければなりません。そうでない場
合、LIGGGHTS(R)-PUBLICビルドは失敗します。
The Makefile.lammps file is a copy of the EXTRAMAKE file specified in the Makefile you used.
You MUST insure that the settings in Makefile.lammps are appropriate for your system. If they are not, the LIGGGHTS(R)-PUBLIC build will fail.
As explained in the lib/package/README files, they are used to specify additional system libraries and their locations so that LIGGGHTS(R)-PUBLIC can build with the auxiliary library. For example, if the MEAM or REAX packages are used, the auxiliary libraries consist of F90 code, build with a F90 complier. To link that library with LIGGGHTS(R)-PUBLIC (a C++ code) via whatever C++ compiler LIGGGHTS(R)-PUBLIC is built with, typically requires additional Fortran-to-C libraries be included in the link. Another example are the BLAS and LAPACK libraries needed to use the USER-ATC or USER-AWPMD packages.
For libraries without provided source code, see the src/package/Makefile.lammps file for information on where to find the library and how to build it. E.g. the file src/KIM/Makefile.lammps. This file serves the same purpose as the lib/package/Makefile.lammps file described above. It has settings needed when LIGGGHTS(R)-PUBLIC is built to link with the auxiliary library. Again, you MUST insure that the settings in src/package/Makefile.lammps are appropriate for your system and where you installed the auxiliary library. If they are not, the LIGGGHTS(R)-PUBLIC build will fail.
2.4. Building LIGGGHTS(R)-PUBLIC via the Make.py script¶
srcディレクトリにはPythonで書
かれたMake.pyスクリプトが含まれており、ビルドプロセスのさまざまなステップを自動化することができます。
次のいずれかを入力して、srcディレクトリからスクリプトを実行できます。
The src directory includes a Make.py script, written in Python, which can be used to automate various steps of the build process.
You can run the script from the src directory by typing either:
Make.py
python Make.py
ツールに関する情報が表示されます。 前者が機能するには、ローカルPythonを指すようにスクリプトの1行目を編集する必要があります。 スクリプトが実行可能であることを保証する必要があるかもしれません:
which will give you info about the tool. For the former to work, you may need to edit the 1st line of the script to point to your local Python. And you may need to insure the script is executable:
chmod +x Make.py
次のオプションがスイッチとしてサポート されています。
The following options are supported as switches:
- -i file1 file2 ...
- -p package1 package2 ...
- -u package1 package2 ...
- -e package1 arg1 arg2 package2 ...
- -o dir
- -b machine
- -s suffix1 suffix2 ...
- -l dir
- -j N
- -h switch1 switch2 ...
任意のスイッチに関するヘルプは、-hを 使用して一覧表示できます。
Help on any switch can be listed by using -h, e.g.
Make.py -h -i -p
ハイレベルでは、これらは、
Make.pyツールを使用して簡単に実行できるパッケージ管理とビルドタスクの種類です。
- パッケージをインストール/アンイ ンストールし、関連する外部ライブラリをビルドします(-pと-uと-eを使います)
- 1つ以上の入力スクリプトに必要な パッケージをインストールする(-iと-pを使用)
- srcディレクトリか新しいディレ クトリのどちらかにLIGGGHTS(R)-PUBLICをビルドします(-bオプションを使用)
- 1つまたは複数の入力スクリプトに
必要なソースコードのみを使用して新しいディレクトリを作成します(-iおよび-oを使用)
最後の箇条書きは、特定のスクリプトを実 行するためのLIGGGHTS(R)-PUBLICの格下げバージョンをビルドする場合、またはリモート LIGGGHTS(R)-PUBLICビルドのために最小限の量のファイルを別のプラットフォームに移動する場合に 便利です。
Make.pyを使用することは、システムに有効なsrc / MAKE / Makefile.fooを持っていることを保証する代用ではなく、使用しているlib / *ディレクトリ内の外部ライブラリMakefileもシステムに対して有効であることに注意してください。しかし、いったん終わったら、入力スクリプトで必要な パッケージと外部ライブラリを素早くinclude/excludeするために、Make.pyを使用することができま す。
At a hi-level, these are the kinds of package management and build tasks that can be performed easily, using the Make.py tool:
- install/uninstall packages and build the associated external libs (use -p and -u and -e)
- install packages needed for one or more input scripts (use -i and -p)
- build LIGGGHTS(R)-PUBLIC, either in the src dir or new dir (use -b)
- create a new dir with only the source code needed for one or more input scripts (use -i and -o)
The last bullet can be useful when you wish to build a stripped-down version of LIGGGHTS(R)-PUBLIC to run a specific script(s). Or when you wish to move the minimal amount of files to another platform for a remote LIGGGHTS(R)-PUBLIC build.
Note that using Make.py is not a substitute for insuring you have a valid src/MAKE/Makefile.foo for your system, or that external library Makefiles in any lib/* directories you use are also valid for your system. But once you have done that, you can use Make.py to quickly include/exclude the packages and external libraries needed by your input scripts.
2.5. Building LIGGGHTS(R)-PUBLIC as a library¶
LIGGGHTS(R)-PUBLICは 静的ライブラリまたは共有ライブラリのいずれかとしてビルドでき、別のアプリケーションやスクリプト言語から呼び出すこ とができます。 LIGGGHTS(R)-PUBLICを他のコードと連成する方法の詳細は、このセクションを参照してください。 PythonからLIGGGHTS(R)-PUBLICをラップして実行する方法については、このセクションを参照してください。
LIGGGHTS(R)-PUBLIC can be built as either a static or shared library, which can then be called from another application or a scripting language. See this section for more info on coupling LIGGGHTS(R)-PUBLIC to other codes. See this section for more info on wrapping and running LIGGGHTS(R)-PUBLIC from Python.
2.5.1. Static library:¶
LIGGGHTS(R)- PUBLICを静的ライブラリ(Linux上の* .aファイル)としてビルドするには、次のように入力します。
To build LIGGGHTS(R)-PUBLIC as a static library (*.a file on Linux), type
make makelib
make -f Makefile.lib foo
ここで、fooはマシン名です(通常 はautoでコンパイルしてからこのオプションを使用します)。 この種のライブラリは通常、ドライバアプリケーションをLIGGGHTS(R)-PUBLICに静的にリンクするために使用されるため、コンパイル時にすべての依存関係が 満たされることが保証されます。 "make makelib"とタイプする前に、任意のオプションのパッケージをincludeまたはexcludeする必要があることに注意してください。 最初の "make"コマンドは、srcディレクトリ内のすべてのファイル名で現在のMakefile.libを作成します。 2番目の "make"コマンドは、src / MAKE / Makefile.fooのARCHIVEとARFLAGS設定を使用して、LIGGGHTS(R)-PUBLICを静的ライブラリとしてビルドするためにこのコマンドを 使 用します。 ビルドによって、liblammps_foo.aというファイルが作成され、別のアプリケーションがリンクすることができます。
Where foo is the machine name (if you normally compile with auto then use this option). This kind of library is typically used to statically link a driver application to LIGGGHTS(R)-PUBLIC, so that you can insure all dependencies are satisfied at compile time. Note that inclusion or exclusion of any desired optional packages should be done before typing “make makelib”. The first “make” command will create a current Makefile.lib with all the file names in your src dir. The second “make” command will use it to build LIGGGHTS(R)-PUBLIC as a static library, using the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The build will create the file liblammps_foo.a which another application can link to.
2.5.4. Calling the LIGGGHTS(R)-PUBLIC library:¶
ライブラリの味(staticまた
はshared)によって、呼び出しプログラムから1つまたは複数のLIGGGHTS(R)-PUBLICオブ
ジェクトをインスタンス化することができます。
C ++プログラムから使用すると、LIGGGHTS(R)-PUBLICはすべてLAMMPS_NS
namespaceにラップされます。必要に応じて、呼び出しコード内から任意のク
ラスとメソッドを安全に使用できます。
CやFortranプログラムやPythonのようなスクリプト言語から使用された場合、ライブラリはsrc /
library.cppとsrc /
library.hで提供される単純な関数形式のインタフェースを持っています。
LIGGGHTS(R)-PUBLICを呼び出すC
++およびCおよびFortranのコードの例については、examples / COUPLE /
simpleのサンプルコードをライブラリインターフェイスで参照してください。
COUPLEディレクトリには、マニュアルのSection_howto 10で説明している他の例もあります。
LIGGGHTS(R)-PUBLICライブラリー・インターフェースを介して動作するLIGGGHTS(R)-
PUBLICで提供されるPythonラッパーについては、マニュアルのSection_pythonを参照してく
ださい。
ファイルsrc /
library.cppとlibrary.hは、LIGGGHTS(R)-PUBLICをライブラリーとして使用するためのCスタイルAPIを定義しています。インター
フェイスの説明と必要に応じて拡張する方法については、マニュアルのSection_howto
19を参照してください。
Either flavor of library (static or shared0 allows one or more LIGGGHTS(R)-PUBLIC objects to be instantiated from the calling program.
When used from a C++ program, all of LIGGGHTS(R)-PUBLIC is wrapped in a LAMMPS_NS namespace; you can safely use any of its classes and methods from within the calling code, as needed.
When used from a C or Fortran program or a scripting language like Python, the library has a simple function-style interface, provided in src/library.cpp and src/library.h.
See the sample codes in examples/COUPLE/simple for examples of C++ and C and Fortran codes that invoke LIGGGHTS(R)-PUBLIC thru its library interface. There are other examples as well in the COUPLE directory which are discussed in Section_howto 10 of the manual. See Section_python of the manual for a description of the Python wrapper provided with LIGGGHTS(R)-PUBLIC that operates through the LIGGGHTS(R)-PUBLIC library interface.
The files src/library.cpp and library.h define the C-style API for using LIGGGHTS(R)-PUBLIC as a library. See Section_howto 19 of the manual for a description of the interface and how to extend it for your needs.
2.6. Running LIGGGHTS(R)-PUBLIC¶
デフォルトでは、
LIGGGHTS(R)-PUBLICはstdinからコマンドを読み取って実行します。 例えば lmp_auto
< in.fileなど。
これは、最初に、目的のコマンドを含む入力スクリプト(in.fileなど)を作成することを意味します。
このセクションでは、入力スクリプトがどのように構造化され、どのコマンドに含まれているかについて説明します。
LIGGGHTS(R)-PUBLICは、サンプルまたはベンチディレクトリにあるサンプル入力のいずれかでテストでき
ます。 入力スクリプトの名前はin.*で、サンプル出力の名前はlog.*
.name.Pです。nameはマシンで、Pは実行されたプロセッサの数です。
Linuxボックスで標準のLennard-Jonesベンチマークを実行し、mpirunを使って並列ジョブを起動す
る方法は次のとおりです。
By default, LIGGGHTS(R)-PUBLIC runs by reading commands from stdin; e.g. lmp_auto < in.file. This means you first create an input script (e.g. in.file) containing the desired commands. This section describes how input scripts are structured and what commands they contain.
You can test LIGGGHTS(R)-PUBLIC on any of the sample inputs provided in the examples or bench directory. Input scripts are named in.* and sample outputs are named log.*.name.P where name is a machine and P is the number of processors it was run on.
Here is how you might run a standard Lennard-Jones benchmark on a Linux box, using mpirun to launch a parallel job:
cd src
make linux
cp lmp_auto ../bench
cd ../bench
mpirun -np 4 lmp_auto < in.lj
Windowsのボックスでは、上記のよ
うにLIGGGHTS(R)-PUBLICの作成をスキップして実行可能ファイルをダウンロードすることができますが、
パッケージ化された実行ファイルには特定のパッケージのみが含まれています。
Windowsマシン上でLIGGGHTS(R)-PUBLIC実行ファイルを実行するには、まず、実行可能ファイルの
非MPI(シリアル)バージョンまたはMPI(パラレル)バージョンをダウンロードするかどうかを決定します。選択した
バージョンをダウンロードして保存します。
非MPIバージョンの場合は、次の手順を実行します。
- 「スタート」 - >「ファイル名を指定して実行」に移動し、「cmd」と入力してコマンドプロンプトを表示します。
- lmp_win_no- mpi.exeを保存したディレクトリに移動します(たとえば、cd "Documents"と入力します)。
- コマンドプロンプトで、 "lmp_win_no-mpi -in in.lj"と入力し、in.ljをLIGGGHTS(R)-PUBLIC入力スクリプトの名前に置き換えます。
複数のプロセッサでWindows上でLIGGGHTS(R)-PUBLICを実行できるようにするMPIバージョンに
ついては、次の手順を実行します。
- Windows用のMPICH2を ダウンロードしてインストールします。
- MPICH2パッケージの mpiexec.exeファイルとsmpd.exeファイルを使用する必要があります。それらを LIGGGHTS(R)-PUBLIC Windows実行可能ファイルと同じディレクトリ(またはパス)に入れます。
- 「スタート」 - >「ファイル名を指定して実行」に移動し、「cmd」と入力してコマンドプロンプトを表示します。
- lmp_win_mpi.exeを 保存したディレクトリに移動します(たとえば、cd "Documents"と入力します)。
- "mpiexec -np 4 -localonly lmp_win_mpi -in in.lj"と入力し、in.ljをLIGGGHTS(R)-PUBLIC入力スクリプトの名前に置き換えます。
- smpdにパスフレーズを指定する 必要があるかもしれないことに注意してください。
- このモードでは、出力がすぐに画面 に表示されないことがあります。そのため、入力スクリプトの実行に時間がかかる場合は、出力が表示されるまで忍耐強 くする必要があります。
- あるいは、この実行可能ファイルを 使用して、 "lmp_win_mpi -in in.lj"のようなものを入力して、単一プロセッサ上で実行することもできます。
On a Windows box, you can skip making LIGGGHTS(R)-PUBLIC and simply download an executable, as described above, though the pre-packaged executables include only certain packages.
To run a LIGGGHTS(R)-PUBLIC executable on a Windows machine, first decide whether you want to download the non-MPI (serial) or the MPI (parallel) version of the executable. Download and save the version you have chosen.
For the non-MPI version, follow these steps:
- Get a command prompt by going to Start->Run... , then typing “cmd”.
- Move to the directory where you have saved lmp_win_no-mpi.exe (e.g. by typing: cd “Documents”).
- At the command prompt, type “lmp_win_no-mpi -in in.lj”, replacing in.lj with the name of your LIGGGHTS(R)-PUBLIC input script.
For the MPI version, which allows you to run LIGGGHTS(R)-PUBLIC under Windows on multiple processors, follow these steps:
- Download and install MPICH2 for Windows.
- You’ll need to use the mpiexec.exe and smpd.exe files from the MPICH2 package. Put them in same directory (or path) as the LIGGGHTS(R)-PUBLIC Windows executable.
- Get a command prompt by going to Start->Run... , then typing “cmd”.
- Move to the directory where you have saved lmp_win_mpi.exe (e.g. by typing: cd “Documents”).
- Then type something like this: “mpiexec -np 4 -localonly lmp_win_mpi -in in.lj”, replacing in.lj with the name of your LIGGGHTS(R)-PUBLIC input script.
- Note that you may need to provide smpd with a passphrase — it doesn’t matter what you type.
- In this mode, output may not immediately show up on the screen, so if your input script takes a long time to execute, you may need to be patient before the output shows up.
- Alternatively, you can still use this executable to run on a single processor by typing something like: “lmp_win_mpi -in in.lj”.
LIGGGHTS(R)-PUBLICの
画面出力については、次のセクションで説明します。それが実行されると、LIGGGHTS(R)-PUBLICは同じ情
報を持つlog.lammpsファイルも書き込みます。
この一連のコマンドは、LIGGGHTS(R)-PUBLIC実行ファイル(lmp_linux)を入力ファイルがある
ディレクトリにコピーすることに注意してください。これは必要ではないかもしれませんが、MPIのあるバージョンでは、
mpirunを起動するディレクトリとして残しておくのではなく、実行可能ファイルの場所に作業ディレクトリをリセット
します(mpirunではなくlmp_linuxを起動する場合)。その場合、LIGGGHTS(R)-PUBLICは
追加の入力ファイルを探し、出力ファイルを作業ディレクトリーではなく実行可能ディレクトリーに書き込みます。これはお
そらくあなたが望むものではありません。
LIGGGHTS(R)-PUBLICが入力スクリプトまたはシミュレーション実行中にエラーを検出した場合、エラー
メッセージが表示され停止するか、警告メッセージージが表示され続行します。
LIGGGHTS(R)-PUBLICが検出できる、またはできない様々な種類のエラー、すべてのERRORおよびWARNINGメッセージのリスト、およびそれらについ
て何をすべきかに ついては、Section_errorsを参照してください。
LIGGGHTS(R)-PUBLICは、単一プロセッサーを含め、任意の数のプロセッサーで問題を実行できます。理論
的には、任意の数のプロセッサと任意のマシンで同じ答えを得なければなりません。実際には、数値の四捨五入が、分子動力
学の位相空間軌道のわずかな相違および最終的な相違を引き起こす可能性がある。
LIGGGHTS(R)-PUBLICは、1つ以上のプロセッサーの物理メモリーに収まるような大きな問題としても実行
で きます。メモリ不足の場合は、より多くのプロセッサで実行するか、小さな問題を設定する必要があります。
The screen output from LIGGGHTS(R)-PUBLIC is described in the next section. As it runs, LIGGGHTS(R)-PUBLIC also writes a log.lammps file with the same information.
Note that this sequence of commands copies the LIGGGHTS(R)-PUBLIC executable (lmp_linux) to the directory with the input files. This may not be necessary, but some versions of MPI reset the working directory to where the executable is, rather than leave it as the directory where you launch mpirun from (if you launch lmp_linux on its own and not under mpirun). If that happens, LIGGGHTS(R)-PUBLIC will look for additional input files and write its output files to the executable directory, rather than your working directory, which is probably not what you want.
If LIGGGHTS(R)-PUBLIC encounters errors in the input script or while running a simulation it will print an ERROR message and stop or a WARNING message and continue. See Section_errors for a discussion of the various kinds of errors LIGGGHTS(R)-PUBLIC can or can’t detect, a list of all ERROR and WARNING messages, and what to do about them.
LIGGGHTS(R)-PUBLIC can run a problem on any number of processors, including a single processor. In theory you should get identical answers on any number of processors and on any machine. In practice, numerical round-off can cause slight differences and eventual divergence of molecular dynamics phase space trajectories.
LIGGGHTS(R)-PUBLIC can run as large a problem as will fit in the physical memory of one or more processors. If you run out of memory, you must run on more processors or setup a smaller problem.
2.7. Command-line options¶
実行時に、LIGGGHTS(R)- PUBLICは、任意の順序で使用できるいくつかのオプションのコマンドラインスイッチを認識します。 完全な単語または、1つまたは2つの文字の省略形を使用できます。
At run time, LIGGGHTS(R)-PUBLIC recognizes several optional command-line switches which may be used in any order. Either the full word or a one-or-two letter abbreviation can be used:
- -e or -echo
- -i or -in
- -h or -help
- -l or -log
- -nc or -nocite
- -p or -partition
- -pl or -plog
- -ps or -pscreen
- -r or -restart
- -ro or -reorder
- -sc or -screen
- -sf or -suffix
- -v or -var
たとえば、lmp_autoは次のように 起動されます。
For example, lmp_auto might be launched as follows:
mpirun -np 16 lmp_auto -v f tmp.out -l my.log -sc none < in.alloy
mpirun -np 16 lmp_auto -var f tmp.out -log my.log -screen none < in.alloy
オプションの詳細は次のとおりです。
Here are the details on the options:
-echo style
コマンドechoのスタイルを設定しま す。 スタイルは、noneまたはscreenまたはlogまたはbothにすることができます。 スタイルに応じて、入力スクリプトから読み取られた各コマンドは、画面および/またはログファイルに出力されます。 これは、入力エラーの原因となっているスクリプトの行を特定するのに便利です。 デフォルト値はlogです。echoスタイルは、入力スクリプト自体でechoコマンドを使用して設定することもできます。
Set the style of command echoing. The style can be none or screen or log or both. Depending on the style, each command read from the input script will be echoed to the screen and/or logfile. This can be useful to figure out which line of your script is causing an input error. The default value is log. The echo style can also be set by using the echo command in the input script itself.
-in file
入力スクリプトとして使用するファイルを 指定します。 これは、1パーティションモードでLIGGGHTS(R)-PUBLICを実行する場合のオプションスイッチです。 指定されていない場合、LIGGGHTS(R)-PUBLICは入力スクリプトをstdinから読み込みます(例:lmp_auto <in.run)。 これは、マルチパーティションモードでLIGGGHTS(R)-PUBLICを実行する場合に必要なスイッチです。複数のプロセッサのすべてがstdinから読み込むこと は できません。
Specify a file to use as an input script. This is an optional switch when running LIGGGHTS(R)-PUBLIC in one-partition mode. If it is not specified, LIGGGHTS(R)-PUBLIC reads its input script from stdin - e.g. lmp_auto < in.run. This is a required switch when running LIGGGHTS(R)-PUBLIC in multi-partition mode, since multiple processors cannot all read from stdin.
-help
LIGGGHTS(R)-PUBLICの ス タイル(atom_style、fix、compute、pair_style、bond_styleなど)ごとにこの 実行可能ファイルにコンパイルされたオプションのリストを出力します。 これは、使用するコマンドが適切なパッケージを介して含まれているかどうかを知るのに役立ちます。 LIGGGHTS(R)-PUBLICはこの情報を表示し、このスイッチを使用するとすぐに終了します。
Print a list of options compiled into this executable for each LIGGGHTS(R)-PUBLIC style (atom_style, fix, compute, pair_style, bond_style, etc). This can help you know if the command you want to use was included via the appropriate package. LIGGGHTS(R)-PUBLIC will print the info and immediately exit if this switch is used.
-log file
状況情報を書き込むための LIGGGHTS(R)-PUBLICのログ・ファイルを指定します。 1パーティションモードでは、スイッチを使用しない場合、LIGGGHTS(R)-PUBLICはlog.lammpsファイルに書き込みます。 このスイッチを使用すると、LIGGGHTS(R)-PUBLICは指定されたファイルに書き込みます。 マルチパーティションモードでは、スイッチを使用しない場合、ハイレベルのステータス情報を含むlog.lammpsファイルが作成されます。 各パーティションは、log.lammps.Nファイルにも書き込みます。ここで、NはパーティションIDです。 スイッチがマルチパーティションモードで指定されている場合、ハイレベルログファイルの名前は "file"で、各パーティションも情報をファイルに記録します。 1パーティションモードとマルチパーティションモードの両方で、指定されたファイルが "none"の場合、ログファイルは作成されません。 入力スクリプトでlogコマンドを使用すると、この設定が上書きされます。 オプション-plogは、パーティションログファイルfile.Nの名前を上書きします。
Specify a log file for LIGGGHTS(R)-PUBLIC to write status information to. In one-partition mode, if the switch is not used, LIGGGHTS(R)-PUBLIC writes to the file log.lammps. If this switch is used, LIGGGHTS(R)-PUBLIC writes to the specified file. In multi-partition mode, if the switch is not used, a log.lammps file is created with hi-level status information. Each partition also writes to a log.lammps.N file where N is the partition ID. If the switch is specified in multi-partition mode, the hi-level logfile is named “file” and each partition also logs information to a file.N. For both one-partition and multi-partition mode, if the specified file is “none”, then no log files are created. Using a log command in the input script will override this setting. Option -plog will override the name of the partition log files file.N.
-nocite
LIGGGHTS(R)-PUBLICの 実行中に使用された特定の引用可能な機能の参照を一覧表示するために通常書き込まれるlog.citeファイルの書き込 みを無効にします。 詳細は、引用ページを参照してください。
Disable writing the log.cite file which is normally written to list references for specific cite-able features used during a LIGGGHTS(R)-PUBLIC run. See the citation page for more details.
-partition 8x2 4 5 ...
マルチパーティションモードで
LIGGGHTS(R)-PUBLICを呼び出します。
LIGGGHTS(R)-PUBLICがPプロセッサ上で実行され、このスイッチが使用されない場合、LIGGGHTS(R)-PUBLICは1つのパーティションで実行
されます。つまり、すべてのPプロセッサが単一のシミュレーションを実行します。
このスイッチを使用すると、Pプロセッサは別々のパーティションに分割され、各パーティションは独自のシミュレーションを実行します。
スイッチの引数は、各パーティションのプロセッサ数を指定します。
MxNという形式の引数は、それぞれがN個のプロセッサを持つM個のパーティションを意味します。
Nという形式の引数は、N個のプロセッサを持つ単一のパーティションを意味します。
すべてのパーティションのプロセッサーの合計はPに等しくなければなりません。したがって、 "-partition
8x2 4 5"というコマンドは10個のパーティションを持ち、合計25個のプロセッサー上で実行されます。
複数のパーティションを使用して、1つの入力スクリプトから複数の独立したシミュレータを実行するには、マニュアルの
Section_howto 4を参照してください。
この文脈では、worldスタイル変数とuniverseスタイル変数が有用です。
Invoke LIGGGHTS(R)-PUBLIC in multi-partition mode. When LIGGGHTS(R)-PUBLIC is run on P processors and this switch is not used, LIGGGHTS(R)-PUBLIC runs in one partition, i.e. all P processors run a single simulation. If this switch is used, the P processors are split into separate partitions and each partition runs its own simulation. The arguments to the switch specify the number of processors in each partition. Arguments of the form MxN mean M partitions, each with N processors. Arguments of the form N mean a single partition with N processors. The sum of processors in all partitions must equal P. Thus the command “-partition 8x2 4 5” has 10 partitions and runs on a total of 25 processors.
To run multiple independent simulatoins from one input script, using multiple partitions, see Section_howto 4 of the manual. World- and universe-style variables are useful in this context.
-plog file
パーティションログファイルのベース名を 指定すると、パーティションNはログ情報をfile.Nに書き込みます。 fileがnoneの場合、パーティションログファイルは作成されません。 これにより、-logコマンドラインオプションで指定されたファイル名が上書きされます。 このオプションは、多数のパーティションを 操作し、パー ティションログファイルを抑制(-plog none)するか、サブディレクトリに配置(-plog replica_files / log.lammps)す る場合に便利です。このオプションを使用しない場合は、ログファイル パーティションNの場合、log.lammps.Nまたは-logコマンド-lineオプションで指定されたものとなります。
Specify the base name for the partition log files, so partition N writes log information to file.N. If file is none, then no partition log files are created. This overrides the filename specified in the -log command-line option. This option is useful when working with large numbers of partitions, allowing the partition log files to be suppressed (-plog none) or placed in a sub-directory (-plog replica_files/log.lammps) If this option is not used the log file for partition N is log.lammps.N or whatever is specified by the -log command-line option.
-pscreen file
パーティション画面ファイルのベース名を 指定すると、パーティションNは画面情報をfile.Nに書き込みます。 fileがnoneの場合、パーティション画面ファイルは作成されません。 これにより、-screenコマンドラインオプションで指定されたファイル名が上書きされます。 このオプションは、多数のパーティションを操作し、パーティション画面ファイルを抑制(-pscreen none)するか、サブディレクトリ(-pscreen replica_files / screen)に配置する場合に便利です。 このオプションが使用されていない場合は、パーティションNのスクリーンファイルはscreen.Nか-screenコマンドラインオプションで指定されたものとなりま す。。
Specify the base name for the partition screen file, so partition N writes screen information to file.N. If file is none, then no partition screen files are created. This overrides the filename specified in the -screen command-line option. This option is useful when working with large numbers of partitions, allowing the partition screen files to be suppressed (-pscreen none) or placed in a sub-directory (-pscreen replica_files/screen). If this option is not used the screen file for partition N is screen.N or whatever is specified by the -screen command-line option.
-restart restartfile datafile
リスタートファイルをデータファイルに変 換 し、すぐに終了します。 これは、次の2行入力スクリプトが実行された場合と同じ動作です。
Convert the restart file into a data file and immediately exit. This is the same operation as if the following 2-line input script were run:
read_restart restartfile
write_data datafile
指定したrestartfileおよび datafileには、read_restartおよびwrite_dataコマンドの説明に従って、ワイルドカード文 字( "*"、% ")を使用できます。 しかし、file。*のようなファイル名は、 "*"文字のシェル展開を避けるために引用符で囲む必要があります。
Note that the specified restartfile and datafile can have wild-card characters (“*”,%”) as described by the read_restart and write_data commands. But a filename such as file.* will need to be enclosed in quotes to avoid shell expansion of the “*” character.
-reorder nth N
-reorder custom filename
いくつかの方法の1つで、
LIGGGHTS(R)-PUBLICをインスタンス化するために使用されたMPIコミュニケータのプロセッサを並べ替
えます。オリジナルのMPIコミュニケータは、0からP-1までのすべてのPプロセッサをランク付けします。これらのラ
ンクの物理プロセッサへのマッピングは、LIGGGHTS(R)-PUBLICが始まる前にMPIによって実行されま
す。ランクオーダーを変更することが有用な場合もあります。例えば、各ノード内のコアが所望の順序でランク付けされるこ
とを保証する。または2つのパーティションでrun_style verlet /
splitコマンドを使用して、特定のKspaceプロセッサ(2番目のパーティションにある)が1番目のパーティションの特定のプロセッサセットと一致することを保証し
ます。詳細については、Section_accelerateのドキュメントページを参照してください。
キーワードnthを設定Nで使用すると、N番目のすべてのプロセッサがランキングの最後に移動することを意味します。こ
れは、-partitionコマンドラインスイッチを使用して2つのパーティションでrun_style verlet
/
splitコマンドを使用する場合に便利です。プロセッサの第1セットは第1パーティションにあり、第2セットは第2パーティションにある。
-reorderコマンドラインスイッチは、これを変更して、1番目のパーティションの1番目のprocsと2番目の
パーティションの1つのprocを連続して並べ替えることができます。例えば、1つの物理ノード上のコアとして使用する
ことで、これにより、パフォーマンスが向上します。例えば、 "-reorder nth 4"と
"-partition 9 3"を使用し、12個のプロセッサで実行している場合、プロセッサは順序を再変更します。
Reorder the processors in the MPI communicator used to instantiate LIGGGHTS(R)-PUBLIC, in one of several ways. The original MPI communicator ranks all P processors from 0 to P-1. The mapping of these ranks to physical processors is done by MPI before LIGGGHTS(R)-PUBLIC begins. It may be useful in some cases to alter the rank order. E.g. to insure that cores within each node are ranked in a desired order. Or when using the run_style verlet/split command with 2 partitions to insure that a specific Kspace processor (in the 2nd partition) is matched up with a specific set of processors in the 1st partition. See the Section_accelerate doc pages for more details.
If the keyword nth is used with a setting N, then it means every Nth processor will be moved to the end of the ranking. This is useful when using the run_style verlet/split command with 2 partitions via the -partition command-line switch. The first set of processors will be in the first partition, the 2nd set in the 2nd partition. The -reorder command-line switch can alter this so that the 1st N procs in the 1st partition and one proc in the 2nd partition will be ordered consecutively, e.g. as the cores on one physical node. This can boost performance. For example, if you use “-reorder nth 4” and “-partition 9 3” and you are running on 12 processors, the processors will be reordered from
0 1 2 3 4 5 6 7 8 9 10 11
to
0 1 2 4 5 6 8 9 10 3 7 11
so that the processors in each partition will be
0 1 2 4 5 6 8 9 10
3 7 11
各パーティションのプロセッサがクアッド
コアノードに対して最適にグループ化されるようにする方法については、「processors」コマンドを参照してくだ
さい。
キーワードがcustomの場合、プロセッサランクの順列を指定するファイルも指定されます。
リオーダーファイルのフォーマットは次のとおりです。
任意の数の最初の空白またはコメント行(「#」文字で始まる)が存在することができます。
これらには、次の形式のP行が続く必要があります。
See the “processors” command for how to insure processors from each partition could then be grouped optimally for quad-core nodes.
If the keyword is custom, then a file that specifies a permutation of the processor ranks is also specified. The format of the reorder file is as follows. Any number of initial blank or comment lines (starting with a “#” character) can be present. These should be followed by P lines of the form:
I J
ここで、PはLIGGGHTS(R)-
PUBLICが起動されたプロセッサーの数です。マルチパーティションモード(上記の-partitionスイッチを参
照)で実行している場合、Pはすべてのパーティション内のプロセッサーの総数です。
IおよびJ値は、P個のプロセッサの順列を記述する。すべてのIとJは、0からP-1までの値でなければなりません。
P Iの値の集合では、すべてのproc IDが正確に1回現れるはずです。 P
J値の集合についても同上です。単一のI、Jペアリングは、元のMPIコミュニケータのランクIの物理プロセッサが、並べ替えられたコミュニケータでランクJを持つこと
を意味します。
ランク付けは、物理プロセッサの順序を指定する環境変数か、各MPIランクに割り当てる物理プロセッサを指定する設定
ファイルによって、多くのMPI実装で指定することもできます。
-reorderスイッチは、MPIそのものに依存することなく、これを行うポータブルな方法を提供します。物理プロセッサーの最終割り当てに関する情報を
LIGGGHTS(R)-PUBLICシミュレーションドメインに出力する方法については、prosessor
outコマンド を参照してください。
where P is the number of processors LIGGGHTS(R)-PUBLIC was launched with. Note that if running in multi-partition mode (see the -partition switch above) P is the total number of processors in all partitions. The I and J values describe a permutation of the P processors. Every I and J should be values from 0 to P-1 inclusive. In the set of P I values, every proc ID should appear exactly once. Ditto for the set of P J values. A single I,J pairing means that the physical processor with rank I in the original MPI communicator will have rank J in the reordered communicator.
Note that rank ordering can also be specified by many MPI implementations, either by environment variables that specify how to order physical processors, or by config files that specify what physical processors to assign to each MPI rank. The -reorder switch simply gives you a portable way to do this without relying on MPI itself. See the processors out command for how to output info on the final assignment of physical processors to the LIGGGHTS(R)-PUBLIC simulation domain.
-screen file
LIGGGHTS(R)-PUBLICの 画面情報を書き込むファイルを指定します。 1パーティションモードでは、スイッチを使用しない場合、LIGGGHTS(R)-PUBLICが画面に書き込みます。 このスイッチを使用すると、LIGGGHTS(R)-PUBLICは指定されたファイルに書き込むため、画面出力は表示 されません。 マルチパーティションモードでは、スイッチを使用しないと、ハイレベルのステータス情報が画面に書き込まれます。 各パーティションはscreen.Nファイルにも書き込みます。ここで、NはパーティションIDです。 スイッチがマルチパーティションモードで指定されている場合、ハイレベルスクリーンダンプの名前は "file"であり、各パーティションは画面情報もファイルに書き込みます。 1パーティションモードとマルチパーティションモードの両方で、指定されたファイルが "none"の場合、画面出力は実行されません。 オプション-pscreenは、パーティション画面ファイルfile.Nの名前を上書きします。
Specify a file for LIGGGHTS(R)-PUBLIC to write its screen information to. In one-partition mode, if the switch is not used, LIGGGHTS(R)-PUBLIC writes to the screen. If this switch is used, LIGGGHTS(R)-PUBLIC writes to the specified file instead and you will see no screen output. In multi-partition mode, if the switch is not used, hi-level status information is written to the screen. Each partition also writes to a screen.N file where N is the partition ID. If the switch is specified in multi-partition mode, the hi-level screen dump is named “file” and each partition also writes screen information to a file.N. For both one-partition and multi-partition mode, if the specified file is “none”, then no screen output is performed. Option -pscreen will override the name of the partition screen files file.N.
-var name value1 value2 ...
入力スクリプトの読み込み時に置換目的で 定義される変数を指定します。 "Name"は変数名で、単一の文字(入力スクリプトで$ xとして参照される)または完全な文字列($ {abc}として参照される)にすることができます。 indexスタイルの変数が作成され、それに続く値が設定されます。例えばファイル名のセット。 このコマンドラインオプションを使用することは、入力スクリプトの先頭に "variable name index value1 value2 ..."という行を置くことと同じです。 コマンドライン引数としてindex変数を定義すると、index変数を再定義することができないため、入力スクリプト内の同じindex変数の設定が上書きされま す。 indexやその他の種類の変数を定義する方法についてはvariableコマンドを、入力スクリプトで変数を使用する方法の詳細については、このセクションを参照し てください。
Specify a variable that will be defined for substitution purposes when the input script is read. “Name” is the variable name which can be a single character (referenced as $x in the input script) or a full string (referenced as ${abc}). An index-style variable will be created and populated with the subsequent values, e.g. a set of filenames. Using this command-line option is equivalent to putting the line “variable name index value1 value2 ...” at the beginning of the input script. Defining an index variable as a command-line argument overrides any setting for the same index variable in the input script, since index variables cannot be re-defined. See the variable command for more info on defining index and other kinds of variables and this section for more info on using variables in input scripts.
Note
現在、コ マンドラインパーサーは新しいスイッチを示すために " - "で始まる引数を探します。 したがって、変数のいずれかが " - "で始まる場合、複数の変数値を指定することはできません。 例えば、負の数値です。 最初の値1が自動的にスキップされる場合は、 " - "で始まっても問題ありません。
Currently, the command-line parser looks for arguments that start with “-” to indicate new switches. Thus you cannot specify multiple variable values if any of they start with a “-”, e.g. a negative numeric value. It is OK if the first value1 starts with a “-”, since it is automatically skipped.
2.8. LIGGGHTS(R)-PUBLIC screen output¶
LIGGGHTS(R)-PUBLICは 入力スクリプトを読み込むので、シミュレーションのセットアップに必要な重要なアクションについて、画面とログファイル の両方に情報を出力します。 シミュレーションを開始する準備ができたら、LIGGGHTS(R)-PUBLICはさまざまな初期化を実行し、シミュレーションに必要なメモリー量(プロセッサーあたり のメガバイト単位)を出力します。 また、システムの初期熱力学的状態の詳細も表示されます。 運転自体の間、熱力学的情報は数タイムステップごとに定期的に出力されます。 実行が終了すると、LIGGGHTS(R)-PUBLICはシミュレーションの最終的な熱力学的状態と合計実行時間を出力します。 次に、シミュレーションのCPU時間とストレージ要件に関する統計を追加します。 統計の例を以下に示します。
As LIGGGHTS(R)-PUBLIC reads an input script, it prints information to both the screen and a log file about significant actions it takes to setup a simulation. When the simulation is ready to begin, LIGGGHTS(R)-PUBLIC performs various initializations and prints the amount of memory (in MBytes per processor) that the simulation requires. It also prints details of the initial thermodynamic state of the system. During the run itself, thermodynamic information is printed periodically, every few timesteps. When the run concludes, LIGGGHTS(R)-PUBLIC prints the final thermodynamic state and a total run time for the simulation. It then appends statistics about the CPU time and storage requirements for the simulation. An example set of statistics is shown here:
Loop time of 49.002 on 2 procs for 2004 atoms
Pair time (%) = 35.0495 (71.5267)
Bond time (%) = 0.092046 (0.187841)
Kspce time (%) = 6.42073 (13.103)
Neigh time (%) = 2.73485 (5.5811)
Comm time (%) = 1.50291 (3.06703)
Outpt time (%) = 0.013799 (0.0281601)
Other time (%) = 2.13669 (4.36041)
Nlocal: 1002 ave, 1015 max, 989 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 8720 ave, 8724 max, 8716 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 354141 ave, 361422 max, 346860 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Total # of neighbors = 708282
Ave neighs/atom = 353.434
Ave special neighs/atom = 2.34032
Number of reneighborings = 42
Dangerous reneighborings = 2
最初のセクションでは、CPUの実行時間
(秒単位)を主要カテゴリに分類して示します。
2番目のセクションでは、所有するatom数(Nlocal)、ゴーストatom(Nghost)、およびプロセッサあたりに保存されているペアneighborをリスト
します。最大値
と最小値は、10ビンの分布を示すヒストグラムを使用して、これらの値のプロセッサ間での分散を示します。ヒストグラム
カウントの総数は、プロセッサの数に等しい。
最後のセクションでは、LIGGGHTS(R)-PUBLICが追跡しているペアneighbor近傍と特別
neibourの集計統
計を示します(special_bondsコマンドを参照)。実行中にneibourリストが再構築された回数と、潜在的に「危険
な」再構築の回数が表示されます。atom移動がneibourリストの再構築をトリガーした場合
(neigh_modifyコマンド
を参照)、危険な再隣接は、最初のタイムステップでトリガーされたものであることが確認されたということです。このカウントがゼロ
でない場合、再構築が行われる前にneighborスキンの距離を超えて移動するatomによって力の相互作用が失われ
ないよう に、遅延係数を減らすことができます。
最初の行には、最初と最後のエネルギーだけでなく、最後から2番目の繰り返しのエネルギーが表示されます。次の2行は、
エネルギーの勾配(すべてのatomに対する力)の尺度を与える。 2ノルムは、この力ベクトルの「長さ」です。
inf-normは最大の成分です。最後の2行は、ミニマイザが必要とする反復回数と力の評価の統計です。探索方向に1dラインの最小化を実行するために、通
常、各反復で複数の力評価が行われる。
The first section gives the breakdown of the CPU run time (in seconds) into major categories. The second section lists the number of owned atoms (Nlocal), ghost atoms (Nghost), and pair-wise neighbors stored per processor. The max and min values give the spread of these values across processors with a 10-bin histogram showing the distribution. The total number of histogram counts is equal to the number of processors.
The last section gives aggregate statistics for pair-wise neighbors and special neighbors that LIGGGHTS(R)-PUBLIC keeps track of (see the special_bonds command). The number of times neighbor lists were rebuilt during the run is given as well as the number of potentially “dangerous” rebuilds. If atom movement triggered neighbor list rebuilding (see the neigh_modify command), then dangerous reneighborings are those that were triggered on the first timestep atom movement was checked for. If this count is non-zero you may wish to reduce the delay factor to insure no force interactions are missed by atoms moving beyond the neighbor skin distance before a rebuild takes place.
The first line lists the initial and final energy, as well as the energy on the next-to-last iteration. The next 2 lines give a measure of the gradient of the energy (force on all atoms). The 2-norm is the “length” of this force vector; the inf-norm is the largest component. The last 2 lines are statistics on how many iterations and force-evaluations the minimizer required. Multiple force evaluations are typically done at each iteration to perform a 1d line minimization in the search direction.