-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add socket mode compatibility #232
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
42be6af
cherry pick from TT & LRT's commit for socket mode
alchem0x2A 8cfeeeb
revert diff checkers
alchem0x2A ee39314
add use_socket in build
alchem0x2A 3e4e596
update tests examples
alchem0x2A a94d0a1
remove spDFT from initialization.c
alchem0x2A 9baf1e5
update makefile for socket
alchem0x2A 1781895
add debug mode in conda workflow default
alchem0x2A dc94979
multiple checks for the initialization
alchem0x2A 890ef39
add checks for test all
alchem0x2A b6551bd
use conda to install sparc-x-api
alchem0x2A 8b0d587
remove the quick socket tests
alchem0x2A 9e22c73
update changelog
alchem0x2A 1d916d1
changelog typo
alchem0x2A 4c52587
declaration for calculate_properties in header
alchem0x2A File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks,c]{} \label{Socket} | ||
|
||
\begin{center} | ||
\Huge \textbf{Socket communication in SPARC} | ||
\end{center} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\textbf{Brief introduction}} \label{SOCKET_INTRO} | ||
|
||
The socket communication layer allows SPARC to be controlled by a socket server that is compatible with | ||
\href{https://ipi-code.org/i-pi/introduction.html}{i-PI} protocol. The SPARC source code should be compiled with the | ||
\texttt{USE\_SOCKET=1} option. | ||
|
||
To start a SPARC program with socket interface, use either option: | ||
\begin{itemize} | ||
\item Option 1: Specify socket address in command line | ||
\begin{itemize} | ||
\item To start an INET socket, use\\ | ||
\texttt{\$ mpirun -n 8 ./lib/sparc -socket localhost:12345 -name filename} | ||
|
||
\item To start a UNIX socket, use\\ | ||
\texttt{\$ mpirun -n 8 ./lib/sparc -socket /tmp/sparc.socket:unix -name filename} | ||
\end{itemize} | ||
|
||
\item Option 2: Provide \texttt{.inpt} parameters | ||
|
||
Visit the following pages for parameter specifications. | ||
Any parameter \texttt{SPARC\_*} in the \texttt{.inpt} file | ||
will overwrite the settings from command line. | ||
\end{itemize} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\textbf{Output files}} \label{SOCKET_OUTPUT} | ||
|
||
The following files will be generated in the socket mode and may slightly | ||
differ from standard SPARC outputs: | ||
\begin{itemize} | ||
\item \texttt{.out}: All the SCF steps will be written to \texttt{.out} file, similar to a relaxation / MD calculation. | ||
\item \texttt{.static}: It is concatenated from all single point | ||
steps. In addition to normal \texttt{.static} output, the lattice | ||
information are also recorded. | ||
\end{itemize} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\texttt{SOCKET\_FLAG}} \label{SOCKET_FLAG} | ||
\vspace*{-12pt} | ||
\begin{columns} | ||
\column{0.4\linewidth} | ||
\begin{block}{Type} | ||
Integer | ||
\end{block} | ||
|
||
\begin{block}{Default} | ||
0 | ||
\end{block} | ||
|
||
\column{0.4\linewidth} | ||
\begin{block}{Unit} | ||
No unit | ||
\end{block} | ||
|
||
\begin{block}{Example} | ||
\texttt{SOCKET\_FLAG}: 1 | ||
\end{block} | ||
\end{columns} | ||
|
||
\begin{block}{Description} | ||
Flag for starting the socket communication layer. It is equivalent to the \texttt{-socket} switch of command line. | ||
|
||
Setting \texttt{SOCKET\_FLAG: 1} will disable \texttt{MD\_FLAG} and \texttt{RELAX\_FLAG}. | ||
|
||
\end{block} | ||
|
||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\texttt{SOCKET\_HOST}} \label{SOCKET_HOST} | ||
\vspace*{-12pt} | ||
\begin{columns} | ||
\column{0.4\linewidth} | ||
\begin{block}{Type} | ||
String | ||
\end{block} | ||
|
||
\begin{block}{Default} | ||
localhost | ||
\end{block} | ||
|
||
\column{0.4\linewidth} | ||
\begin{block}{Unit} | ||
No unit | ||
\end{block} | ||
|
||
\begin{block}{Example} | ||
\texttt{SOCKET\_HOST}: 127.0.0.1 | ||
\end{block} | ||
\end{columns} | ||
|
||
\begin{block}{Description} | ||
Host name of the socket address that SPARC listens to. If it's an | ||
INET socket, it is the address of the interface. For a UNIX socket, | ||
it is the filename of the socket file | ||
(e.g. \texttt{/tmp/sparc.socket}). | ||
\end{block} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\texttt{SOCKET\_PORT}} \label{SOCKET_PORT} | ||
\vspace*{-12pt} | ||
\begin{columns} | ||
\column{0.4\linewidth} | ||
\begin{block}{Type} | ||
Integer | ||
\end{block} | ||
|
||
\begin{block}{Default} | ||
None | ||
\end{block} | ||
|
||
\column{0.4\linewidth} | ||
\begin{block}{Unit} | ||
No unit | ||
\end{block} | ||
|
||
\begin{block}{Example} | ||
\texttt{SOCKET\_PORT}: 12345 | ||
\end{block} | ||
\end{columns} | ||
|
||
\begin{block}{Description} | ||
When SPARC connects to an INET socket server, it is the port number. The \texttt{SOCKET\_PORT} has no effect for a UNIX socket. | ||
\end{block} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\texttt{SOCKET\_INET}} \label{SOCKET_INET} | ||
\vspace*{-12pt} | ||
\begin{columns} | ||
\column{0.4\linewidth} | ||
\begin{block}{Type} | ||
Integer | ||
\end{block} | ||
|
||
\begin{block}{Default} | ||
None | ||
\end{block} | ||
|
||
\column{0.4\linewidth} | ||
\begin{block}{Unit} | ||
No unit | ||
\end{block} | ||
|
||
\begin{block}{Example} | ||
\texttt{SOCKET\_INET}: 0 | ||
\end{block} | ||
\end{columns} | ||
|
||
\begin{block}{Description} | ||
1 for INET socket, 0 for UNIX socket. If no set in \texttt{.inpt} | ||
file, its value is determined by the \texttt{-socket address:port} | ||
command line switch. | ||
\end{block} | ||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\begin{frame}[allowframebreaks]{\texttt{SOCKET\_MAX\_NITER}} \label{SOCKET_MAX_NITER} | ||
\vspace*{-12pt} | ||
\begin{columns} | ||
\column{0.4\linewidth} | ||
\begin{block}{Type} | ||
Integer | ||
\end{block} | ||
|
||
\begin{block}{Default} | ||
10000 | ||
\end{block} | ||
|
||
\column{0.4\linewidth} | ||
\begin{block}{Unit} | ||
No unit | ||
\end{block} | ||
|
||
\begin{block}{Example} | ||
\texttt{SOCKET\_MAX\_NITER}: 10000 | ||
\end{block} | ||
\end{columns} | ||
|
||
\begin{block}{Description} | ||
Maximum number of ionic SCF steps in the socket mode. As a socket | ||
client, SPARC will terminate after \texttt{SOCKET\_MAX\_NITER} steps | ||
are called. | ||
\end{block} | ||
|
||
|
||
\end{frame} | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
\documentclass[xcolor=dvipsnames,t]{beamer} | ||
%\usepackage[utf8]{inputenc} | ||
\usepackage{verbatim} % for comment | ||
\usetheme{Madrid} | ||
\usecolortheme{seahorse} | ||
\usepackage{beamerouterthemesplit} | ||
\usepackage[T1]{fontenc} | ||
|
||
\setbeamerfont{institute}{size=\normalsize} | ||
|
||
\title[] {SPARC - MLFF \\ {\normalsize Machine-learned force fields} \\ {\small User guide}} | ||
%\author{} | ||
%\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, } | ||
|
||
\institute[] | ||
{ | ||
Material Physics \& Mechanics Group \\ | ||
PI: Phanish Suryanarayana \\ | ||
%Main Developers: Shashikant Kumar, Abhiraj Sharma\\ | ||
%Collaborators: J.E. Pask (LLNL)\\ | ||
Georgia Institute of Technology \\ | ||
\hyperlink{Contributors}{Contributors}\\ | ||
\hyperlink{Citation}{Citation} \\ | ||
\hyperlink{Acknowledgements}{Acknowledgements} | ||
} | ||
|
||
\date{} | ||
\setbeamertemplate{frametitle continuation}{} | ||
\setbeamertemplate{navigation symbols}{} | ||
\setbeamercolor{block title}{bg=Apricot!50,fg=black} | ||
%\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{} | ||
%\addtobeamertemplate{block end}{}{\vskip -\smallskipamount} | ||
\addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{} | ||
\addtobeamertemplate{block end}{}{\vspace*{-0.6pt}} | ||
\hypersetup{colorlinks, | ||
citecolor=violet, | ||
linkcolor=blue, | ||
menucolor=white, | ||
anchorcolor=yellow | ||
filecolor=pink, | ||
} | ||
|
||
|
||
\setbeamertemplate{footline}{ | ||
\hbox{% | ||
\begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}% | ||
\usebeamerfont{title in head/foot}% | ||
\insertshorttitle \hfill | ||
\insertsection \hfill | ||
\insertframenumber{} / \inserttotalframenumber | ||
\end{beamercolorbox}}% | ||
} | ||
|
||
\let\otp\titlepage | ||
\renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}} | ||
|
||
|
||
%\includeonly{Introduction,Stress,MD,Optimization,Print} | ||
%\includeonly{Introduction} | ||
|
||
\begin{document} | ||
|
||
%\frame{\titlepage} | ||
|
||
\begin{frame}[plain] | ||
\titlepage | ||
\end{frame} | ||
|
||
\include{Introduction} | ||
\include{mlff} | ||
|
||
|
||
\end{document} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is for compatibility with the json API. I'm not sure if it makes more sense to change the file names or just the search string in the API. In fact, I think it makes more sense to allow the api to find files that are agnostic to whether Manual appears first or second. I think the current formulation is a bit brittle as it is entirely possible the file will be renamed again in future commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The current way API searches the doc is to scan both main Manual.tex and any Manual_*.tex in sub-directories. I'll modify to make sure the main doc tex file is scanned regardless of the name, and keep either one of mlff_manual.tex or Manual_mlff.tex