gdbinit 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  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. printf "StarPU Task (%p)\n", $task
  40. if $task->name
  41. printf "\tname:\t\t\t\t<%s>\n", $task->name
  42. end
  43. printf "\tcodelet:\t\t\t<%p>\n", $task->cl
  44. if $task->cl && $task->cl->name
  45. printf "\tcodelet name:\t\t\t<%s>\n", $task->cl->name
  46. end
  47. set $nbuffers = $task->nbuffers
  48. if $task->cl && $task->cl->nbuffers != -1
  49. set $nbuffers = $task->cl->nbuffers
  50. end
  51. printf "\tnbuffers:\t\t\t<%d>\n", $nbuffers
  52. printf "\tcallback:\t\t\t<%p>\n", $task->callback_func
  53. printf "\tcl_arg:\t\t\t<%p>\n", $task->cl_arg
  54. printf "\tsynchronous:\t\t\t<%d>\n", $task->synchronous
  55. printf "\texecute_on_a_specific_worker:\t<%d>\n", $task->execute_on_a_specific_worker
  56. printf "\tworkerid:\t\t\t<%d>\n", $task->workerid
  57. printf "\tdetach:\t\t\t\t<%d>\n", $task->detach
  58. printf "\tdestroy:\t\t\t<%d>\n", $task->destroy
  59. printf "\tregenerate:\t\t\t<%d>\n", $task->regenerate
  60. printf "\tstatus:\t\t\t\t"
  61. if $task->status == 0
  62. printf "STARPU_TASK_INIT"
  63. end
  64. if $task->status == 1
  65. printf "STARPU_TASK_BLOCKED"
  66. end
  67. if $task->status == 2
  68. printf "STARPU_TASK_READY"
  69. end
  70. if $task->status == 3
  71. printf "STARPU_TASK_RUNNING"
  72. end
  73. if $task->status == 4
  74. printf "STARPU_TASK_FINISHED"
  75. end
  76. if $task->status == 5
  77. printf "STARPU_TASK_BLOCKED_ON_TAG"
  78. end
  79. if $task->status == 6
  80. printf "STARPU_TASK_BLOCKED_ON_TASK"
  81. end
  82. if $task->status == 7
  83. printf "STARPU_TASK_BLOCKED_ON_DATA"
  84. end
  85. if $task->status == 8
  86. printf "STARPU_TASK_STOPPED"
  87. end
  88. printf "\n"
  89. printf "\tjob:\t\t\t\t<%p>\n", $job
  90. printf "\ttag_id:\t\t\t\t<%d>\n", $task->tag_id
  91. printf "\tndeps:\t\t\t\t<%u>\n", $job->job_successors->ndeps
  92. printf "\tndeps_remaining:\t\t<%u>\n", $job->job_successors->ndeps - $job->job_successors->ndeps_completed
  93. if _starpu_debug
  94. set $n = 0
  95. while $n < $job->job_successors->ndeps
  96. if ! $job->job_successors->done[$n]
  97. set $cg = $job->job_successors->deps[$n]
  98. set $m = 0
  99. printf "\t\tcg:\t\t\t<%u>\n", $cg->ndeps
  100. while $m < $cg->ndeps
  101. if ! $cg->done[$m]
  102. set $depj = (struct _starpu_job *) $cg->deps[$m]
  103. printf "\t\t\ttask %p\n", $depj->task
  104. end
  105. set $m = $m + 1
  106. end
  107. end
  108. set $n = $n + 1
  109. end
  110. end
  111. printf "\tndeps_completed:\t\t<%u>\n", $job->job_successors->ndeps_completed
  112. printf "\tnsuccs:\t\t\t\t<%u>\n", $job->job_successors->nsuccs
  113. if $job
  114. starpu-print-job $job
  115. end
  116. end
  117. define starpu-print-task-and-successor
  118. set language c
  119. set $t = (struct starpu_task *) ($arg0)
  120. starpu-print-task $t
  121. set $j = (struct _starpu_job *) $t->starpu_private
  122. set $nsuccs = $j->job_successors.nsuccs
  123. set $i = 0
  124. while $i < $nsuccs
  125. set $cg = $j->job_successors.succ[$i]
  126. if ($cg->cg_type == 1)
  127. # STARPU_CG_APPS
  128. printf "waited for by application"
  129. end
  130. if ($cg->cg_type == 2)
  131. # STARPU_CG_TAG
  132. printf "will produce tag %x\n", $cg->succ.tag
  133. end
  134. if ($cg->cg_type == 4)
  135. # STARPU_CG_TASK
  136. printf "dep of task %p\n", $cg->succ.job
  137. starpu-print-task $cg->succ.job->task
  138. end
  139. set $i = $i + 1
  140. end
  141. end
  142. define starpu-tasks-on-worker
  143. set language c
  144. set $worker=_starpu_config->workers[$arg0]
  145. set $task=$worker.local_tasks.head
  146. while $task != 0x0
  147. starpu-print-task $task
  148. set $task=$task->next
  149. end
  150. end
  151. define starpu-tasks-on-workers
  152. set language c
  153. set $num=0
  154. while $num<_starpu_config->topology->nworkers
  155. printf "Worker %s\n", _starpu_config->workers[$num].name
  156. starpu-tasks-on-worker $num
  157. set $num = $num + 1
  158. end
  159. end
  160. define starpu-workers
  161. set language c
  162. set $num=0
  163. printf "[Id] Name Arch Mask Devid Bindid Workerid Isrunning Isinitialized Status\n"
  164. while $num<_starpu_config->topology->nworkers
  165. set $worker=&_starpu_config->workers[$num]
  166. printf "[%2d] %-40s %-4d %-4d %-5d %-6d %-8d %-9d %-13d ", $num, $worker->name, $worker->arch, $worker->worker_mask, \
  167. $worker->devid, $worker->bindid, $worker->workerid, $worker->worker_is_running, $worker->worker_is_initialized
  168. if $worker->status == STATUS_INVALID
  169. printf "INVALID"
  170. end
  171. if $worker->status == STATUS_UNKNOWN
  172. printf "UNKNOWN"
  173. end
  174. if $worker->status == STATUS_INITIALIZING
  175. printf "INITIALIZING"
  176. end
  177. if $worker->status == STATUS_EXECUTING
  178. printf "EXECUTING"
  179. end
  180. if $worker->status == STATUS_CALLBACK
  181. printf "CALLBACK"
  182. end
  183. if $worker->status == STATUS_SCHEDULING
  184. printf "SCHEDULING"
  185. end
  186. if $worker->status == STATUS_WAITING
  187. printf "WAITING"
  188. end
  189. if $worker->status == STATUS_SLEEPING_SCHEDULING
  190. printf "SLEEPING_SCHEDULING"
  191. end
  192. if $worker->status == STATUS_SLEEPING
  193. printf "SLEEPING"
  194. end
  195. printf "\n"
  196. set $num = $num + 1
  197. end
  198. end
  199. define starpu-print-tag
  200. set language c
  201. set $tag_struct = (struct _starpu_tag *)_gettag_struct($arg0)
  202. printf "tag %d ((struct _starpu_tag *) %p)\n", $arg0, $tag_struct
  203. printf "\tstate "
  204. if $tag_struct->state == STARPU_INVALID_STATE
  205. printf "STARPU_INVALID_STATE"
  206. end
  207. if $tag_struct->state == STARPU_ASSOCIATED
  208. printf "STARPU_ASSOCIATED"
  209. end
  210. if $tag_struct->state == STARPU_BLOCKED
  211. printf "STARPU_BLOCKED"
  212. end
  213. if $tag_struct->state == STARPU_READY
  214. printf "STARPU_READY"
  215. end
  216. if $tag_struct->state == STARPU_DONE
  217. printf "STARPU_DONE"
  218. end
  219. printf "\n"
  220. printf "\tdeps %d\n", $tag_struct->tag_successors.ndeps
  221. printf "\tcompleted %d\n", $tag_struct->tag_successors.ndeps_completed
  222. printf "\tndeps_remaining:\t\t<%u>\n", $tag_struct->tag_successors->ndeps - $tag_struct->tag_successors->ndeps_completed
  223. if _starpu_debug
  224. set $n = 0
  225. while $n < $tag_struct->tag_successors->ndeps
  226. if ! $tag_struct->tag_successors->done[$n]
  227. set $cg = $tag_struct->tag_successors->deps[$n]
  228. set $m = 0
  229. printf "\t\tcg:\t\t\t<%u>\n", $cg->ndeps
  230. while $m < $cg->ndeps
  231. if ! $cg->done[$m]
  232. set $dept = (starpu_tag_t) $cg->deps[$m]
  233. printf "\t\t\ttag %u\n", $dept
  234. end
  235. set $m = $m + 1
  236. end
  237. end
  238. set $n = $n + 1
  239. end
  240. end
  241. printf "\tndeps_completed:\t\t<%u>\n", $tag_struct->tag_successors->ndeps_completed
  242. printf "\tnsuccs:\t\t\t\t<%u>\n", $tag_struct->tag_successors->nsuccs
  243. end
  244. define starpu-tags
  245. set language c
  246. printf "tags htbl %p\n", tag_htbl
  247. set $tags = tag_htbl
  248. while $tags
  249. starpu-print-tag $tags->id
  250. set $tags = (struct _starpu_tag_table *) $tags.hh.next
  251. end
  252. end
  253. define starpu-tasks
  254. set language c
  255. set $num=0
  256. set $nsubmitted=0
  257. set $nready=0
  258. while $num<_starpu_config->topology->nsched_ctxs
  259. set $nsubmitted = $nsubmitted + _starpu_config->sched_ctxs[$num]->tasks_barrier->barrier->reached_start
  260. set $nready = $nready + _starpu_config->sched_ctxs[$num]->ready_tasks_barrier->barrier->reached_start
  261. set $num = $num + 1
  262. end
  263. printf "%d submitted tasks\n", $nsubmitted
  264. printf "%d ready tasks\n", $nready
  265. printf "Tasks being run:\n"
  266. set $n = 0
  267. while $n < _starpu_config.topology.nworkers
  268. printf "worker %d %s:\n", $n, _starpu_config.workers[$n].short_name
  269. if _starpu_config.workers[$n].pipeline_length > 0
  270. set $m = 0
  271. while $m < _starpu_config.workers[$n].ntasks
  272. 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]))]
  273. printf " task %p\n", $t
  274. set $m = $m + 1
  275. end
  276. end
  277. set $task = _starpu_config.workers[$n].current_task
  278. if ($task)
  279. printf " task %p\n", $task
  280. end
  281. set $n = $n + 1
  282. end
  283. if (tag_htbl)
  284. printf "TODO: tags\n"
  285. end
  286. print "TODO: complete\n"
  287. end
  288. define starpu-print-all-tasks
  289. set language c
  290. if ! _starpu_debug
  291. printf "you need to configure with --enable-debug to get starpu-print-all-tasks working\n"
  292. else
  293. set $l = all_jobs_list->next
  294. while $l != &all_jobs_list
  295. set $j = (struct _starpu_job*) (((unsigned long) $l) - ((unsigned long) &((struct _starpu_job *)0)->all_submitted))
  296. printf "task %p\n", $j->task
  297. starpu-print-task $j->task
  298. set $l = $l->next
  299. end
  300. end
  301. end
  302. define starpu-all-tasks
  303. set language c
  304. if ! _starpu_debug
  305. printf "you need to configure with --enable-debug to get starpu-all-tasks working\n"
  306. else
  307. set $l = all_jobs_list->next
  308. while $l != &all_jobs_list
  309. set $j = (struct _starpu_job*) (((unsigned long) $l) - ((unsigned long) &((struct _starpu_job *)0)->all_submitted))
  310. set $task = $j->task
  311. if $task->name
  312. printf "task %p %s\n", $task, $task->name
  313. else
  314. printf "task %p\n", $task
  315. end
  316. set $l = $l->next
  317. end
  318. end
  319. end
  320. define starpu
  321. printf "Here I am...\n"
  322. end
  323. define starpu-print-mode
  324. if ($arg0 & 1)
  325. printf "R"
  326. end
  327. if ($arg0 & 2)
  328. printf "W"
  329. end
  330. if ($arg0 & 4)
  331. printf " SCRATCH"
  332. end
  333. if ($arg0 & 8)
  334. printf " REDUX"
  335. end
  336. end
  337. define starpu-print-data
  338. set language c
  339. set $data = (starpu_data_handle_t) $arg0
  340. printf "Data handle %p\n", $data
  341. if $data->ops->interfaceid == 0
  342. printf "Matrix\n"
  343. end
  344. if $data->ops->interfaceid == 1
  345. printf "Block\n"
  346. end
  347. if $data->ops->interfaceid == 2
  348. printf "Vector\n"
  349. end
  350. if $data->ops->interfaceid == 3
  351. printf "CSR\n"
  352. end
  353. if $data->ops->interfaceid == 4
  354. printf "BCSR\n"
  355. end
  356. if $data->ops->interfaceid == 5
  357. printf "Variable\n"
  358. end
  359. if $data->ops->interfaceid == 6
  360. printf "Void\n"
  361. end
  362. if $data->ops->interfaceid == 7
  363. printf "Multiformat\n"
  364. end
  365. if $data->ops->interfaceid == 8
  366. printf "COO\n"
  367. end
  368. if $data->ops->interfaceid > 8
  369. printf "Interface id %d\n", $data->ops->interfaceid
  370. end
  371. printf "Home node %d\n", $data->home_node
  372. printf "RWlock refs %d\n", $data->refcnt
  373. printf "Busy count %d\n", $data->busy_count
  374. printf "Current mode "
  375. starpu-print-mode $data->current_mode
  376. printf "\n"
  377. if $data->current_mode & (4|8)
  378. set $n = 0
  379. while $n < _starpu_config.topology.nworkers
  380. set $replicate = $data->per_worker[$n]
  381. printf "Worker %2d %10s:", $n, _starpu_config->workers[$n]->name
  382. if $replicate.state == 0
  383. printf " OWNER"
  384. end
  385. if $replicate.state == 1
  386. printf " SHARED"
  387. end
  388. if $replicate.state == 2
  389. printf " INVALID"
  390. end
  391. if $replicate.initialized
  392. printf " initialized"
  393. end
  394. printf "\n"
  395. set $n = $n + 1
  396. end
  397. else
  398. set $n = 0
  399. while $n < _starpu_descr.nnodes
  400. set $replicate = &$data->per_node[$n]
  401. printf "Node %2d (%2d):", $n, $replicate->refcnt
  402. if $replicate.state == 0
  403. printf " OWNER"
  404. end
  405. if $replicate.state == 1
  406. printf " SHARED"
  407. end
  408. if $replicate.state == 2
  409. printf " INVALID"
  410. end
  411. if $replicate.initialized
  412. printf " initialized"
  413. end
  414. printf "\n"
  415. set $m = 0
  416. while $m < _starpu_descr.nnodes
  417. if $replicate->request[$m]
  418. printf " request %p from %d\n", $replicate->request[$m], $m
  419. end
  420. set $m = $m + 1
  421. end
  422. set $n = $n + 1
  423. end
  424. set $r = $data->write_invalidation_req
  425. if $r
  426. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  427. end
  428. end
  429. printf "Post sync tasks\n"
  430. set $tasklist = $data->post_sync_tasks
  431. while $tasklist != 0x0
  432. starpu-print-task $tasklist->task
  433. set $tasklist = $tasklist->next
  434. end
  435. printf "Requester tasks\n"
  436. set $requesterlist = $data->req_list._head
  437. while $requesterlist != 0x0
  438. printf "mode: "
  439. starpu-print-mode $requesterlist->mode
  440. printf "\n"
  441. starpu-print-job $requesterlist->j
  442. set $requesterlist = $requesterlist->_next
  443. end
  444. printf "Arbitered requester tasks\n"
  445. set $requesterlist = $data->arbitered_req_list._head
  446. while $requesterlist != 0x0
  447. printf "mode: "
  448. starpu-print-mode $requesterlist->mode
  449. printf "\n"
  450. starpu-print-job $requesterlist->j
  451. set $requesterlist = $requesterlist->_next
  452. end
  453. if ($data->nchildren)
  454. printf "%d children\n", $data->nchildren
  455. end
  456. end
  457. define starpu-print-datas
  458. set $entry = registered_handles
  459. while $entry
  460. starpu-print-data $entry->handle
  461. printf "\n"
  462. set $entry = (struct handle_entry *) $entry.hh.next
  463. end
  464. end
  465. define starpu-print-datas-summary
  466. set language c
  467. set $entry = registered_handles
  468. set $data_n = 0
  469. set $pw_data_n = 0
  470. set $data_n_allocated = 0
  471. set $replicate_n_owners = 0
  472. set $replicate_n_shared = 0
  473. set $replicate_n_invalid = 0
  474. set $replicate_n_initialized = 0
  475. set $replicate_n_allocated = 0
  476. set $pw_replicate_n_owners = 0
  477. set $pw_replicate_n_shared = 0
  478. set $pw_replicate_n_invalid = 0
  479. set $pw_replicate_n_initialized = 0
  480. set $pw_replicate_n_allocated = 0
  481. while $entry
  482. set $data = (starpu_data_handle_t) $entry->handle
  483. if $data->current_mode & (4|8)
  484. set $pw_data_n = $pw_data_n + 1
  485. set $n = 0
  486. while $n < _starpu_config.topology.nworkers
  487. set $replicate = $data->per_worker[$n]
  488. if $replicate.state == 0
  489. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  490. end
  491. if $replicate.state == 1
  492. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  493. end
  494. if $replicate.state == 2
  495. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  496. end
  497. if $replicate.initialized
  498. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  499. end
  500. if $replicate.allocated
  501. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  502. end
  503. set $n = $n + 1
  504. end
  505. else
  506. set $data_n = $data_n + 1
  507. set $n = 0
  508. while $n < _starpu_descr.nnodes
  509. set $replicate = &$data->per_node[$n]
  510. if $replicate.state == 0
  511. set $replicate_n_owners = $replicate_n_owners + 1
  512. end
  513. if $replicate.state == 1
  514. set $replicate_n_shared = $replicate_n_shared + 1
  515. end
  516. if $replicate.state == 2
  517. set $replicate_n_invalid = $replicate_n_invalid + 1
  518. end
  519. if $replicate.initialized
  520. set $replicate_n_initialized = $replicate_n_initialized + 1
  521. end
  522. if $replicate.allocated
  523. set $replicate_n_allocated = $replicate_n_allocated + 1
  524. set $data_allocated = 1
  525. end
  526. set $n = $n + 1
  527. end
  528. if $data_allocated
  529. set $data_n_allocated = $data_n_allocated + 1
  530. end
  531. end
  532. set $entry = (struct handle_entry *) $entry.hh.next
  533. end
  534. printf "Number of handles: %d\n", $data_n
  535. printf "Number of allocated handles: %d\n", $data_n_allocated
  536. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  537. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  538. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  539. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  540. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  541. printf "Number of per-worker handles: %d\n", $pw_data_n
  542. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  543. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  544. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  545. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  546. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  547. end
  548. define starpu-print-replicate
  549. set $repl = (struct _starpu_data_replicate*) $arg0
  550. printf "Handle %p\n", $repl->handle
  551. printf "Interface %p\n", $repl->data_interface
  552. printf "Refcnt %u\n", $repl->refcnt
  553. printf "Node %u\n", $repl->memory_node
  554. if $repl->state == 0
  555. printf "Owner\n"
  556. end
  557. if $repl->state == 1
  558. printf "Shared\n"
  559. end
  560. if $repl->state == 2
  561. printf "Invalid\n"
  562. end
  563. if $repl->relaxed_coherency
  564. printf " relaxed_coherency"
  565. end
  566. if $repl->initialized
  567. printf " initialized"
  568. end
  569. if $repl->allocated
  570. printf " allocated"
  571. end
  572. if $repl->automatically_allocated
  573. printf " automatically allocated"
  574. end
  575. if $repl->requested
  576. printf " requested"
  577. end
  578. printf "\n"
  579. printf "MC %p\n", $repl->mc
  580. end
  581. define starpu-print-request
  582. set $r = (struct _starpu_data_request *)$arg0
  583. printf "Request %p\n", $r
  584. printf "Origin %s\n", $r->origin
  585. printf "Refcnt %d\n", $r->refcnt
  586. printf "Handle %p\n", $r->handle
  587. printf "src_replicate %p", $r->src_replicate
  588. if $r->src_replicate
  589. printf " (%d)", $r->src_replicate->memory_node
  590. end
  591. printf "\n"
  592. printf "dst_replicate %p", $r->dst_replicate
  593. if $r->dst_replicate
  594. printf " (%d)", $r->dst_replicate->memory_node
  595. end
  596. printf "\n"
  597. printf "handling_node %d\n", $r->handling_node
  598. if ($r->mode & 1)
  599. printf "R"
  600. end
  601. if ($r->mode & 2)
  602. printf "W"
  603. end
  604. if ($r->mode & 4)
  605. printf "S"
  606. end
  607. if ($r->mode & 8)
  608. printf "X"
  609. end
  610. printf "\n"
  611. printf "completed: %d\n", $r->completed
  612. printf "prefetch: %d\n", $r->prefetch
  613. printf "retval: %d\n", $r->retval
  614. printf "ndeps: %d\n", $r->ndeps
  615. printf "next_req_count: %d\n", $r->next_req_count
  616. set $c = 0
  617. while $c < $r->next_req_count
  618. printf " %p\n", $r->next_req[$c]
  619. set $c = $c + 1
  620. end
  621. printf "comid: %u\n", $r->com_id
  622. set $c = $r->callbacks
  623. while $c != 0
  624. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  625. set $c = $c->next
  626. end
  627. end
  628. define starpu-print-requests-treelist
  629. set $list = $arg0
  630. set $request = $list->_head
  631. while $request != 0
  632. printf " Request %p: handle %p ", $request, $request->handle
  633. starpu-print-mode $request->mode
  634. printf "\n"
  635. set $request = $request->_next
  636. end
  637. end
  638. define starpu-print-requests-tree
  639. if $arg0
  640. starpu-print-requests-tree $arg0->children[0]
  641. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  642. starpu-print-requests-treelist (&($stage->list))
  643. starpu-print-requests-tree $arg0->children[1]
  644. end
  645. end
  646. define starpu-print-requests-list
  647. if _starpu_debug
  648. starpu-print-requests-treelist &$arg0.list
  649. else
  650. starpu-print-requests-tree $arg0.tree.root
  651. end
  652. end
  653. define starpu-print-requests
  654. set $node = 0
  655. while $node < _starpu_descr.nnodes
  656. printf "Node %u:\n", $node
  657. starpu-print-requests-list data_requests[$node]
  658. set $node = $node + 1
  659. end
  660. end
  661. define starpu-print-prequests
  662. set $node = 0
  663. while $node < _starpu_descr.nnodes
  664. printf "Node %u:\n", $node
  665. printf "%u pending requests\n", data_requests_npending[$node]
  666. starpu-print-requests-list data_requests_pending[$node]
  667. set $node = $node + 1
  668. end
  669. end
  670. define starpu-print-arch
  671. set $arch = (struct starpu_perfmodel_arch *)$arg0
  672. set $device = 0
  673. while $device < $arch->ndevices
  674. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  675. set $device = $device + 1
  676. end
  677. end
  678. define starpu-print-archs
  679. set $comb = 0
  680. while $comb < current_arch_comb
  681. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  682. starpu-print-arch arch_combs[$comb]
  683. set $comb = $comb + 1
  684. end
  685. end
  686. define starpu-print-frequests
  687. set $node = 0
  688. while $node < _starpu_descr.nnodes
  689. printf "Node %u:\n", $node
  690. starpu-print-requests-list prefetch_requests[$node]
  691. set $node = $node + 1
  692. end
  693. end
  694. define starpu-print-irequests
  695. set $node = 0
  696. while $node < _starpu_descr.nnodes
  697. printf "Node %u:\n", $node
  698. starpu-print-requests-list idle_requests[$node]
  699. set $node = $node + 1
  700. end
  701. end
  702. define starpu-memusage
  703. set scheduler-locking on
  704. set $node = 0
  705. while $node < _starpu_descr.nnodes
  706. printf "\n\nNode %u:\n", $node
  707. set $total = 0
  708. set $total_b = 0
  709. set $wt = 0
  710. set $wt_b = 0
  711. set $home = 0
  712. set $home_b = 0
  713. set $ooc = 0
  714. set $ooc_b = 0
  715. set $diduse = 0
  716. set $diduse_b = 0
  717. set $redux = 0
  718. set $redux_b = 0
  719. set $relax = 0
  720. set $relax_b = 0
  721. set $noref = 0
  722. set $noref_b = 0
  723. set $normal = 0
  724. set $normal_b = 0
  725. set $owner = 0
  726. set $owner_b = 0
  727. set $shared = 0
  728. set $shared_b = 0
  729. set $invalid = 0
  730. set $invalid_b = 0
  731. set $nodataref = 0
  732. set $nodataref_b = 0
  733. set $nosubdataref = 0
  734. set $nosubdataref_b = 0
  735. set $reading = 0
  736. set $reading_b = 0
  737. set $writing = 0
  738. set $writing_b = 0
  739. set $overwriting = 0
  740. set $overwriting_b = 0
  741. set $mc = mc_list[$node]->_head
  742. set pagination off
  743. while $mc != 0
  744. set $handle = $mc->data
  745. set $size = _starpu_data_get_size($handle)
  746. set $total = $total + 1
  747. if $total % 100 == 0
  748. printf "\rinspected %d data...", $total
  749. end
  750. set $total_b = $total_b + $size
  751. if $handle->wt_mask & (1 << $node)
  752. set $wt = $wt + 1
  753. set $wt_b = $wt_b + $size
  754. end
  755. if $node == $handle->home_node
  756. set $home = $home + 1
  757. set $home_b = $home_b + $size
  758. end
  759. if $handle->ooc
  760. set $ooc = $ooc + 1
  761. set $ooc_b = $ooc_b + $size
  762. end
  763. if $mc->diduse
  764. set $diduse = $diduse + 1
  765. set $diduse_b = $diduse_b + $size
  766. end
  767. if $mc->relaxed_coherency == 2
  768. set $redux = $redux + 1
  769. set $redux_b = $redux_b + $size
  770. end
  771. if $mc->relaxed_coherency == 1
  772. set $relax = $relax + 1
  773. set $relax_b = $relax_b + $size
  774. if $mc->replicate
  775. if $mc->replicate->refcnt == 0
  776. set $noref = $noref + 1
  777. set $noref_b = $noref_b + $size
  778. end
  779. end
  780. end
  781. if $mc->relaxed_coherency == 0
  782. set $normal = $normal + 1
  783. set $normal_b = $normal_b + $size
  784. if $handle->per_node[$node].state == STARPU_OWNER
  785. set $owner = $owner + 1
  786. set $owner_b = $owner_b + $size
  787. end
  788. if $handle->per_node[$node].state == STARPU_SHARED
  789. set $shared = $shared + 1
  790. set $shared_b = $shared_b + $size
  791. end
  792. if $handle->per_node[$node].state == STARPU_INVALID
  793. set $invalid = $invalid + 1
  794. set $invalid_b = $invalid_b + $size
  795. end
  796. if (may_free_subtree($handle,$node))
  797. set $nosubdataref = $nosubdataref + 1
  798. set $nosubdataref_b = $nosubdataref_b + $size
  799. end
  800. if $handle->per_node[$node].refcnt == 0
  801. set $nodataref = $nodataref + 1
  802. set $nodataref_b = $nodataref_b + $size
  803. else
  804. set $r = 0
  805. set $w = 0
  806. set $_node = 0
  807. while $_node < _starpu_descr.nnodes
  808. set $_node = $_node + 1
  809. if $_node != $node
  810. if $handle->per_node[$_node].request[$node] != 0
  811. set $r = $r + 1
  812. end
  813. if $handle->per_node[$node].request[$_node] != 0
  814. set $w = $w + 1
  815. end
  816. end
  817. end
  818. if $r != 0
  819. set $reading = $reading + 1
  820. set $reading_b = $reading_b + $size
  821. end
  822. if $w != 0
  823. set $writing = $writing + 1
  824. set $writing_b = $writing_b + $size
  825. end
  826. if $handle->per_node[$node].request[$node] != 0
  827. set $overwriting = $overwriting + 1
  828. set $overwriting_b = $overwriting_b + $size
  829. end
  830. end
  831. end
  832. set $mc = $mc->_next
  833. end
  834. set pagination on
  835. printf "\r \r"
  836. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  837. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  838. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  839. printf " OOC: %u, %uMiB\n", $ooc, $ooc_b / 1048576
  840. printf " diduse: %u, %uMiB\n", $diduse, $diduse_b / 1048576
  841. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  842. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  843. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  844. printf " normal: %u, %uMiB\n", $normal, $normal_b / 1048576
  845. printf " owner: %u, %uMiB\n", $owner, $owner_b / 1048576
  846. printf " shared: %u, %uMiB\n", $shared, $shared_b / 1048576
  847. printf " invalid: %u, %uMiB\n", $invalid, $invalid_b / 1048576
  848. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  849. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  850. printf " reading: %u, %uMiB\n", $reading, $reading_b / 1048576
  851. printf " writing: %u, %uMiB\n", $writing, $writing_b / 1048576
  852. printf " overwriting: %u, %uMiB\n", $overwriting, $overwriting_b / 1048576
  853. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  854. set $node = $node + 1
  855. end
  856. end
  857. define starpu-print-model
  858. set $model = (struct starpu_perfmodel *)$arg0
  859. printf "Model %p type %d symbol ", $model, $model->type
  860. if $model->symbol
  861. printf "%s", $model->symbol
  862. else
  863. printf "NULL"
  864. end
  865. printf "\n"
  866. end
  867. define starpu-print-registered-models
  868. set $node = registered_models
  869. while $node
  870. starpu-print-model $node->model
  871. set $node = $node->next
  872. end
  873. end
  874. define starpu-sched-data
  875. print _starpu_config.sched_ctxs[$arg0]->policy_data
  876. end
  877. define starpu-print-spaces
  878. set $j = 0
  879. while $j < $arg0
  880. printf " "
  881. set $j = $j + 1
  882. end
  883. end
  884. define starpu-sched-print-component
  885. set $c = (struct starpu_sched_component *) $arg1
  886. starpu-print-spaces $arg0
  887. printf "%s %c %c (struct starpu_sched_component *) %p\n", $c->name, $c->properties & STARPU_SCHED_COMPONENT_HOMOGENEOUS ? 'o':'e', $c->properties & STARPU_SCHED_COMPONENT_SINGLE_MEMORY_NODE ? 's' : 'm', $c
  888. if $c->push_task == fifo_push_task
  889. set $f = &((struct _starpu_fifo_data *) $c->data)->fifo
  890. starpu-print-spaces $arg0
  891. printf "%d tasks start %f len %f end %f processed %d\n", $f->ntasks, $f->exp_start, $f->exp_len, $f->exp_end, $f->nprocessed
  892. end
  893. if $c->push_task == prio_push_task
  894. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  895. starpu-print-spaces $arg0
  896. printf "%d tasks start %f len %f end %f processed %d\n", $q->ntasks, $q->exp_start, $q->exp_len, $q->exp_end, $q->nprocessed
  897. end
  898. if $c->push_task == simple_worker_push_task
  899. set $d = (struct _starpu_worker_component_data *) $c->data
  900. set $l = $d->list
  901. starpu-print-spaces $arg0
  902. 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
  903. end
  904. end
  905. define starpu-sched-print-recur-component
  906. starpu-sched-print-component $arg0 $arg1
  907. set $i[$arg0] = 0
  908. while $i[$arg0] < $arg1->nchildren
  909. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  910. set $i[$arg0] = $i[$arg0] + 1
  911. end
  912. end
  913. define starpu-sched-print-modular
  914. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  915. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  916. starpu-sched-print-recur-component 0 $t->root
  917. end
  918. define starpu-mpi-print-request
  919. set $request = (struct _starpu_mpi_req *)$arg0
  920. printf "Request (struct _starpu_mpi_req *) %p data %p tag %d to MPI node %d type ", $request, $request->data_handle, $request->data_handle && $request->data_handle->mpi_data ? ((struct _starpu_mpi_node_tag *) ($request->data_handle->mpi_data))->data_tag : -1, $request->node_tag.node.rank,
  921. if $request->request_type == SEND_REQ
  922. printf "SEND_REQ"
  923. end
  924. if $request->request_type == RECV_REQ
  925. printf "RECV_REQ"
  926. end
  927. if $request->request_type == WAIT_REQ
  928. printf "WAIT_REQ"
  929. end
  930. if $request->request_type == TEST_REQ
  931. printf "TEST_REQ"
  932. end
  933. if $request->request_type == BARRIER_REQ
  934. printf "BARRIER_REQ"
  935. end
  936. if $request->request_type == PROBE_REQ
  937. printf "PROBE_REQ"
  938. end
  939. if $request->request_type == UNKNOWN_REQ
  940. printf "UNKNOWN_REQ"
  941. end
  942. printf " submitted %d completed %d posted %d detached %d\n", $request->submitted, $request->completed, $request->posted, $request->detached
  943. end
  944. define starpu-mpi-print-ready-recv-requests
  945. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  946. if $list
  947. set $request = $list.list._head
  948. while $request
  949. starpu-mpi-print-request $request
  950. set $request = $request->_next
  951. end
  952. else
  953. printf "No ready recv requests\n"
  954. end
  955. end
  956. define starpu-mpi-print-requests-list
  957. set $list = $arg0
  958. set $request = $list->_head
  959. while $request
  960. starpu-mpi-print-request $request
  961. set $request = $request->_next
  962. end
  963. end
  964. define starpu-mpi-print-requests-tree
  965. if $arg0
  966. starpu-mpi-print-requests-tree $arg0->children[0]
  967. set $stage = (struct _starpu_mpi_req_prio_list_stage *) $arg0
  968. starpu-mpi-print-requests-list (&($stage->list))
  969. starpu-mpi-print-requests-tree $arg0->children[1]
  970. end
  971. end
  972. define starpu-mpi-print-ready-send-requests
  973. set $prio_list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  974. if _starpu_debug
  975. if $prio_list
  976. starpu-mpi-print-requests-list &$prio_list.list
  977. else
  978. printf "No ready send requests\n"
  979. end
  980. else
  981. if $prio_list.empty == 0
  982. starpu-mpi-print-requests-tree $prio_list.tree.root
  983. else
  984. printf "No ready send requests\n"
  985. end
  986. end
  987. end
  988. define starpu-mpi-print-detached-requests
  989. set $list = (struct _starpu_mpi_req_list) detached_requests
  990. if $list
  991. set $request = $list.list._head
  992. while $request
  993. starpu-mpi-print-request $request
  994. set $request = $request->_next
  995. end
  996. else
  997. printf "No detached requests\n"
  998. end
  999. end
  1000. define starpu-mpi-print-early-data
  1001. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  1002. if $hash
  1003. while $hash
  1004. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1005. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  1006. if $list
  1007. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  1008. while $data
  1009. starpu-mpi-print-request $data->req
  1010. set $data = $data->_next
  1011. end
  1012. end
  1013. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  1014. end
  1015. else
  1016. printf "No early data\n"
  1017. end
  1018. end
  1019. define starpu-mpi-print-early-requests
  1020. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  1021. if $hash
  1022. while $hash
  1023. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1024. set $list = (struct _starpu_mpi_req_list*) $hash->list
  1025. if $list
  1026. set $request = $list->_head
  1027. while $request
  1028. starpu-mpi-print-request $request
  1029. set $request = $request->_next
  1030. end
  1031. end
  1032. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  1033. end
  1034. else
  1035. printf "No early request\n"
  1036. end
  1037. end
  1038. define starpu-mpi-print-sync-data
  1039. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  1040. if $hash
  1041. while $hash
  1042. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1043. set $list = (struct _starpu_mpi_req_list *) $hash->list
  1044. if $list
  1045. set $request = $list->_head
  1046. while $request
  1047. starpu-mpi-print-request $request
  1048. set $request = $request->_next
  1049. end
  1050. end
  1051. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  1052. end
  1053. else
  1054. printf "No sync data\n"
  1055. end
  1056. end
  1057. document starpu
  1058. List of StarPU-specific gdb functions:
  1059. starpu-workers prints a list of the StarPU workers
  1060. starpu-tasks-on-workers prints a list of the tasks queued on workers
  1061. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  1062. starpu-print-job prints a StarPU job
  1063. starpu-print-task prints a StarPU task
  1064. starpu-print-all-tasks prints all StarPU tasks
  1065. starpu-print-task-and-successor prints a StarPU task and its successors
  1066. starpu-print-data prints a StarPU data handle
  1067. starpu-print-datas prints all StarPU data handles
  1068. starpu-print-datas-summary prints a summary of data handles
  1069. starpu-print-replicate prints a StarPU data replicate
  1070. starpu-print-request prints a StarPU data request
  1071. starpu-print-prequests prints all pending StarPU data requests
  1072. starpu-print-requests prints all queued StarPU data requests
  1073. starpu-print-frequests prints all queued StarPU prefetch data requests
  1074. starpu-print-irequests prints all queued StarPU idle data requests
  1075. starpu-tasks prints a summary of the tasks flowing in StarPU
  1076. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  1077. starpu-tags prints a list of the tags known to StarPU
  1078. starpu-print-tag prints a given tag
  1079. starpu-memusage prints the memory node usage
  1080. starpu-print-archs prints all known arch combinations
  1081. starpu-print-arch prints a given arch combination
  1082. starpu-print-registered-models prints all registered performance models
  1083. starpu-print-model prints a given performance model
  1084. starpu-sched-data prints the data of the given scheduler
  1085. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  1086. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  1087. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  1088. starpu-mpi-print-detached-requests prints all MPI detached requests
  1089. starpu-mpi-print-early-data prints all MPI early received data
  1090. starpu-mpi-print-early-requests prints all MPI early requests
  1091. starpu-mpi-print-sync-data prints all MPI sync data
  1092. end