// Copyright (c) 2008 Ole Weidner // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include "saga-job.hpp" #include #include /////////////////////////////////////////////////////////////////////////////// static int argc_; void printUsage() { std::cout << "Usage: saga-job " << std::endl; std::cout << "" << std::endl; std::cout << " Commands: Options:\n" << std::endl; std::cout << " run " << std::endl; std::cout << " submit " << std::endl; std::cout << "" << std::endl; std::cout << " state " << std::endl; std::cout << " suspend " << std::endl; std::cout << " resume " << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << " (rm url: scheme://host:port/job/service) " << std::endl; std::cout << "" << std::endl; std::cout << "This is a SAGA-based tool for job submission & management." << std::endl; std::cout << "For additional information, see http://saga.cct.lsu.edu." << std::endl; } void ExitIfArgcLessThan(int n) { if (argc_ < n) { printUsage(); exit(-1); } } /////////////////////////////////////////////////////////////////////////////// int main (int argc, char* argv[]) { #if !defined(SAGA_HAVE_PACKAGE_JOB) std::cerr << "saga-advert: saga has been compiled without the job " "package, bailing out" << std::endl; #else argc_ = argc; ExitIfArgcLessThan(2); SAGA_GUARDED_EXEC ( if(!strcmp(argv[1], "run")) { ExitIfArgcLessThan(4); std::vector argvec; for(int i=4; i argvec; for(int i=4; i