Commit 0adda75a authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

dmrg, observe drivers accept -S number

-S number is optional, and if provided and greater
than 0, then the driver runs with Threads=number,
regardless of whether Threads= was set in the input,
that is, it ignores the Threads= line
if present in the input. The number must be non-negative.
If it is 0, then this option has no effect.
parent 3fe5ac36
......@@ -181,7 +181,7 @@ int main(int argc, char **argv)
PsimagLite::String sOptions("");
int precision = 6;
bool unbuffered = false;
bool forceSerial = false;
SizeType threadsInCmd = 0;
bool versionOnly = false;
/* PSIDOC DmrgDriver
There is a single input file that is passed as the
......@@ -205,8 +205,8 @@ to the main dmrg driver are the following.
In other cases, string is the name of the file to redirect std::cout to.
\item[-k] [Optional] Keep untar files
\item[-U] [Optional] Make cout output unbuffered
\item[-S] [Optional] Ignore the Threads= line if present in the input, and run with
Threads=1
\item[-S] [Optional, number] Ignore the Threads= line if present in the input,
and run with Threads=number
\item[-V] [Optional] Print version and exit
\end{itemize}
*/
......@@ -247,7 +247,7 @@ to the main dmrg driver are the following.
\begin{verbatim}./operator -l c -t -f input.inp\end{verbatim}
\end{itemize}
*/
while ((opt = getopt(argc, argv,"f:s:l:d:p:e:o:tkBUSV")) != -1) {
while ((opt = getopt(argc, argv,"f:s:l:d:p:e:o:S:tkBUV")) != -1) {
switch (opt) {
case 'f':
filename = optarg;
......@@ -276,15 +276,15 @@ to the main dmrg driver are the following.
case 'o':
sOptions += optarg;
break;
case 'S':
threadsInCmd = atoi(optarg);
break;
case 'B':
options.label = "B";
break;
case 'U':
unbuffered = true;
break;
case 'S':
forceSerial = true;
break;
case 'V':
versionOnly = true;
options.label = "-";
......@@ -325,7 +325,7 @@ to the main dmrg driver are the following.
ParametersDmrgSolverType dmrgSolverParams(io, sOptions, false);
if (forceSerial) dmrgSolverParams.nthreads = 1;
if (threadsInCmd > 0) dmrgSolverParams.nthreads = threadsInCmd;
bool echoInput = false;
if (!options.enabled && options.label != "-") {
......
......@@ -116,8 +116,8 @@ Braket specifications can be bare or dressed, and are explained elsewhere.
\item[-p] [Optional, Integer] Digits of precision for printing.
\item[-o] {[}Optional, String{]} Extra options for SolverOptions
\item[-F] [Optional, string] TBW
\item[-S] [Optional] Ignore the Threads= line if present in the input, and run with
Threads=1
\item[-S] [Optional, number] Ignore the Threads= line if present in the input, and run with
Threads=number
\item[-V] [Optional] Print version and exit
\end{itemize}
*/
......@@ -129,11 +129,11 @@ int main(int argc,char **argv)
PsimagLite::String filesOption;
int opt = 0;
int precision = 6;
bool forceSerial = false;
SizeType threadsInCmd = 0;
bool versionOnly = false;
PsimagLite::String sOptions("");
while ((opt = getopt(argc, argv,"f:p:o:F:SV")) != -1) {
while ((opt = getopt(argc, argv,"f:p:o:F:S:V")) != -1) {
switch (opt) {
case 'f':
filename = optarg;
......@@ -150,7 +150,7 @@ int main(int argc,char **argv)
filesOption = optarg;
break;
case 'S':
forceSerial = true;
threadsInCmd = atoi(optarg);
break;
case 'V':
versionOnly = true;
......@@ -192,7 +192,7 @@ int main(int argc,char **argv)
ParametersDmrgSolverType dmrgSolverParams(io,sOptions,false,true);
if (forceSerial) dmrgSolverParams.nthreads = 1;
if (threadsInCmd > 0) dmrgSolverParams.nthreads = threadsInCmd;
bool setAffinities = (dmrgSolverParams.options.find("setAffinities")
!= PsimagLite::String::npos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment