gdbinit 34 KB

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