[mlpack-svn] r15553 - mlpack/conf/jenkins-conf/benchmark/methods/mlpack
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Jul 26 08:17:25 EDT 2013
Author: marcus
Date: Fri Jul 26 08:17:23 2013
New Revision: 15553
Log:
Add timeout for the mlpack benchmark scripts.
Modified:
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
and return the instance.
@param dataset - Input dataset to perform All K-Furthest-Neighbors on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "allkfn -h")
@@ -94,7 +97,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,15 @@
and return the instance.
@param dataset - Input dataset to perform All K-Nearest-Neighbors on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"], verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "allknn -h")
@@ -93,7 +95,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
some informations and return the instance.
@param dataset - Input dataset to perform ALLKRANN on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "allkrann -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py Fri Jul 26 08:17:23 2013
@@ -35,13 +35,16 @@
some informations and return the instance.
@param dataset - Input dataset to perform Density Estimation on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "det -h")
@@ -94,7 +97,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform EMST on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "emst -h")
@@ -87,7 +90,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
and return the instance.
@param dataset - Input dataset to perform Fast Max-Kernel Search on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "fastmks -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
and return the instance.
@param dataset - Input dataset to perform Gaussian Mixture Model on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "gmm -h")
@@ -87,7 +90,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform HMM Sequence Generator on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "hmm_generate -h")
@@ -87,7 +90,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py Fri Jul 26 08:17:23 2013
@@ -34,13 +34,16 @@
show some informations and return the instance.
@param dataset - Input dataset to perform HMM Log-Likelihood on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "hmm_loglik -h")
@@ -92,7 +95,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform Hidden Markov Model Training on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = 0
# Get description from executable.
cmd = shlex.split(self.path + "hmm_train -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py Fri Jul 26 08:17:23 2013
@@ -35,10 +35,12 @@
show some informations and return the instance.
@param dataset - Input dataset to perform HMM Viterbi State Prediction on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
@@ -93,7 +95,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform ICA on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "radical -h")
@@ -88,7 +91,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform KPCA on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "kernel_pca -h")
@@ -88,7 +91,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
return the instance.
@param dataset - Input dataset to perform K-Means clustering on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "kmeans -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,15 @@
and return the instance.
@param dataset - Input dataset to perform Least Angle Regression on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"], verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "lars -h")
@@ -92,7 +94,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform Linear Regression Prediction on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "linear_regression -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
and return the instance.
@param dataset - Input dataset to perform Local Coordinate Coding on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "local_coordinate_coding -h")
@@ -87,7 +90,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py Fri Jul 26 08:17:23 2013
@@ -34,13 +34,16 @@
instance, show some informations and return the instance.
@param dataset - Input dataset to perform LSH on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "lsh -h")
@@ -88,7 +91,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform Naive Bayes Classifier on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "nbc -h")
@@ -92,7 +95,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform NCA on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "nca -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
informations and return the instance.
@param dataset - Input dataset to perform NMF on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "nmf -h")
@@ -88,7 +91,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py Fri Jul 26 08:17:23 2013
@@ -34,13 +34,16 @@
informations and return the instance.
@param dataset - Input dataset to perform PCA on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "pca -h")
@@ -108,7 +111,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
the instance.
@param dataset - Input dataset to perform Range Search on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "range_search -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py Fri Jul 26 08:17:23 2013
@@ -33,13 +33,16 @@
the instance.
@param dataset - Input dataset to perform Sparse Coding on.
+ @param timeout - The time until the timeout. Default no timeout.
@param path - Path to the mlpack executable.
@param verbose - Display informational messages.
'''
- def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True):
+ def __init__(self, dataset, timeout=0, path=os.environ["MLPACK_BIN"],
+ verbose=True):
self.verbose = verbose
self.dataset = dataset
self.path = path
+ self.timeout = timeout
# Get description from executable.
cmd = shlex.split(self.path + "sparse_coding -h")
@@ -93,7 +96,11 @@
# Run command with the nessecary arguments and return its output as a byte
# string. We have untrusted input so we disables all shell based features.
try:
- s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
+ s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False,
+ timeout=self.timeout)
+ except subprocess.TimeoutExpired as e:
+ Log.Warn(str(e))
+ return -2
except Exception as e:
Log.Fatal("Could not execute command: " + str(cmd))
return -1
More information about the mlpack-svn
mailing list