GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
execution_status.hpp
1 /**
2  * Copyright (c) 2009 Carnegie Mellon University.
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an "AS
13  * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14  * express or implied. See the License for the specific language
15  * governing permissions and limitations under the License.
16  *
17  * For more about this software visit:
18  *
19  * http://www.graphlab.ml.cmu.edu
20  *
21  */
22 
23 
24 #ifndef GRAPHLAB_EXECUTION_STATUS_HPP
25 #define GRAPHLAB_EXECUTION_STATUS_HPP
26 
27 namespace graphlab {
28 
29  /**
30  * \brief the reasons for execution completion.
31  *
32  * Because there are several reasons why the graphlab engine might
33  * terminate the exec_status value is returned from the start
34  * function after completing execution.
35  *
36  */
38  enum status_enum {
39  UNSET, /** The default termination reason */
40  RUNNING, /** The engine is currently running */
41  TASK_DEPLETION, /**<Execution completed successfully due to
42  task depletion */
43  TIMEOUT, /**< The execution completed after timing
44  out */
45 
46  FORCED_ABORT, /**< the engine was stopped by calling force
47  abort */
48 
49  EXCEPTION /**< the engine was stopped by an exception */
50  }; // end of enum
51 
52  // Convenience function.
53  static std::string to_string(status_enum es) {
54  switch(es) {
55  case UNSET: return "engine not run!";
56  case RUNNING: return "engine is still running!";
57  case TASK_DEPLETION: return "task depletion (natural)";
58  case TIMEOUT: return "timeout";
59  case FORCED_ABORT: return "forced abort";
60  case EXCEPTION: return "exception";
61  default: return "unknown";
62  };
63  } // end of to_string
64  };
65 
66 
67 
68 }; // end of namespace graphlab
69 #endif
70 
71 
72