gdbinit 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2021 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 == 9
  369. printf "Tensor\n"
  370. end
  371. if $data->ops->interfaceid > 9
  372. printf "Interface id %d\n", $data->ops->interfaceid
  373. end
  374. printf "Home node %d\n", $data->home_node
  375. printf "RWlock refs %d\n", $data->refcnt
  376. printf "Busy count %d\n", $data->busy_count
  377. printf "Initialization submitted %d\n", $data->initialized
  378. printf "Current mode "
  379. starpu-print-mode $data->current_mode
  380. printf "\n"
  381. if $data->mpi_data
  382. printf "TAG %ld\n",((struct _starpu_mpi_data *) ($data->mpi_data))->node_tag.data_tag
  383. end
  384. if $data->current_mode & (4|8)
  385. set $n = 0
  386. while $n < _starpu_config.topology.nworkers
  387. set $replicate = $data->per_worker[$n]
  388. printf "Worker %2d %10s:", $n, _starpu_config->workers[$n]->name
  389. if $replicate.state == 0
  390. printf " OWNER"
  391. end
  392. if $replicate.state == 1
  393. printf " SHARED"
  394. end
  395. if $replicate.state == 2
  396. printf " INVALID"
  397. end
  398. if $replicate.initialized
  399. printf " initialized"
  400. end
  401. printf "\n"
  402. set $n = $n + 1
  403. end
  404. else
  405. set $n = 0
  406. while $n < _starpu_descr.nnodes
  407. set $replicate = &$data->per_node[$n]
  408. printf "Node %2d (%2d):", $n, $replicate->refcnt
  409. if $replicate.state == 0
  410. printf " OWNER"
  411. end
  412. if $replicate.state == 1
  413. printf " SHARED"
  414. end
  415. if $replicate.state == 2
  416. printf " INVALID"
  417. end
  418. if $replicate.initialized
  419. printf " initialized"
  420. end
  421. printf "\n"
  422. set $m = 0
  423. while $m < _starpu_descr.nnodes
  424. if $replicate->request[$m]
  425. printf " request %p from %d\n", $replicate->request[$m], $m
  426. end
  427. set $m = $m + 1
  428. end
  429. set $n = $n + 1
  430. end
  431. set $r = $data->write_invalidation_req
  432. if $r
  433. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  434. end
  435. end
  436. printf "Post sync tasks\n"
  437. set $tasklist = $data->post_sync_tasks
  438. while $tasklist != 0x0
  439. starpu-print-task $tasklist->task
  440. set $tasklist = $tasklist->next
  441. end
  442. if _starpu_debug
  443. printf "Requester tasks\n"
  444. set $requesterlist = $data->req_list.list._head
  445. while $requesterlist != 0x0
  446. printf "mode: "
  447. starpu-print-mode $requesterlist->mode
  448. printf "\n"
  449. starpu-print-job $requesterlist->j
  450. set $requesterlist = $requesterlist->_next
  451. end
  452. printf "Arbitered requester tasks\n"
  453. set $requesterlist = $data->arbitered_req_list.list._head
  454. while $requesterlist != 0x0
  455. printf "mode: "
  456. starpu-print-mode $requesterlist->mode
  457. printf "\n"
  458. starpu-print-job $requesterlist->j
  459. set $requesterlist = $requesterlist->_next
  460. end
  461. else
  462. printf "Printing requester tasks not supported yet without --enable-debug, sorry!\n"
  463. end
  464. if ($data->nchildren)
  465. printf "%d children\n", $data->nchildren
  466. end
  467. end
  468. define starpu-print-datas
  469. set $entry = registered_handles
  470. while $entry
  471. starpu-print-data $entry->handle
  472. printf "\n"
  473. set $entry = (struct handle_entry *) $entry.hh.next
  474. end
  475. end
  476. define starpu-print-datas-summary
  477. set language c
  478. set $entry = registered_handles
  479. set $data_n = 0
  480. set $pw_data_n = 0
  481. set $data_n_allocated = 0
  482. set $replicate_n_owners = 0
  483. set $replicate_n_shared = 0
  484. set $replicate_n_invalid = 0
  485. set $replicate_n_initialized = 0
  486. set $replicate_n_allocated = 0
  487. set $pw_replicate_n_owners = 0
  488. set $pw_replicate_n_shared = 0
  489. set $pw_replicate_n_invalid = 0
  490. set $pw_replicate_n_initialized = 0
  491. set $pw_replicate_n_allocated = 0
  492. while $entry
  493. set $data = (starpu_data_handle_t) $entry->handle
  494. if $data->current_mode & (4|8)
  495. set $pw_data_n = $pw_data_n + 1
  496. set $n = 0
  497. while $n < _starpu_config.topology.nworkers
  498. set $replicate = $data->per_worker[$n]
  499. if $replicate.state == 0
  500. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  501. end
  502. if $replicate.state == 1
  503. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  504. end
  505. if $replicate.state == 2
  506. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  507. end
  508. if $replicate.initialized
  509. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  510. end
  511. if $replicate.allocated
  512. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  513. end
  514. set $n = $n + 1
  515. end
  516. else
  517. set $data_n = $data_n + 1
  518. set $n = 0
  519. while $n < _starpu_descr.nnodes
  520. set $replicate = &$data->per_node[$n]
  521. if $replicate.state == 0
  522. set $replicate_n_owners = $replicate_n_owners + 1
  523. end
  524. if $replicate.state == 1
  525. set $replicate_n_shared = $replicate_n_shared + 1
  526. end
  527. if $replicate.state == 2
  528. set $replicate_n_invalid = $replicate_n_invalid + 1
  529. end
  530. if $replicate.initialized
  531. set $replicate_n_initialized = $replicate_n_initialized + 1
  532. end
  533. if $replicate.allocated
  534. set $replicate_n_allocated = $replicate_n_allocated + 1
  535. set $data_allocated = 1
  536. end
  537. set $n = $n + 1
  538. end
  539. if $data_allocated
  540. set $data_n_allocated = $data_n_allocated + 1
  541. end
  542. end
  543. set $entry = (struct handle_entry *) $entry.hh.next
  544. end
  545. printf "Number of handles: %d\n", $data_n
  546. printf "Number of allocated handles: %d\n", $data_n_allocated
  547. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  548. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  549. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  550. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  551. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  552. printf "Number of per-worker handles: %d\n", $pw_data_n
  553. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  554. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  555. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  556. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  557. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  558. end
  559. define starpu-print-replicate
  560. set $repl = (struct _starpu_data_replicate*) $arg0
  561. printf "Handle %p\n", $repl->handle
  562. printf "Interface %p\n", $repl->data_interface
  563. printf "Refcnt %u\n", $repl->refcnt
  564. printf "Node %u\n", $repl->memory_node
  565. if $repl->state == 0
  566. printf "Owner\n"
  567. end
  568. if $repl->state == 1
  569. printf "Shared\n"
  570. end
  571. if $repl->state == 2
  572. printf "Invalid\n"
  573. end
  574. if $repl->relaxed_coherency
  575. printf " relaxed_coherency"
  576. end
  577. if $repl->initialized
  578. printf " initialized"
  579. end
  580. if $repl->allocated
  581. printf " allocated"
  582. end
  583. if $repl->automatically_allocated
  584. printf " automatically allocated"
  585. end
  586. if $repl->requested
  587. printf " requested"
  588. end
  589. printf "\n"
  590. printf "MC %p\n", $repl->mc
  591. end
  592. define starpu-print-request
  593. set $r = (struct _starpu_data_request *)$arg0
  594. printf "Request %p\n", $r
  595. printf "Origin %s\n", $r->origin
  596. printf "Refcnt %d\n", $r->refcnt
  597. printf "Handle %p\n", $r->handle
  598. printf "src_replicate %p", $r->src_replicate
  599. if $r->src_replicate
  600. printf " (%d)", $r->src_replicate->memory_node
  601. end
  602. printf "\n"
  603. printf "dst_replicate %p", $r->dst_replicate
  604. if $r->dst_replicate
  605. printf " (%d)", $r->dst_replicate->memory_node
  606. end
  607. printf "\n"
  608. printf "handling_node %d\n", $r->handling_node
  609. if ($r->mode & 1)
  610. printf "R"
  611. end
  612. if ($r->mode & 2)
  613. printf "W"
  614. end
  615. if ($r->mode & 4)
  616. printf "S"
  617. end
  618. if ($r->mode & 8)
  619. printf "X"
  620. end
  621. printf "\n"
  622. printf "completed: %d\n", $r->completed
  623. printf "prefetch: %d\n", $r->prefetch
  624. printf "retval: %d\n", $r->retval
  625. printf "ndeps: %d\n", $r->ndeps
  626. printf "next_req_count: %d\n", $r->next_req_count
  627. set $c = 0
  628. while $c < $r->next_req_count
  629. printf " %p\n", $r->next_req[$c]
  630. set $c = $c + 1
  631. end
  632. printf "comid: %u\n", $r->com_id
  633. set $c = $r->callbacks
  634. while $c != 0
  635. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  636. set $c = $c->next
  637. end
  638. end
  639. define starpu-print-requests-treelist
  640. set $list = $arg0
  641. set $request = $list->_head
  642. while $request != 0
  643. printf " Request %p: handle %p ", $request, $request->handle
  644. starpu-print-mode $request->mode
  645. printf "\n"
  646. set $request = $request->_next
  647. end
  648. end
  649. define starpu-print-requests-tree
  650. if $arg0
  651. starpu-print-requests-tree $arg0->children[0]
  652. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  653. starpu-print-requests-treelist (&($stage->list))
  654. starpu-print-requests-tree $arg0->children[1]
  655. end
  656. end
  657. define starpu-print-requests-list
  658. if _starpu_debug
  659. starpu-print-requests-treelist &$arg0.list
  660. else
  661. starpu-print-requests-tree $arg0.tree.root
  662. end
  663. end
  664. define starpu-print-requests
  665. set $node = 0
  666. while $node < _starpu_descr.nnodes
  667. printf "Node %u:\n", $node
  668. set $node2 = 0
  669. while $node2 < _starpu_descr.nnodes
  670. starpu-print-requests-list data_requests[$node][$node2][0]
  671. starpu-print-requests-list data_requests[$node][$node2][1]
  672. set $node2 = $node2 + 1
  673. end
  674. set $node = $node + 1
  675. end
  676. end
  677. define starpu-print-prequests
  678. set $node = 0
  679. while $node < _starpu_descr.nnodes
  680. printf "Node %u:\n", $node
  681. set $node2 = 0
  682. while $node2 < _starpu_descr.nnodes
  683. printf "%u pending requests from %u\n", data_requests_npending[$node][$node2][0], $node2
  684. starpu-print-requests-list data_requests_pending[$node][$node2][0]
  685. printf "%u pending requests to %u\n", data_requests_npending[$node][$node2][1], $node2
  686. starpu-print-requests-list data_requests_pending[$node][$node2][1]
  687. set $node2 = $node2 + 1
  688. end
  689. set $node = $node + 1
  690. end
  691. end
  692. define starpu-print-arch
  693. set $arch = (struct starpu_perfmodel_arch *)$arg0
  694. set $device = 0
  695. while $device < $arch->ndevices
  696. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  697. set $device = $device + 1
  698. end
  699. end
  700. define starpu-print-archs
  701. set $comb = 0
  702. while $comb < current_arch_comb
  703. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  704. starpu-print-arch arch_combs[$comb]
  705. set $comb = $comb + 1
  706. end
  707. end
  708. define starpu-print-frequests
  709. set $node = 0
  710. while $node < _starpu_descr.nnodes
  711. printf "Node %u:\n", $node
  712. set $node2 = 0
  713. while $node2 < _starpu_descr.nnodes
  714. starpu-print-requests-list prefetch_requests[$node][$node2][0]
  715. starpu-print-requests-list prefetch_requests[$node][$node2][1]
  716. set $node2 = $node2 + 1
  717. end
  718. set $node = $node + 1
  719. end
  720. end
  721. define starpu-print-irequests
  722. set $node = 0
  723. while $node < _starpu_descr.nnodes
  724. printf "Node %u:\n", $node
  725. set $node2 = 0
  726. while $node2 < _starpu_descr.nnodes
  727. starpu-print-requests-list idle_requests[$node][$node2][0]
  728. starpu-print-requests-list idle_requests[$node][$node2][1]
  729. set $node2 = $node2 + 1
  730. end
  731. set $node = $node + 1
  732. end
  733. end
  734. define starpu-memusage
  735. set scheduler-locking on
  736. set $node = 0
  737. while $node < _starpu_descr.nnodes
  738. printf "\n\nNode %u:\n", $node
  739. set $total = 0
  740. set $total_b = 0
  741. set $wt = 0
  742. set $wt_b = 0
  743. set $home = 0
  744. set $home_b = 0
  745. set $ooc = 0
  746. set $ooc_b = 0
  747. set $prefetch = 0
  748. set $prefetch_b = 0
  749. set $redux = 0
  750. set $redux_b = 0
  751. set $relax = 0
  752. set $relax_b = 0
  753. set $noref = 0
  754. set $noref_b = 0
  755. set $normal = 0
  756. set $normal_b = 0
  757. set $owner = 0
  758. set $owner_b = 0
  759. set $shared = 0
  760. set $shared_b = 0
  761. set $invalid = 0
  762. set $invalid_b = 0
  763. set $nodataref = 0
  764. set $nodataref_b = 0
  765. set $nosubdataref = 0
  766. set $nosubdataref_b = 0
  767. set $reading = 0
  768. set $reading_b = 0
  769. set $writing = 0
  770. set $writing_b = 0
  771. set $overwriting = 0
  772. set $overwriting_b = 0
  773. set $mc = mc_list[$node]->_head
  774. set pagination off
  775. while $mc != 0
  776. set $handle = $mc->data
  777. set $replicate = &$handle->per_node[$node]
  778. set $size = _starpu_data_get_size($handle)
  779. set $total = $total + 1
  780. if $total % 100 == 0
  781. printf "\rinspected %d data...", $total
  782. end
  783. set $total_b = $total_b + $size
  784. if $handle->wt_mask & (1 << $node)
  785. set $wt = $wt + 1
  786. set $wt_b = $wt_b + $size
  787. end
  788. if $node == $handle->home_node
  789. set $home = $home + 1
  790. set $home_b = $home_b + $size
  791. end
  792. if $handle->ooc
  793. set $ooc = $ooc + 1
  794. set $ooc_b = $ooc_b + $size
  795. end
  796. if $replicate->nb_tasks_prefetch
  797. set $prefetch = $prefetch + 1
  798. set $prefetch_b = $prefetch_b + $size
  799. end
  800. if $mc->relaxed_coherency == 2
  801. set $redux = $redux + 1
  802. set $redux_b = $redux_b + $size
  803. end
  804. if $mc->relaxed_coherency == 1
  805. set $relax = $relax + 1
  806. set $relax_b = $relax_b + $size
  807. if $mc->replicate
  808. if $mc->replicate->refcnt == 0
  809. set $noref = $noref + 1
  810. set $noref_b = $noref_b + $size
  811. end
  812. end
  813. end
  814. if $mc->relaxed_coherency == 0
  815. set $normal = $normal + 1
  816. set $normal_b = $normal_b + $size
  817. if $replicate->state == STARPU_OWNER
  818. set $owner = $owner + 1
  819. set $owner_b = $owner_b + $size
  820. end
  821. if $replicate->state == STARPU_SHARED
  822. set $shared = $shared + 1
  823. set $shared_b = $shared_b + $size
  824. end
  825. if $replicate->state == STARPU_INVALID
  826. set $invalid = $invalid + 1
  827. set $invalid_b = $invalid_b + $size
  828. end
  829. if (may_free_subtree($handle,$node))
  830. set $nosubdataref = $nosubdataref + 1
  831. set $nosubdataref_b = $nosubdataref_b + $size
  832. end
  833. if $replicate->refcnt == 0
  834. set $nodataref = $nodataref + 1
  835. set $nodataref_b = $nodataref_b + $size
  836. else
  837. set $r = 0
  838. set $w = 0
  839. set $_node = 0
  840. while $_node < _starpu_descr.nnodes
  841. set $_node = $_node + 1
  842. if $_node != $node
  843. if $handle->per_node[$_node].request[$node] != 0
  844. set $r = $r + 1
  845. end
  846. if $handle->per_node[$node].request[$_node] != 0
  847. set $w = $w + 1
  848. end
  849. end
  850. end
  851. if $r != 0
  852. set $reading = $reading + 1
  853. set $reading_b = $reading_b + $size
  854. end
  855. if $w != 0
  856. set $writing = $writing + 1
  857. set $writing_b = $writing_b + $size
  858. end
  859. if $replicate->request[$node] != 0
  860. set $overwriting = $overwriting + 1
  861. set $overwriting_b = $overwriting_b + $size
  862. end
  863. end
  864. end
  865. set $mc = $mc->_next
  866. end
  867. set pagination on
  868. printf "\r \r"
  869. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  870. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  871. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  872. printf " OOC: %u, %uMiB\n", $ooc, $ooc_b / 1048576
  873. printf " prefetch: %u, %uMiB\n", $prefetch, $prefetch_b / 1048576
  874. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  875. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  876. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  877. printf " normal: %u, %uMiB\n", $normal, $normal_b / 1048576
  878. printf " owner: %u, %uMiB\n", $owner, $owner_b / 1048576
  879. printf " shared: %u, %uMiB\n", $shared, $shared_b / 1048576
  880. printf " invalid: %u, %uMiB\n", $invalid, $invalid_b / 1048576
  881. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  882. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  883. printf " reading: %u, %uMiB\n", $reading, $reading_b / 1048576
  884. printf " writing: %u, %uMiB\n", $writing, $writing_b / 1048576
  885. printf " overwriting: %u, %uMiB\n", $overwriting, $overwriting_b / 1048576
  886. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  887. set $node = $node + 1
  888. end
  889. end
  890. define starpu-print-model
  891. set $model = (struct starpu_perfmodel *)$arg0
  892. printf "Model %p type %d symbol ", $model, $model->type
  893. if $model->symbol
  894. printf "%s", $model->symbol
  895. else
  896. printf "NULL"
  897. end
  898. printf "\n"
  899. end
  900. define starpu-print-registered-models
  901. set $node = registered_models
  902. while $node
  903. starpu-print-model $node->model
  904. set $node = $node->next
  905. end
  906. end
  907. define starpu-sched-data
  908. print _starpu_config.sched_ctxs[$arg0]->policy_data
  909. end
  910. define starpu-print-spaces
  911. set $j = 0
  912. while $j < $arg0
  913. printf " "
  914. set $j = $j + 1
  915. end
  916. end
  917. define starpu-sched-print-component
  918. set $c = (struct starpu_sched_component *) $arg1
  919. starpu-print-spaces $arg0
  920. 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
  921. if $c->push_task == fifo_push_task
  922. set $f = &((struct _starpu_fifo_data *) $c->data)->fifo
  923. starpu-print-spaces $arg0
  924. 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
  925. end
  926. if $c->push_task == prio_push_task
  927. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  928. starpu-print-spaces $arg0
  929. 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
  930. end
  931. if $c->push_task == simple_worker_push_task
  932. set $d = (struct _starpu_worker_component_data *) $c->data
  933. set $l = $d->list
  934. starpu-print-spaces $arg0
  935. 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
  936. end
  937. end
  938. define starpu-sched-print-recur-component
  939. starpu-sched-print-component $arg0 $arg1
  940. set $i[$arg0] = 0
  941. while $i[$arg0] < $arg1->nchildren
  942. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  943. set $i[$arg0] = $i[$arg0] + 1
  944. end
  945. end
  946. define starpu-sched-print-modular
  947. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  948. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  949. starpu-sched-print-recur-component 0 $t->root
  950. end
  951. define starpu-mpi-print-request
  952. set $request = (struct _starpu_mpi_req *)$arg0
  953. printf "Request (struct _starpu_mpi_req *) %p data %p tag %ld to MPI node %d type ", $request, $request->data_handle, $request->data_handle && $request->data_handle->mpi_data ? ((struct _starpu_mpi_data *) ($request->data_handle->mpi_data))->node_tag.data_tag : -1, $request->node_tag.node.rank,
  954. if $request->request_type == SEND_REQ
  955. printf "SEND_REQ"
  956. end
  957. if $request->request_type == RECV_REQ
  958. printf "RECV_REQ"
  959. end
  960. if $request->request_type == WAIT_REQ
  961. printf "WAIT_REQ"
  962. end
  963. if $request->request_type == TEST_REQ
  964. printf "TEST_REQ"
  965. end
  966. if $request->request_type == BARRIER_REQ
  967. printf "BARRIER_REQ"
  968. end
  969. if $request->request_type == PROBE_REQ
  970. printf "PROBE_REQ"
  971. end
  972. if $request->request_type == UNKNOWN_REQ
  973. printf "UNKNOWN_REQ"
  974. end
  975. printf " submitted %d completed %d posted %d detached %d\n", $request->submitted, $request->completed, $request->posted, $request->detached
  976. end
  977. define starpu-mpi-print-ready-recv-requests
  978. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  979. if $list
  980. set $request = $list.list._head
  981. while $request
  982. starpu-mpi-print-request $request
  983. set $request = $request->_next
  984. end
  985. else
  986. printf "No ready recv requests\n"
  987. end
  988. end
  989. define starpu-mpi-print-requests-list
  990. set $list = $arg0
  991. set $request = $list._head
  992. while $request
  993. starpu-mpi-print-request $request
  994. set $request = $request->_next
  995. end
  996. end
  997. define starpu-mpi-print-requests-tree
  998. if $arg0
  999. starpu-mpi-print-requests-tree $arg0->children[0]
  1000. set $stage = (struct _starpu_mpi_req_prio_list_stage *) $arg0
  1001. starpu-mpi-print-requests-list (&($stage->list))
  1002. starpu-mpi-print-requests-tree $arg0->children[1]
  1003. end
  1004. end
  1005. define starpu-mpi-print-ready-send-requests
  1006. set $prio_list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  1007. if _starpu_debug
  1008. if $prio_list
  1009. starpu-mpi-print-requests-list $prio_list.list
  1010. else
  1011. printf "No ready send requests\n"
  1012. end
  1013. else
  1014. if $prio_list.empty == 0
  1015. starpu-mpi-print-requests-tree $prio_list.tree.root
  1016. else
  1017. printf "No ready send requests\n"
  1018. end
  1019. end
  1020. end
  1021. define starpu-mpi-print-detached-requests
  1022. set $list = (struct _starpu_mpi_req_list) detached_requests
  1023. if $list
  1024. set $request = $list._head
  1025. while $request
  1026. starpu-mpi-print-request $request
  1027. set $request = $request->_next
  1028. end
  1029. else
  1030. printf "No detached requests\n"
  1031. end
  1032. end
  1033. define starpu-mpi-print-early-data
  1034. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  1035. if $hash
  1036. while $hash
  1037. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1038. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  1039. if $list
  1040. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  1041. while $data
  1042. starpu-mpi-print-request $data->req
  1043. set $data = $data->_next
  1044. end
  1045. end
  1046. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  1047. end
  1048. else
  1049. printf "No early data\n"
  1050. end
  1051. end
  1052. define starpu-mpi-print-early-requests
  1053. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  1054. if $hash
  1055. while $hash
  1056. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1057. set $list = (struct _starpu_mpi_req_list*) $hash->list
  1058. if $list
  1059. set $request = $list->_head
  1060. while $request
  1061. starpu-mpi-print-request $request
  1062. set $request = $request->_next
  1063. end
  1064. end
  1065. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  1066. end
  1067. else
  1068. printf "No early request\n"
  1069. end
  1070. end
  1071. define starpu-mpi-print-sync-data
  1072. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  1073. if $hash
  1074. while $hash
  1075. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1076. set $list = (struct _starpu_mpi_req_list *) $hash->list
  1077. if $list
  1078. set $request = $list->_head
  1079. while $request
  1080. starpu-mpi-print-request $request
  1081. set $request = $request->_next
  1082. end
  1083. end
  1084. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  1085. end
  1086. else
  1087. printf "No sync data\n"
  1088. end
  1089. end
  1090. document starpu
  1091. List of StarPU-specific gdb functions:
  1092. starpu-workers prints a list of the StarPU workers
  1093. starpu-tasks-on-workers prints a list of the tasks queued on workers
  1094. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  1095. starpu-print-job prints a StarPU job
  1096. starpu-print-task prints a StarPU task
  1097. starpu-print-all-tasks prints all StarPU tasks
  1098. starpu-print-task-and-successor prints a StarPU task and its successors
  1099. starpu-print-data prints a StarPU data handle
  1100. starpu-print-datas prints all StarPU data handles
  1101. starpu-print-datas-summary prints a summary of data handles
  1102. starpu-print-replicate prints a StarPU data replicate
  1103. starpu-print-request prints a StarPU data request
  1104. starpu-print-prequests prints all pending StarPU data requests
  1105. starpu-print-requests prints all queued StarPU data requests
  1106. starpu-print-frequests prints all queued StarPU prefetch data requests
  1107. starpu-print-irequests prints all queued StarPU idle data requests
  1108. starpu-tasks prints a summary of the tasks flowing in StarPU
  1109. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  1110. starpu-tags prints a list of the tags known to StarPU
  1111. starpu-print-tag prints a given tag
  1112. starpu-memusage prints the memory node usage
  1113. starpu-print-archs prints all known arch combinations
  1114. starpu-print-arch prints a given arch combination
  1115. starpu-print-registered-models prints all registered performance models
  1116. starpu-print-model prints a given performance model
  1117. starpu-sched-data prints the data of the given scheduler
  1118. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  1119. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  1120. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  1121. starpu-mpi-print-detached-requests prints all MPI detached requests
  1122. starpu-mpi-print-early-data prints all MPI early received data
  1123. starpu-mpi-print-early-requests prints all MPI early requests
  1124. starpu-mpi-print-sync-data prints all MPI sync data
  1125. end