diff options
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/gpuspin.cu | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/gpu/gpuspin.cu b/gpu/gpuspin.cu index b096c82..970d6f2 100644 --- a/gpu/gpuspin.cu +++ b/gpu/gpuspin.cu | |||
@@ -57,7 +57,7 @@ size_t CHUNK_SIZE = 0; | |||
57 | 57 | ||
58 | int TOKEN_LOCK = -1; | 58 | int TOKEN_LOCK = -1; |
59 | 59 | ||
60 | bool USE_ENGINE_LOCKS = true; | 60 | bool USE_ENGINE_LOCKS = false; |
61 | bool USE_DYNAMIC_GROUP_LOCKS = false; | 61 | bool USE_DYNAMIC_GROUP_LOCKS = false; |
62 | int EE_LOCKS[NR_GPUS]; | 62 | int EE_LOCKS[NR_GPUS]; |
63 | int CE_SEND_LOCKS[NR_GPUS]; | 63 | int CE_SEND_LOCKS[NR_GPUS]; |
@@ -692,12 +692,13 @@ static void init_cuda(int num_gpu_users) | |||
692 | { | 692 | { |
693 | if (i != j) | 693 | if (i != j) |
694 | { | 694 | { |
695 | int other = GPU_PARTITION*GPU_PARTITION_SIZE + j; | ||
695 | int canAccess = 0; | 696 | int canAccess = 0; |
696 | cudaDeviceCanAccessPeer(&canAccess, i, j); | 697 | cudaDeviceCanAccessPeer(&canAccess, which, other); |
697 | if(canAccess) | 698 | if(canAccess) |
698 | { | 699 | { |
699 | cudaDeviceEnablePeerAccess(j, 0); | 700 | cudaDeviceEnablePeerAccess(other, 0); |
700 | p2pMigration[i][j] = true; | 701 | p2pMigration[which][other] = true; |
701 | } | 702 | } |
702 | } | 703 | } |
703 | } | 704 | } |
@@ -1294,8 +1295,8 @@ enum eScheduler | |||
1294 | RT_LINUX | 1295 | RT_LINUX |
1295 | }; | 1296 | }; |
1296 | 1297 | ||
1297 | #define CPU_OPTIONS "p:z:c:wlveio:f:s:q:X:L:Q:d" | 1298 | #define CPU_OPTIONS "p:z:c:wlveio:f:s:q:X:L:Q:d:" |
1298 | #define GPU_OPTIONS "g:y:r:C:E:DG:xS:R:T:Z:aFm:b:MNIk:" | 1299 | #define GPU_OPTIONS "g:y:r:C:E:DG:xS:R:T:Z:aFm:b:MNIk:V" |
1299 | 1300 | ||
1300 | // concat the option strings | 1301 | // concat the option strings |
1301 | #define OPTSTR CPU_OPTIONS GPU_OPTIONS | 1302 | #define OPTSTR CPU_OPTIONS GPU_OPTIONS |
@@ -1372,6 +1373,9 @@ int main(int argc, char** argv) | |||
1372 | NUM_COPY_ENGINES = atoi(optarg); | 1373 | NUM_COPY_ENGINES = atoi(optarg); |
1373 | assert(NUM_COPY_ENGINES == 1 || NUM_COPY_ENGINES == 2); | 1374 | assert(NUM_COPY_ENGINES == 1 || NUM_COPY_ENGINES == 2); |
1374 | break; | 1375 | break; |
1376 | case 'V': | ||
1377 | RESERVED_MIGR_COPY_ENGINE = true; | ||
1378 | break; | ||
1375 | case 'E': | 1379 | case 'E': |
1376 | USE_ENGINE_LOCKS = true; | 1380 | USE_ENGINE_LOCKS = true; |
1377 | ENGINE_LOCK_TYPE = (eEngineLockTypes)atoi(optarg); | 1381 | ENGINE_LOCK_TYPE = (eEngineLockTypes)atoi(optarg); |
@@ -1440,7 +1444,9 @@ int main(int argc, char** argv) | |||
1440 | want_signals = 1; | 1444 | want_signals = 1; |
1441 | break; | 1445 | break; |
1442 | case 'd': | 1446 | case 'd': |
1443 | drain = DRAIN_SOBLIV; | 1447 | drain = (budget_drain_policy_t)atoi(optarg); |
1448 | assert(drain >= DRAIN_SIMPLE && drain <= DRAIN_SOBLIV); | ||
1449 | assert(drain != DRAIN_SAWARE); // unsupported | ||
1444 | break; | 1450 | break; |
1445 | case 'l': | 1451 | case 'l': |
1446 | test_loop = 1; | 1452 | test_loop = 1; |
@@ -1623,18 +1629,6 @@ int main(int argc, char** argv) | |||
1623 | activate_litmus_signals(SIG_BUDGET_MASK, longjmp_on_litmus_signal); | 1629 | activate_litmus_signals(SIG_BUDGET_MASK, longjmp_on_litmus_signal); |
1624 | } | 1630 | } |
1625 | 1631 | ||
1626 | if (scheduler == LITMUS) | ||
1627 | { | ||
1628 | ret = task_mode(LITMUS_RT_TASK); | ||
1629 | if (ret != 0) | ||
1630 | bail_out("could not become RT task"); | ||
1631 | } | ||
1632 | else | ||
1633 | { | ||
1634 | trace_name(); | ||
1635 | trace_param(); | ||
1636 | } | ||
1637 | |||
1638 | // if (protocol >= 0) { | 1632 | // if (protocol >= 0) { |
1639 | // /* open reference to semaphore */ | 1633 | // /* open reference to semaphore */ |
1640 | // lock_od = litmus_open_lock(protocol, resource_id, lock_namespace, &cluster); | 1634 | // lock_od = litmus_open_lock(protocol, resource_id, lock_namespace, &cluster); |
@@ -1654,12 +1648,20 @@ int main(int argc, char** argv) | |||
1654 | 1648 | ||
1655 | init_cuda(num_gpu_users); | 1649 | init_cuda(num_gpu_users); |
1656 | safetynet = true; | 1650 | safetynet = true; |
1657 | |||
1658 | if (ENABLE_RT_AUX_THREADS) | ||
1659 | if (enable_aux_rt_tasks(AUX_CURRENT | AUX_FUTURE) != 0) | ||
1660 | bail_out("enable_aux_rt_tasks() failed"); | ||
1661 | } | 1651 | } |
1662 | 1652 | ||
1653 | if (scheduler == LITMUS) | ||
1654 | { | ||
1655 | ret = task_mode(LITMUS_RT_TASK); | ||
1656 | if (ret != 0) | ||
1657 | bail_out("could not become RT task"); | ||
1658 | } | ||
1659 | else | ||
1660 | { | ||
1661 | trace_name(); | ||
1662 | trace_param(); | ||
1663 | } | ||
1664 | |||
1663 | if (wait) { | 1665 | if (wait) { |
1664 | ret = wait_for_ts_release2(&releaseTime); | 1666 | ret = wait_for_ts_release2(&releaseTime); |
1665 | if (ret != 0) | 1667 | if (ret != 0) |
@@ -1674,6 +1676,11 @@ int main(int argc, char** argv) | |||
1674 | sleep_next_period_linux(); | 1676 | sleep_next_period_linux(); |
1675 | } | 1677 | } |
1676 | 1678 | ||
1679 | if (scheduler == LITMUS && GPU_USING && ENABLE_RT_AUX_THREADS) { | ||
1680 | if (enable_aux_rt_tasks(AUX_CURRENT | AUX_FUTURE) != 0) | ||
1681 | bail_out("enable_aux_rt_tasks() failed"); | ||
1682 | } | ||
1683 | |||
1677 | start = wctime(); | 1684 | start = wctime(); |
1678 | 1685 | ||
1679 | if (scheduler == LITMUS) | 1686 | if (scheduler == LITMUS) |