gdbinit 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2015 Université de Bordeaux
  4. # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 CNRS
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. # To set a breakpoint when starting gdb with option "-ex run",
  17. # here what you need to do:
  18. #set breakpoint pending on
  19. #break starpu_mpi.c:419
  20. define starpu-print-job
  21. set language c
  22. set $job = (struct _starpu_job *)$arg0
  23. printf "StarPU Job (%p)\n", $job
  24. if ($job != 0)
  25. printf "\ttask:\t\t\t\t<%p>\n", $job->task
  26. printf "\tsubmitted:\t\t\t<%d>\n", $job->submitted
  27. printf "\tterminated:\t\t\t<%d>\n", $job->terminated
  28. printf "\tjob_id:\t\t\t\t<%d>\n", $job->job_id
  29. if $job->task && $job->task->name
  30. printf "\tname:\t\t\t\t<%s>\n", $job->task->name
  31. end
  32. end
  33. end
  34. document starpu-print-job
  35. Prints a StarPU job
  36. end
  37. define starpu-print-task
  38. set language c
  39. set $task = (struct starpu_task *)$arg0
  40. set $job = (struct _starpu_job *)$task->starpu_private
  41. set $status=0
  42. if $task->status == 0
  43. set $status="STARPU_TASK_INVALID"
  44. end
  45. if $task->status == 1
  46. set $status="STARPU_TASK_BLOCKED"
  47. end
  48. if $task->status == 2
  49. set $status="STARPU_TASK_READY"
  50. end
  51. if $task->status == 3
  52. set $status="STARPU_TASK_RUNNING"
  53. end
  54. if $task->status == 4
  55. set $status="STARPU_TASK_FINISHED"
  56. end
  57. if $task->status == 5
  58. set $status="STARPU_TASK_BLOCKED_ON_TAG"
  59. end
  60. if $task->status == 6
  61. set $status="STARPU_TASK_BLOCKED_ON_TASK"
  62. end
  63. if $task->status == 7
  64. set $status="STARPU_TASK_BLOCKED_ON_DATA"
  65. end
  66. if $task->status == 8
  67. set $status="STARPU_TASK_STOPPED"
  68. end
  69. printf "StarPU Task (%p)\n", $task
  70. if $task->name
  71. printf "\tname:\t\t\t\t<%s>\n", $task->name
  72. end
  73. printf "\tcodelet:\t\t\t<%p>\n", $task->cl
  74. printf "\tcallback:\t\t\t<%p>\n", $task->callback_func
  75. printf "\tsynchronous:\t\t\t<%d>\n", $task->synchronous
  76. printf "\texecute_on_a_specific_worker:\t<%d>\n", $task->execute_on_a_specific_worker
  77. printf "\tworkerid:\t\t\t<%d>\n", $task->workerid
  78. printf "\tdetach:\t\t\t\t<%d>\n", $task->detach
  79. printf "\tdestroy:\t\t\t<%d>\n", $task->destroy
  80. printf "\tregenerate:\t\t\t<%d>\n", $task->regenerate
  81. printf "\tstatus:\t\t\t\t<%s>\n", $status
  82. printf "\tjob:\t\t\t\t<%p>\n", $job
  83. printf "\tndeps:\t\t\t\t<%u>\n", $job->job_successors->ndeps
  84. printf "\tndeps_completed:\t\t<%u>\n", $job->job_successors->ndeps_completed
  85. printf "\tnsuccs:\t\t\t\t<%u>\n", $job->job_successors->nsuccs
  86. if $job
  87. starpu-print-job $job
  88. end
  89. end
  90. define starpu-print-task-and-successor
  91. set language c
  92. set $t = (struct starpu_task *) ($arg0)
  93. starpu-print-task $t
  94. set $j = (struct _starpu_job *) $t->starpu_private
  95. set $nsuccs = $j->job_successors.nsuccs
  96. set $i = 0
  97. while $i < $nsuccs
  98. set $cg = $j->job_successors.succ[$i]
  99. if ($cg->cg_type == 1)
  100. # STARPU_CG_APPS
  101. printf "waited for by application"
  102. end
  103. if ($cg->cg_type == 2)
  104. # STARPU_CG_TAG
  105. printf "will produce tag %x\n", $cg->succ.tag
  106. end
  107. if ($cg->cg_type == 4)
  108. # STARPU_CG_TASK
  109. printf "dep of task %p\n", $cg->succ.job
  110. starpu-print-task $cg->succ.job->task
  111. end
  112. set $i = $i + 1
  113. end
  114. end
  115. document starpu-print-task
  116. Prints a StarPU task
  117. end
  118. define starpu-tasks-on-worker
  119. set language c
  120. set $worker=config->workers[$arg0]
  121. set $task=$worker.local_tasks.head
  122. while $task != 0x0
  123. starpu-print-task $task
  124. set $task=$task->next
  125. end
  126. end
  127. define starpu-tasks-on-workers
  128. set language c
  129. set $num=0
  130. while $num<config->topology->nworkers
  131. printf "Worker %s\n", config->workers[$num].name
  132. starpu-tasks-on-worker $num
  133. set $num = $num + 1
  134. end
  135. end
  136. define starpu-workers
  137. set language c
  138. set $num=0
  139. printf "[Id] Name Arch Mask Devid Bindid Workerid Isrunning Isinitialized Status\n"
  140. while $num<config->topology->nworkers
  141. set $worker=&config->workers[$num]
  142. if $worker->status == STATUS_INVALID
  143. set $status="INVALID"
  144. end
  145. if $worker->status == STATUS_UNKNOWN
  146. set $status="UNKNOWN"
  147. end
  148. if $worker->status == STATUS_INITIALIZING
  149. set $status="INITIALIZING"
  150. end
  151. if $worker->status == STATUS_EXECUTING
  152. set $status="EXECUTING"
  153. end
  154. if $worker->status == STATUS_CALLBACK
  155. set $status="CALLBACK"
  156. end
  157. if $worker->status == STATUS_SCHEDULING
  158. set $status="SCHEDULING"
  159. end
  160. if $worker->status == STATUS_SLEEPING
  161. set $status="SLEEPING"
  162. end
  163. if $worker->status == STATUS_WAKING_UP
  164. set $status="WAKING_UP"
  165. end
  166. printf "[%2d] %-40s %-4d %-4d %-5d %-6d %-8d %-9d %-13d %s\n", $num, $worker->name, $worker->arch, $worker->worker_mask, \
  167. $worker->devid, $worker->bindid, $worker->workerid, $worker->worker_is_running, $worker->worker_is_initialized, $status
  168. set $num = $num + 1
  169. end
  170. end
  171. document starpu-workers
  172. Prints a list of the StarPU workers
  173. end
  174. define starpu-tags
  175. printf "tags htbl %p\n", tag_htbl
  176. printf "TODO\n"
  177. end
  178. define starpu-tasks
  179. set language c
  180. set $num=0
  181. set $nsubmitted=0
  182. set $nready=0
  183. while $num<config->topology->nsched_ctxs
  184. set $nsubmitted = $nsubmitted + config->sched_ctxs[$num]->tasks_barrier->barrier->reached_start
  185. set $nready = $nready + config->sched_ctxs[$num]->ready_tasks_barrier->barrier->reached_start
  186. set $num = $num + 1
  187. end
  188. printf "%d submitted tasks\n", $nsubmitted
  189. printf "%d ready tasks\n", $nready
  190. printf "Tasks being run:\n"
  191. set $n = 0
  192. while $n < config.topology.nworkers
  193. printf "worker %d %s:\n", $n, config.workers[$n].short_name
  194. if config.workers[$n].pipeline_length > 0
  195. set $m = 0
  196. while $m < config.workers[$n].ntasks
  197. set $t = config.workers[$n].current_tasks[(config.workers[$n].first_task + $m) % (sizeof(config.workers[$n].current_tasks)/sizeof(config.workers[$n].current_tasks[0]))]
  198. printf " task %p\n", $t
  199. set $m = $m + 1
  200. end
  201. end
  202. set $task = config.workers[$n].current_task
  203. if ($task)
  204. printf " task %p\n", $task
  205. end
  206. set $n = $n + 1
  207. end
  208. if (tag_htbl)
  209. printf "TODO: tags\n"
  210. end
  211. print "TODO: complete\n"
  212. end
  213. define starpu-all-tasks
  214. set language c
  215. set $j = all_jobs_list
  216. while $j != 0
  217. printf "task %p\n", $j->task
  218. set $j = $j->next_all
  219. end
  220. end
  221. define starpu
  222. printf "Here I am...\n"
  223. end
  224. define starpu-print-mode
  225. if ($arg0 & 1)
  226. printf "R"
  227. end
  228. if ($arg0 & 2)
  229. printf "W"
  230. end
  231. if ($arg0 & 4)
  232. printf " SCRATCH"
  233. end
  234. if ($arg0 & 8)
  235. printf " REDUX"
  236. end
  237. end
  238. define starpu-print-data
  239. set language c
  240. set $data = (starpu_data_handle_t) $arg0
  241. printf "Data handle %p\n", $data
  242. if $data->ops->interfaceid == 0
  243. printf "Matrix\n"
  244. end
  245. if $data->ops->interfaceid == 1
  246. printf "Block\n"
  247. end
  248. if $data->ops->interfaceid == 2
  249. printf "Vector\n"
  250. end
  251. if $data->ops->interfaceid == 3
  252. printf "CSR\n"
  253. end
  254. if $data->ops->interfaceid == 4
  255. printf "BCSR\n"
  256. end
  257. if $data->ops->interfaceid == 5
  258. printf "Variable\n"
  259. end
  260. if $data->ops->interfaceid == 6
  261. printf "Void\n"
  262. end
  263. if $data->ops->interfaceid == 7
  264. printf "Multiformat\n"
  265. end
  266. if $data->ops->interfaceid == 8
  267. printf "COO\n"
  268. end
  269. if $data->ops->interfaceid > 8
  270. printf "Interface id %d\n", $data->ops->interfaceid
  271. end
  272. printf "Home node %d\n", $data->home_node
  273. printf "RWlock refs %d\n", $data->refcnt
  274. printf "Busy count %d\n", $data->busy_count
  275. printf "Current mode "
  276. starpu-print-mode $data->current_mode
  277. printf "\n"
  278. if $data->current_mode & (4|8)
  279. set $n = 0
  280. while $n < config.topology.nworkers
  281. set $replicate = $data->per_worker[$n]
  282. printf "Worker %2d %10s:", $n, config->workers[$n]->name
  283. if $replicate.state == 0
  284. printf " OWNER"
  285. end
  286. if $replicate.state == 1
  287. printf " SHARED"
  288. end
  289. if $replicate.state == 2
  290. printf " INVALID"
  291. end
  292. if $replicate.initialized
  293. printf " initialized"
  294. end
  295. printf "\n"
  296. set $n = $n + 1
  297. end
  298. else
  299. set $n = 0
  300. while $n < descr.nnodes
  301. set $replicate = &$data->per_node[$n]
  302. printf "Node %2d (%2d):", $n, $replicate->refcnt
  303. if $replicate.state == 0
  304. printf " OWNER"
  305. end
  306. if $replicate.state == 1
  307. printf " SHARED"
  308. end
  309. if $replicate.state == 2
  310. printf " INVALID"
  311. end
  312. if $replicate.initialized
  313. printf " initialized"
  314. end
  315. printf "\n"
  316. set $m = 0
  317. while $m < descr.nnodes
  318. if $replicate->request[$m]
  319. printf " request %p from %d\n", $replicate->request[$m], $m
  320. end
  321. set $m = $m + 1
  322. end
  323. set $n = $n + 1
  324. end
  325. set $r = $data->write_invalidation_req
  326. if $r
  327. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  328. end
  329. end
  330. printf "Post sync tasks\n"
  331. set $tasklist = $data->post_sync_tasks
  332. while $tasklist != 0x0
  333. starpu-print-task $tasklist->task
  334. set $tasklist = $tasklist->next
  335. end
  336. printf "Requester tasks\n"
  337. set $requesterlist = $data->req_list._head
  338. while $requesterlist != 0x0
  339. printf "mode: "
  340. starpu-print-mode $requesterlist->mode
  341. printf "\n"
  342. starpu-print-job $requesterlist->j
  343. set $requesterlist = $requesterlist->_next
  344. end
  345. printf "Arbitered requester tasks\n"
  346. set $requesterlist = $data->arbitered_req_list._head
  347. while $requesterlist != 0x0
  348. printf "mode: "
  349. starpu-print-mode $requesterlist->mode
  350. printf "\n"
  351. starpu-print-job $requesterlist->j
  352. set $requesterlist = $requesterlist->_next
  353. end
  354. if ($data->nchildren)
  355. printf "%d children\n", $data->nchildren
  356. end
  357. end
  358. define starpu-print-datas
  359. set $entry = registered_handles
  360. while $entry
  361. starpu-print-data $entry->handle
  362. printf "\n"
  363. set $entry = (struct handle_entry *) $entry.hh.next
  364. end
  365. end
  366. define starpu-print-datas-summary
  367. set language c
  368. set $entry = registered_handles
  369. set $data_n = 0
  370. set $pw_data_n = 0
  371. set $data_n_allocated = 0
  372. set $replicate_n_owners = 0
  373. set $replicate_n_shared = 0
  374. set $replicate_n_invalid = 0
  375. set $replicate_n_initialized = 0
  376. set $replicate_n_allocated = 0
  377. set $pw_replicate_n_owners = 0
  378. set $pw_replicate_n_shared = 0
  379. set $pw_replicate_n_invalid = 0
  380. set $pw_replicate_n_initialized = 0
  381. set $pw_replicate_n_allocated = 0
  382. while $entry
  383. set $data = (starpu_data_handle_t) $entry->handle
  384. if $data->current_mode & (4|8)
  385. set $pw_data_n = $pw_data_n + 1
  386. set $n = 0
  387. while $n < config.topology.nworkers
  388. set $replicate = $data->per_worker[$n]
  389. if $replicate.state == 0
  390. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  391. end
  392. if $replicate.state == 1
  393. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  394. end
  395. if $replicate.state == 2
  396. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  397. end
  398. if $replicate.initialized
  399. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  400. end
  401. if $replicate.allocated
  402. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  403. end
  404. set $n = $n + 1
  405. end
  406. else
  407. set $data_n = $data_n + 1
  408. set $n = 0
  409. while $n < descr.nnodes
  410. set $replicate = &$data->per_node[$n]
  411. if $replicate.state == 0
  412. set $replicate_n_owners = $replicate_n_owners + 1
  413. end
  414. if $replicate.state == 1
  415. set $replicate_n_shared = $replicate_n_shared + 1
  416. end
  417. if $replicate.state == 2
  418. set $replicate_n_invalid = $replicate_n_invalid + 1
  419. end
  420. if $replicate.initialized
  421. set $replicate_n_initialized = $replicate_n_initialized + 1
  422. end
  423. if $replicate.allocated
  424. set $replicate_n_allocated = $replicate_n_allocated + 1
  425. set $data_allocated = 1
  426. end
  427. set $n = $n + 1
  428. end
  429. if $data_allocated
  430. set $data_n_allocated = $data_n_allocated + 1
  431. end
  432. end
  433. set $entry = (struct handle_entry *) $entry.hh.next
  434. end
  435. printf "Number of handles: %d\n", $data_n
  436. printf "Number of allocated handles: %d\n", $data_n_allocated
  437. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  438. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  439. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  440. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  441. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  442. printf "Number of per-worker handles: %d\n", $pw_data_n
  443. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  444. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  445. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  446. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  447. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  448. end
  449. define starpu-print-request
  450. set $r = (struct _starpu_data_request *)$arg0
  451. printf "Request %p\n", $r
  452. printf "Refcnt %d\n", $r->refcnt
  453. printf "Handle %p\n", $r->handle
  454. printf "src_replicate %p\n", $r->src_replicate
  455. printf "dst_replicate %p\n", $r->dst_replicate
  456. printf "handling_node %d\n", $r->handling_node
  457. if ($r->mode & 1)
  458. printf "R"
  459. end
  460. if ($r->mode & 2)
  461. printf "W"
  462. end
  463. if ($r->mode & 4)
  464. printf "S"
  465. end
  466. if ($r->mode & 8)
  467. printf "X"
  468. end
  469. printf "\n"
  470. printf "completed: %d\n", $r->completed
  471. printf "prefetch: %d\n", $r->prefetch
  472. printf "retval: %d\n", $r->retval
  473. printf "ndeps: %d\n", $r->ndeps
  474. printf "next_req_count: %d\n", $r->next_req_count
  475. printf "comid: %u\n", $r->com_id
  476. set $c = $r->callbacks
  477. while $c != 0
  478. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  479. set $c = $c->next
  480. end
  481. end
  482. define starpu-print-requests
  483. set $node = 0
  484. while $node < descr.nnodes
  485. printf "Node %u:\n", $node
  486. set $request = data_requests[$node]._head
  487. while $request != 0
  488. printf " Request %p: handle %p ", $request, $request->handle
  489. starpu-print-mode $request->mode
  490. printf "\n"
  491. set $request = $request->_next
  492. end
  493. set $node = $node + 1
  494. end
  495. end
  496. define starpu-print-prequests
  497. set $node = 0
  498. while $node < descr.nnodes
  499. printf "Node %u:\n", $node
  500. printf "%u pending requests\n", data_requests_npending[$node]
  501. set $request = data_requests_pending[$node]._head
  502. while $request != 0
  503. printf " Request %p: handle %p ", $request, $request->handle
  504. starpu-print-mode $request->mode
  505. printf "\n"
  506. set $request = $request->_next
  507. end
  508. set $node = $node + 1
  509. end
  510. end
  511. define starpu-print-arch
  512. set $arch = (struct starpu_perfmodel_arch *)$arg0
  513. set $device = 0
  514. while $device < $arch->ndevices
  515. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  516. set $device = $device + 1
  517. end
  518. end
  519. define starpu-print-archs
  520. set $comb = 0
  521. while $comb < current_arch_comb
  522. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  523. starpu-print-arch arch_combs[$comb]
  524. set $comb = $comb + 1
  525. end
  526. end
  527. define starpu-print-frequests
  528. set $node = 0
  529. while $node < descr.nnodes
  530. printf "Node %u:\n", $node
  531. set $request = prefetch_requests[$node]._head
  532. while $request != 0
  533. printf " Request %p: handle %p ", $request, $request->handle
  534. starpu-print-mode $request->mode
  535. printf "\n"
  536. set $request = $request->_next
  537. end
  538. set $node = $node + 1
  539. end
  540. end
  541. define starpu-print-irequests
  542. set $node = 0
  543. while $node < descr.nnodes
  544. printf "Node %u:\n", $node
  545. set $request = idle_requests[$node]._head
  546. while $request != 0
  547. printf " Request %p: handle %p ", $request, $request->handle
  548. starpu-print-mode $request->mode
  549. printf "\n"
  550. set $request = $request->_next
  551. end
  552. set $node = $node + 1
  553. end
  554. end
  555. define starpu-memusage
  556. set scheduler-locking on
  557. set $node = 0
  558. while $node < descr.nnodes
  559. printf "\n\nNode %u:\n", $node
  560. set $total = 0
  561. set $total_b = 0
  562. set $wt = 0
  563. set $wt_b = 0
  564. set $home = 0
  565. set $home_b = 0
  566. set $redux = 0
  567. set $redux_b = 0
  568. set $relax = 0
  569. set $relax_b = 0
  570. set $noref = 0
  571. set $noref_b = 0
  572. set $nodataref = 0
  573. set $nodataref_b = 0
  574. set $nosubdataref = 0
  575. set $nosubdataref_b = 0
  576. set $mc = mc_list[$node]->_head
  577. while $mc != 0
  578. set $handle = $mc->data
  579. set $size = _starpu_data_get_size($handle)
  580. set $total = $total + 1
  581. set $total_b = $total_b + $size
  582. if $handle->wt_mask & (1 << $node)
  583. set $wt = $wt + 1
  584. set $wt_b = $wt_b + $size
  585. end
  586. if $node == $handle->home_node
  587. set $home = $home + 1
  588. set $home_b = $home_b + $size
  589. end
  590. if $mc->relaxed_coherency == 2
  591. set $redux = $redux + 1
  592. set $redux_b = $redux_b + $size
  593. end
  594. if $mc->relaxed_coherency == 1
  595. set $relax = $relax + 1
  596. set $relax_b = $relax_b + $size
  597. if $mc->replicate
  598. if $mc->replicate->refcnt == 0
  599. set $noref = $noref + 1
  600. set $noref_b = $noref_b + $size
  601. end
  602. end
  603. end
  604. if $mc->relaxed_coherency == 0
  605. if (may_free_subtree($handle,$node))
  606. set $nosubdataref = $nosubdataref + 1
  607. set $nosubdataref_b = $nosubdataref_b + $size
  608. end
  609. if $handle->per_node[$node].refcnt == 0
  610. set $nodataref = $nodataref + 1
  611. set $nodataref_b = $nodataref_b + $size
  612. end
  613. end
  614. set $mc = $mc->_next
  615. end
  616. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  617. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  618. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  619. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  620. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  621. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  622. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  623. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  624. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  625. set $node = $node + 1
  626. end
  627. end
  628. define starpu-print-model
  629. set $model = (struct starpu_perfmodel *)$arg0
  630. printf "Model %p type %d symbol ", $model, $model->type
  631. if $model->symbol
  632. printf "%s", $model->symbol
  633. else
  634. printf "NULL"
  635. end
  636. printf "\n"
  637. end
  638. define starpu-print-registered-models
  639. set $node = registered_models
  640. while $node
  641. starpu-print-model $node->model
  642. set $node = $node->next
  643. end
  644. end
  645. define starpu-mpi-print-request
  646. set $request = (struct _starpu_mpi_req *)$arg0
  647. set $request_type = "unknown_type"
  648. if $request->request_type == SEND_REQ
  649. set $request_type = "SEND_REQ"
  650. end
  651. if $request->request_type == RECV_REQ
  652. set $request_type = "RECV_REQ"
  653. end
  654. if $request->request_type == WAIT_REQ
  655. set $request_type = "WAIT_REQ"
  656. end
  657. if $request->request_type == TEST_REQ
  658. set $request_type = "TEST_REQ"
  659. end
  660. if $request->request_type == BARRIER_REQ
  661. set $request_type = "BARRIER_REQ"
  662. end
  663. if $request->request_type == PROBE_REQ
  664. set $request_type = "PROBE_REQ"
  665. end
  666. if $request->request_type == UNKNOWN_REQ
  667. set $request_type = "UNKNOWN_REQ"
  668. end
  669. printf "Request (struct _starpu_mpi_req *) %p data %p type %s submitted %d completed %d posted %d detached %d is_internal_req %d\n", $request, $request->data_handle, $request_type, $request->submitted, $request->completed, $request->posted, $request->detached, $request->is_internal_req
  670. end
  671. define starpu-mpi-print-ready-requests
  672. set $list = (struct _starpu_mpi_req_list *) ready_requests
  673. if $list
  674. set $request = $list->_head
  675. while $request
  676. starpu-mpi-print-request $request
  677. set $request = $request->_next
  678. end
  679. else
  680. printf "No ready requests"
  681. end
  682. end
  683. define starpu-mpi-print-detached-requests
  684. set $list = (struct _starpu_mpi_req_list *) detached_requests
  685. if $list
  686. set $request = $list->_head
  687. while $request
  688. starpu-mpi-print-request $request
  689. set $request = $request->_next
  690. end
  691. else
  692. printf "No detached requests"
  693. end
  694. end
  695. define starpu-mpi-print-early-data
  696. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  697. if $hash
  698. while $hash
  699. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  700. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  701. if $list
  702. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  703. while $data
  704. starpu-mpi-print-request $data->req
  705. set $data = $data->_next
  706. end
  707. end
  708. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  709. end
  710. else
  711. printf "No early data\n"
  712. end
  713. end
  714. define starpu-mpi-print-early-requests
  715. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  716. if $hash
  717. while $hash
  718. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  719. set $list = (struct _starpu_mpi_req_list*) $hash->list
  720. if $list
  721. set $request = $list->_head
  722. while $request
  723. starpu-mpi-print-request $request
  724. set $request = $request->_next
  725. end
  726. end
  727. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  728. end
  729. else
  730. printf "No early request\n"
  731. end
  732. end
  733. define starpu-mpi-print-sync-data
  734. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  735. if $hash
  736. while $hash
  737. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  738. set $list = (struct _starpu_mpi_req_list *) $hash->list
  739. if $list
  740. set $request = $list->_head
  741. while $request
  742. starpu-mpi-print-request $request
  743. set $request = $request->_next
  744. end
  745. end
  746. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  747. end
  748. else
  749. printf "No sync data\n"
  750. end
  751. end
  752. document starpu
  753. List of StarPU-specific gdb functions:
  754. starpu-workers prints a list of the StarPU workers
  755. starpu-tasks-on-workers prints a list of the tasks currently running on workers
  756. starpu-tasks-on-worker prints a list of the tasks running on the given worker
  757. starpu-print-job prints a StarPU job
  758. starpu-print-task prints a StarPU task
  759. starpu-print-task-and-successor prints a StarPU task and its successors
  760. starpu-print-data prints a StarPU data handle
  761. starpu-print-datas prints all StarPU data handles
  762. starpu-print-datas-summary prints a summary of data handles
  763. starpu-print-request prints a StarPU data request
  764. starpu-print-requests prints all StarPU data requests
  765. starpu-print-prequests prints all pending StarPU data requests
  766. starpu-print-frequests prints all StarPU prefetch data requests
  767. starpu-print-irequests prints all StarPU idle data requests
  768. starpu-tasks prints a summary of the tasks flowing in StarPU
  769. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  770. starpu-tags prints a list of the tags known to StarPU
  771. starpu-memusage prints the memory node usage
  772. starpu-print-archs prints all known arch combinations
  773. starpu-print-arch prints a given arch combination
  774. starpu-print-registered-models prints all registered performance models
  775. starpu-print-model prints a given performance model
  776. starpu-mpi-print-ready-requests prints all MPI ready requests
  777. starpu-mpi-print-detached-requests prints all MPI detached requests
  778. starpu-mpi-print-early-data prints all MPI early received data
  779. starpu-mpi-print-early-requests prints all MPI early requests
  780. starpu-mpi-print-sync-data prints all MPI sync data
  781. end