gdbinit 28 KB

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