Skip to content

Commit 4f7bff9

Browse files
committed
Patches generated by Claude
1 parent ff0c8bf commit 4f7bff9

2 files changed

Lines changed: 118 additions & 1 deletion

File tree

docs/manuals/mcstas/intro.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ \section{Overview}
297297
present here an extensive list of corrections, and we let the reader
298298
refer to this bug reporting service for details. Only important
299299
changes are indicated in the CHANGES document.
300+
In addition to this manual, extensive and up-to-date documentation is
301+
maintained on the \McStas/McCode GitHub wiki~\cite{Wiki}:
302+
\begin{center}
303+
\url{https://github.com/mccode-dev/McCode/wiki}
304+
\end{center}
305+
The wiki covers end-user tutorials, component development guides, GPU
306+
acceleration, and migration from \McStas~2.x to 3.x.
300307
\item Chapter~\ref{s:MCtechniques} concerns Monte Carlo techniques
301308
and simulation strategies in general
302309
\item Chapter~\ref{c:running} includes a brief introduction to the

docs/manuals/mcstas/running.tex

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,32 @@ \section{Installation and updates}
5656
In case of problems, write the support mailing list,
5757
or contact the authors.
5858

59-
%-------------------------------------------------------------------------------
59+
% -------------------------------------------------------------------------------
60+
\subsubsection{Installation via conda-forge (recommended)}
61+
\label{s:install-conda}
62+
63+
The recommended installation method for all supported platforms---Linux,
64+
macOS, and Windows---is via the \texttt{conda-forge} channel. Once a
65+
conda-compatible environment manager such as Miniforge or Mambaforge is
66+
available, \McStas can be installed into a fresh conda environment:
67+
68+
\begin{verbatim}
69+
conda create -n mcstas -c conda-forge mcstas
70+
conda activate mcstas
71+
mcgui
72+
\end{verbatim}
73+
74+
On Windows a dedicated \texttt{mcstas-conda} batch script is provided by
75+
the installer. After it completes, use the \emph{mcstas-shell} desktop
76+
shortcut and issue \texttt{mcgui} to start the graphical interface.
77+
Arm64 Windows is also supported via this route.
78+
79+
For full platform-specific installation instructions, including Linux
80+
package management and macOS options, see:
81+
\begin{center}
82+
\url{https://github.com/mccode-dev/McCode/tree/main/INSTALL-McStas}
83+
\end{center}
84+
6085
\subsection{Important note for Windows users}
6186
\index{Windows!file and directory names with spaces}
6287
\index{Windows!Perl distribution}
@@ -245,6 +270,33 @@ \subsection{Code generation options}
245270
Finally, the \verb+--verbose+ option will list the components and libraries being
246271
included in the instrument.
247272

273+
\subsubsection{Alternative code generator: \texttt{mccode-antlr}}
274+
\label{s:antlr}
275+
276+
From \McStas~3.5 onwards an alternative code generator,
277+
\texttt{mcstas-antlr}, is available alongside the classic generator.
278+
It is built on the ANTLR parser framework rather than the traditional
279+
\texttt{lex}/\texttt{yacc} toolchain, is implemented primarily in Python,
280+
and is a candidate replacement for the default generator in future releases.
281+
282+
Select it on a per-run basis with the \texttt{--cogen} flag:
283+
\begin{verbatim}
284+
mcrun --cogen=mcstas-antlr MyInstrument.instr -n 1e8
285+
\end{verbatim}
286+
287+
The active code generator can also be set permanently by editing the
288+
\texttt{MCCOGEN} field in \texttt{mccode\_config.json}. This file is
289+
accessible from the command line with:
290+
\begin{verbatim}
291+
mcrun --edit-user-config
292+
\end{verbatim}
293+
or via the \emph{Save/Edit configuration} dialogue inside \texttt{mcgui}.
294+
295+
At the time of the \McStas~3.6 release, \texttt{mcstas-antlr} is close to
296+
feature-complete for CPU simulations with a few more issues for GPU/OpenACC
297+
simulations.
298+
299+
248300
%-------------------------------------------------------------------------------
249301
\subsection{Specifying the location of files}
250302
\label{s:files}
@@ -1247,6 +1299,54 @@ \subsection{Running simulations on the commandline (mcrun)}
12471299
The \verb+-h+ option will list valid options. The \verb+mcrun+ front-end
12481300
requires a working installation of Perl to run.
12491301

1302+
\subsection{GPU acceleration via OpenACC}
1303+
\label{s:gpu}
1304+
1305+
\McStas~3.x supports GPU-accelerated simulations through the OpenACC
1306+
framework, enabling substantial speed-ups over CPU-only execution on
1307+
compatible NVIDIA hardware.
1308+
1309+
\subsubsection{Requirements}
1310+
1311+
\begin{itemize}
1312+
\item \textbf{Compiler:} NVIDIA HPC SDK version~20.x or newer. The
1313+
free Community Edition is sufficient.
1314+
\item \textbf{Hardware:} A CUDA-capable NVIDIA GPU with an up-to-date
1315+
driver.
1316+
\item \textbf{Platform:} GPU support is currently available on Linux
1317+
only. Windows is not yet supported for OpenACC by NVIDIA; Windows
1318+
users wishing to use GPU acceleration should do so via
1319+
WSL~2 running a Linux distribution.
1320+
\end{itemize}
1321+
1322+
\subsubsection{Running a GPU-accelerated simulation}
1323+
1324+
Pass the \texttt{--openacc} flag to \texttt{mcrun}:
1325+
\begin{verbatim}
1326+
mcrun --openacc MyInstrument.instr -n 1e9
1327+
\end{verbatim}
1328+
1329+
\paragraph{Combined multi-core + GPU execution.}
1330+
It is also possible to use both CPU cores and the GPU simultaneously.
1331+
Enable this by adding the following to the \texttt{OACCFLAGS} field of
1332+
your \texttt{mccode\_config.json}:
1333+
\begin{verbatim}
1334+
"OACCFLAGS": "-fast -Minfo=accel -acc=gpu,multicore
1335+
-gpu=managed -DOPENACC -DMULTICORE"
1336+
\end{verbatim}
1337+
1338+
\subsubsection{Further information}
1339+
1340+
GPU terminology specific to \McStas/McXtrace~3 and detailed debugging
1341+
tips are documented on the McCode wiki:
1342+
\begin{itemize}
1343+
\item GPU terminology table:\\
1344+
\url{https://github.com/mccode-dev/McCode/wiki/McStas-McXtrace-3-and-GPU-terminology-(table)}
1345+
\item GPU debugging tips:\\
1346+
\url{https://github.com/mccode-dev/McCode/wiki/GPU-Debugging-tips}
1347+
\end{itemize}
1348+
1349+
12501350

12511351
%-------------------------------------------------------------------------------
12521352
\subsection{Graphical display of simulations (mcdisplay)}
@@ -1532,6 +1632,16 @@ \subsection{Creating and viewing the library, component/instrument help and
15321632
format. To use the \verb+mcdoc+ front-end, the program Perl should be
15331633
available.
15341634

1635+
\paragraph{Online wiki.}
1636+
In addition to this manual, extensive and frequently updated documentation
1637+
is maintained on the McCode GitHub wiki~\cite{Wiki}:
1638+
\begin{center}
1639+
\url{https://github.com/mccode-dev/McCode/wiki}
1640+
\end{center}
1641+
The wiki includes end-user guides, component development howtos, GPU
1642+
acceleration information, and migration guides from \McStas~2.x to 3.x.
1643+
1644+
15351645
%-------------------------------------------------------------------------------
15361646
\subsection{Translating \MCS components for Vitess (mcstas2vitess)}
15371647
\label{s:mcstas2vitess}

0 commit comments

Comments
 (0)