diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-07-31 18:26:58 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 06:49:40 -0500 |
| commit | af42638c4bcf81d3d34c147b9217ddb2f6833cfd (patch) | |
| tree | df836b9477498f03ad6dae3172f4bb7ab2c5967d /native/src/testmain.cpp | |
| parent | aa726aa597d5e1aa75b69b0e37caa98ee63d6543 (diff) | |
Add test code for LP-based DPCP/DFLP analysis
Diffstat (limited to 'native/src/testmain.cpp')
| -rw-r--r-- | native/src/testmain.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/native/src/testmain.cpp b/native/src/testmain.cpp index d901446..01af973 100644 --- a/native/src/testmain.cpp +++ b/native/src/testmain.cpp | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include "edf/gedf.h" | 15 | #include "edf/gedf.h" |
| 16 | #include "edf/sim.h" | 16 | #include "edf/sim.h" |
| 17 | 17 | ||
| 18 | #include "lp_analysis.h" | ||
| 19 | |||
| 18 | #include "event.h" | 20 | #include "event.h" |
| 19 | #include "schedule_sim.h" | 21 | #include "schedule_sim.h" |
| 20 | 22 | ||
| @@ -906,5 +908,73 @@ int main(int argc, char** argv) | |||
| 906 | << endl; | 908 | << endl; |
| 907 | 909 | ||
| 908 | delete results; | 910 | delete results; |
| 911 | |||
| 912 | ResourceLocality loc; | ||
| 913 | |||
| 914 | loc.assign_resource(0, 4); | ||
| 915 | loc.assign_resource(1, 4); | ||
| 916 | loc.assign_resource(2, 4); | ||
| 917 | loc.assign_resource(3, 4); | ||
| 918 | |||
| 919 | results = dpcp_bounds(rsi, loc); | ||
| 920 | |||
| 921 | cout << endl << endl << "DPCP" << endl; | ||
| 922 | for (i = 0; i < results->size(); i++) | ||
| 923 | cout << "T" << i | ||
| 924 | << " y=" << rsi.get_tasks()[i].get_priority() | ||
| 925 | << " c=" << rsi.get_tasks()[i].get_cluster() | ||
| 926 | << ": total=" << (*results)[i].total_length | ||
| 927 | << " remote=" << results->get_remote_blocking(i) | ||
| 928 | << " local=" << results->get_local_blocking(i) | ||
| 929 | << endl; | ||
| 930 | |||
| 931 | delete results; | ||
| 932 | |||
| 933 | #if defined(CONFIG_HAVE_CPLEX) | ||
| 934 | |||
| 935 | results = lp_dpcp_bounds(rsi, loc, false); | ||
| 936 | |||
| 937 | cout << endl << endl << "DPCP(LP)" << endl; | ||
| 938 | for (i = 0; i < results->size(); i++) | ||
| 939 | cout << "T" << i | ||
| 940 | << " y=" << rsi.get_tasks()[i].get_priority() | ||
| 941 | << " c=" << rsi.get_tasks()[i].get_cluster() | ||
| 942 | << ": total=" << (*results)[i].total_length | ||
| 943 | << " remote=" << results->get_remote_blocking(i) | ||
| 944 | << " local=" << results->get_local_blocking(i) | ||
| 945 | << endl; | ||
| 946 | |||
| 947 | delete results; | ||
| 948 | |||
| 949 | results = lp_dpcp_bounds(rsi, loc, true); | ||
| 950 | |||
| 951 | cout << endl << endl << "DPCP(LP+RTA)" << endl; | ||
| 952 | for (i = 0; i < results->size(); i++) | ||
| 953 | cout << "T" << i | ||
| 954 | << " y=" << rsi.get_tasks()[i].get_priority() | ||
| 955 | << " c=" << rsi.get_tasks()[i].get_cluster() | ||
| 956 | << ": total=" << (*results)[i].total_length | ||
| 957 | << " remote=" << results->get_remote_blocking(i) | ||
| 958 | << " local=" << results->get_local_blocking(i) | ||
| 959 | << endl; | ||
| 960 | |||
| 961 | delete results; | ||
| 962 | |||
| 963 | results = lp_dflp_bounds(rsi, loc); | ||
| 964 | |||
| 965 | cout << endl << endl << "DFLP" << endl; | ||
| 966 | for (i = 0; i < results->size(); i++) | ||
| 967 | cout << "T" << i | ||
| 968 | << " y=" << rsi.get_tasks()[i].get_priority() | ||
| 969 | << " c=" << rsi.get_tasks()[i].get_cluster() | ||
| 970 | << ": total=" << (*results)[i].total_length | ||
| 971 | << " remote=" << results->get_remote_blocking(i) | ||
| 972 | << " local=" << results->get_local_blocking(i) | ||
| 973 | << endl; | ||
| 974 | |||
| 975 | delete results; | ||
| 976 | |||
| 977 | #endif | ||
| 978 | |||
| 909 | return 0; | 979 | return 0; |
| 910 | } | 980 | } |
