crown  1.0.0
src/crown-scheduler.cpp
Go to the documentation of this file.
00001 /*
00002  Copyright 2015 Nicolas Melot
00003 
00004  This file is part of Crown.
00005 
00006  Crown is free software: you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation, either version 3 of the License, or
00009  (at your option) any later version.
00010 
00011  Crown is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with Crown. If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 
00022 #include <fstream>
00023 
00024 #include <pelib/argument_parsing.hpp>
00025 #include <pelib/scheduler.h>
00026 #include <pelib/dl.h>
00027 
00028 #include <crown/CrownScheduler.hpp>
00029 #include <crown/crown-scheduler.hpp>
00030 
00031 #ifdef debug
00032 #undef debug
00033 #endif
00034 
00035 #define debug(var) cout << "[" << __FILE__ << ":" << __FUNCTION__ << ":" << __LINE__ << "] " << #var << " = \"" << (var) << "\"" << endl;
00036 
00037 using namespace std;
00038 using namespace pelib;
00039 using namespace crown;
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 const pelib::Schedule*
00046 pelib_schedule(const pelib::Taskgraph &tg, const pelib::Platform &pt, size_t argc, char **argv, map<const string, double>& statistics)
00047 {
00048         const CrownScheduler *scheduler = crown_scheduler(argc, argv, NULL);
00049         return new Schedule(scheduler->schedule(tg, pt, statistics));
00050 }
00051 
00052 string
00053 pelib_description(size_t argc, char **argv)
00054 {
00055         const CrownScheduler *sched = crown_scheduler(argc, argv, NULL);
00056         string desc = sched->getShortDescription();
00057         return desc;
00058 }
00059 
00060 void
00061 pelib_delete(pelib::Schedule *sched)
00062 {
00063         delete sched;
00064 }
00065 
00066 void
00067 crown_delete_scheduler(const pelib::crown::CrownScheduler *sched)
00068 {
00069         delete sched;
00070 }
00071 
00072 #ifdef __cplusplus
00073 }
00074 #endif