\section{Global Configuration}
\label{sec:config}

jModelTest contains some global configuration parameters in the file conf/jmodeltest.conf. In case you are sharing the jModelTest distribution between multiple users, it is possible to set a local configuration file for your own using the {\bf \texttt{--}set-local-config} argument in the command file. You can also change one or several properties by using the {\bf \texttt{--}set-property} argument. See Page~\pageref{pp:args-config} for the reference about this commands.

For example:
\begin{lstlisting}
$ java -jar jModelTest -d example-data/aP6.phy -f -i -g 4 -s 11 --set-property log-dir=myLogDir --set-property exe-dir=path/to/my/phyml
\end{lstlisting}

This file has the following content:

\begin{verbatim}
#######################################
# jModelTest Configuration properties #
#######################################

##########################################################
#                                                        #
# Automatic Logging                                      #
#                                                        #
# If html-logging is "enabled", every time the user runs #
# jModelTest, a new html log file will be created in the #
# log directory.                                         #
# If phyml-logging is "enabled", PhyML streams are saved #
# Default log directory is $JMODELTEST_HOME/log, but can #
# be modified using the log-dir property.                #
#                                                        #
##########################################################
checkpointing  = enabled
html-logging   = enabled
phyml-logging  = enabled
log-dir        = log

##########################################################
#                                                        #
# Phyml Binaries path                                    #
#                                                        #
# By default, jModelTest will search for the PhyML       #
# executables in $JMODELTEST_HOME/exe/phyml. User can    #
# define a different path, wether absolute (starting     #
# with '/' or 'C:\') or relative to $JMODELTEST_HOME     #
# directory using exe-dir property.                      #
#                                                        #
# If an usable version of PhyML is installed system-wide #
# (for example, from the Ubuntu/Debian repositories),    #
# the user can set 'global-phyml-exe' property to true   #
# and jModelTest will use the global binary instead of   #
# local ones.                                            #
#                                                        #
##########################################################
global-phyml-exe    = false
exe-dir	            = exe/phyml

##########################################################
#                                                        #
# Thread Scheduling Configuration                        #
#                                                        #
# Properties below are specific properties for the       #
# thread scheduling behavior. Those are the default      #
# number of threads for executing each sort of model.    #
#                                                        #
# If the specified number of threads is higher than the  #
# total number of cores in the machine, the whole        #
# machine will be used for that models.                  #
#                                                        #
##########################################################
gamma-threads    = 4
inv-threads      = 2
uniform-threads	 = 1
\end{verbatim}

\subsection{Logging properties}

All the logs generated by jModelTest will be stored in the folder defined by the {\bf log-dir} property. The tool generates 3 different kinds of log files:
\begin{itemize}
\item {\bf PhyML logs}. The output of PhyML for every model optimization. This files are useful when an error occurs during the model optimization.
\item {\bf HTML logs}. The results of the model selection in html format. This provides an easy visualization of the results.
\item {\bf checkpoint files}. Snapshots are stored during the execution, and these can be used for restoring a previous run at the last stable point.
\end{itemize}

Using the properties one can enable or disable each log independently. If there is no {\bf log-dir}, all logs will be disabled independently on their value. Thus, for example a system administrator could comment that property in the configuration file, and users can set their own log directory in the command line:

\begin{verbatim}
checkpointing  = enabled
html-logging   = enabled
phyml-logging  = enabled
# log-dir        = log     <-- This line is commented
\end{verbatim}

Now setting the custom log directory will generate all the log files there, as long as those are enabled in the configuration file. Otherwise, no log will be generated.

\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Property} & {\bf Values} & {\bf Default} \\
checkpointing  & enabled/disabled & enabled \\
html-logging   & enabled/disabled & enabled \\
phyml-logging  & enabled/disabled & enabled \\
log-dir        & logging directory & log/ \\
\hline
\end{tabular}
\end{center}

\subsection{PhyML binary properties}

jModelTest distribution includes PhyML binaries in exe/phyml directory. However, it is possible that you already have PhyML installed in your system and for some reason you prefer to use that distribution. In such a case, setting the {\bf global-phyml-exe} property to true, jModelTest will try to run a ``phyml'' command that is expected to be in the PATH. Also if you want to set a different path than default for finding the PhyML binaries you can change the {\bf exe-dir} property.

In that directory, an executable file called ``phyml'' will have priority. If it does not exist, jModelTest will try to execute the binary called ``PhyML\_3.0\_PLATFORM''. For example, ``PhyML\_3.0\_linux64''. Thus, if you have a working phyml binary you can place it in the binaries directory with the name ``phyml''.

\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Property} & {\bf Values} & {\bf Default} \\
global-phyml-exe & true/false &  false \\
exe-dir	         & path to local PhyML & exe/phyml \\ 
\hline
\end{tabular}
\end{center}

TIP: A workaround for setting the global PhyML executable in case that its name differs from ``phyml'' is creating a symbolic link in the binaries directory. For example:

\begin{lstlisting}
$ cd $JMODELTEST_HOME/exe/phyml
$ ln -s phyml `which $MY_PHYML_GLOBAL_EXECUTABLE`
\end{lstlisting}

\subsection{Hybrid shared-distributed memory execution properties}

The following properties are used only with the hybrid memory parallel execution. The dynamic shared memory scheduler can use a different number of threads for model optimization depending on the model parameters. For example, models with rate heterogeneity will take a longer time to optimize the parameters. This way, assigning a different number of threads used for the parallel optimization of each model will improve the efficiency by minimizing the parallel overhead.

Note that for enabling the hybrid memory parallelization you need to create your own PhyML binaries applying a patch directly to the PhyML source code and compiling it for you system. You can ask us about it.

The default values work fine for a hybrid execution using 8 and 16 core-nodes.

\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Property} & {\bf Values} & {\bf Default} \\
gamma-threads  & \#threads for +G and +I+G models & 4 \\
inv-threads    & \#threads for +I models & 2 \\
uniform-threads& \#threads for models without rate heterogeneity & 1 \\
\hline
\end{tabular}
\end{center}
