gdbinit 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  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. printf "\n"
  587. printf "MC %p\n", $repl->mc
  588. end
  589. define starpu-print-request
  590. set $r = (struct _starpu_data_request *)$arg0
  591. printf "Request %p\n", $r
  592. printf "Origin %s\n", $r->origin
  593. printf "Refcnt %d\n", $r->refcnt
  594. printf "Handle %p\n", $r->handle
  595. printf "src_replicate %p", $r->src_replicate
  596. if $r->src_replicate
  597. printf " (%d)", $r->src_replicate->memory_node
  598. end
  599. printf "\n"
  600. printf "dst_replicate %p", $r->dst_replicate
  601. if $r->dst_replicate
  602. printf " (%d)", $r->dst_replicate->memory_node
  603. end
  604. printf "\n"
  605. printf "handling_node %d\n", $r->handling_node
  606. if ($r->mode & 1)
  607. printf "R"
  608. end
  609. if ($r->mode & 2)
  610. printf "W"
  611. end
  612. if ($r->mode & 4)
  613. printf "S"
  614. end
  615. if ($r->mode & 8)
  616. printf "X"
  617. end
  618. printf "\n"
  619. printf "completed: %d\n", $r->completed
  620. printf "prefetch: %d\n", $r->prefetch
  621. printf "retval: %d\n", $r->retval
  622. printf "ndeps: %d\n", $r->ndeps
  623. printf "next_req_count: %d\n", $r->next_req_count
  624. set $c = 0
  625. while $c < $r->next_req_count
  626. printf " %p\n", $r->next_req[$c]
  627. set $c = $c + 1
  628. end
  629. printf "comid: %u\n", $r->com_id
  630. set $c = $r->callbacks
  631. while $c != 0
  632. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  633. set $c = $c->next
  634. end
  635. end
  636. define starpu-print-requests-treelist
  637. set $list = $arg0
  638. set $request = $list->_head
  639. while $request != 0
  640. printf " Request %p: handle %p ", $request, $request->handle
  641. starpu-print-mode $request->mode
  642. printf "\n"
  643. set $request = $request->_next
  644. end
  645. end
  646. define starpu-print-requests-tree
  647. if $arg0
  648. starpu-print-requests-tree $arg0->children[0]
  649. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  650. starpu-print-requests-treelist (&($stage->list))
  651. starpu-print-requests-tree $arg0->children[1]
  652. end
  653. end
  654. define starpu-print-requests-list
  655. if _starpu_debug
  656. starpu-print-requests-treelist &$arg0.list
  657. else
  658. starpu-print-requests-tree $arg0.tree.root
  659. end
  660. end
  661. define starpu-print-requests
  662. set $node = 0
  663. while $node < _starpu_descr.nnodes
  664. printf "Node %u:\n", $node
  665. set $node2 = 0
  666. while $node2 < _starpu_descr.nnodes
  667. starpu-print-requests-list data_requests[$node][$node2][0]
  668. starpu-print-requests-list data_requests[$node][$node2][1]
  669. set $node2 = $node2 + 1
  670. end
  671. set $node = $node + 1
  672. end
  673. end
  674. define starpu-print-prequests
  675. set $node = 0
  676. while $node < _starpu_descr.nnodes
  677. printf "Node %u:\n", $node
  678. set $node2 = 0
  679. while $node2 < _starpu_descr.nnodes
  680. printf "%u pending requests from %u\n", data_requests_npending[$node][$node2][0], $node2
  681. starpu-print-requests-list data_requests_pending[$node][$node2][0]
  682. printf "%u pending requests to %u\n", data_requests_npending[$node][$node2][1], $node2
  683. starpu-print-requests-list data_requests_pending[$node][$node2][1]
  684. set $node2 = $node2 + 1
  685. end
  686. set $node = $node + 1
  687. end
  688. end
  689. define starpu-print-arch
  690. set $arch = (struct starpu_perfmodel_arch *)$arg0
  691. set $device = 0
  692. while $device < $arch->ndevices
  693. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  694. set $device = $device + 1
  695. end
  696. end
  697. define starpu-print-archs
  698. set $comb = 0
  699. while $comb < current_arch_comb
  700. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  701. starpu-print-arch arch_combs[$comb]
  702. set $comb = $comb + 1
  703. end
  704. end
  705. define starpu-print-frequests
  706. set $node = 0
  707. while $node < _starpu_descr.nnodes
  708. printf "Node %u:\n", $node
  709. set $node2 = 0
  710. while $node2 < _starpu_descr.nnodes
  711. starpu-print-requests-list prefetch_requests[$node][$node2][0]
  712. starpu-print-requests-list prefetch_requests[$node][$node2][1]
  713. set $node2 = $node2 + 1
  714. end
  715. set $node = $node + 1
  716. end
  717. end
  718. define starpu-print-irequests
  719. set $node = 0
  720. while $node < _starpu_descr.nnodes
  721. printf "Node %u:\n", $node
  722. set $node2 = 0
  723. while $node2 < _starpu_descr.nnodes
  724. starpu-print-requests-list idle_requests[$node][$node2][0]
  725. starpu-print-requests-list idle_requests[$node][$node2][1]
  726. set $node2 = $node2 + 1
  727. end
  728. set $node = $node + 1
  729. end
  730. end
  731. define starpu-memusage
  732. set scheduler-locking on
  733. set $node = 0
  734. while $node < _starpu_descr.nnodes
  735. printf "\n\nNode %u (%dMiB):\n", $node, global_size[$node] >> 20
  736. set $total = 0
  737. set $total_b = 0
  738. set $wt = 0
  739. set $wt_b = 0
  740. set $home = 0
  741. set $home_b = 0
  742. set $ooc = 0
  743. set $ooc_b = 0
  744. set $prefetch = 0
  745. set $prefetch_b = 0
  746. set $redux = 0
  747. set $redux_b = 0
  748. set $relax = 0
  749. set $relax_b = 0
  750. set $noref = 0
  751. set $noref_b = 0
  752. set $normal = 0
  753. set $normal_b = 0
  754. set $owner = 0
  755. set $owner_b = 0
  756. set $shared = 0
  757. set $shared_b = 0
  758. set $invalid = 0
  759. set $invalid_b = 0
  760. set $nodataref = 0
  761. set $nodataref_b = 0
  762. set $nosubdataref = 0
  763. set $nosubdataref_b = 0
  764. set $reading = 0
  765. set $reading_b = 0
  766. set $writing = 0
  767. set $writing_b = 0
  768. set $overwriting = 0
  769. set $overwriting_b = 0
  770. set $mc = mc_list[$node]->_head
  771. set pagination off
  772. while $mc != 0
  773. set $handle = $mc->data
  774. set $replicate = &$handle->per_node[$node]
  775. set $size = _starpu_data_get_size($handle)
  776. set $total = $total + 1
  777. if $total % 100 == 0
  778. printf "\rinspected %d data...", $total
  779. end
  780. set $total_b = $total_b + $size
  781. if $node < sizeof($handle->wt_mask) * 8 && $handle->wt_mask & (1 << $node)
  782. set $wt = $wt + 1
  783. set $wt_b = $wt_b + $size
  784. end
  785. if $node == $handle->home_node
  786. set $home = $home + 1
  787. set $home_b = $home_b + $size
  788. end
  789. if $handle->ooc
  790. set $ooc = $ooc + 1
  791. set $ooc_b = $ooc_b + $size
  792. end
  793. if $replicate->nb_tasks_prefetch
  794. set $prefetch = $prefetch + 1
  795. set $prefetch_b = $prefetch_b + $size
  796. end
  797. if $mc->relaxed_coherency == 2
  798. set $redux = $redux + 1
  799. set $redux_b = $redux_b + $size
  800. end
  801. if $mc->relaxed_coherency == 1
  802. set $relax = $relax + 1
  803. set $relax_b = $relax_b + $size
  804. if $mc->replicate
  805. if $mc->replicate->refcnt == 0
  806. set $noref = $noref + 1
  807. set $noref_b = $noref_b + $size
  808. end
  809. end
  810. end
  811. if $mc->relaxed_coherency == 0
  812. set $normal = $normal + 1
  813. set $normal_b = $normal_b + $size
  814. if $replicate->state == STARPU_OWNER
  815. set $owner = $owner + 1
  816. set $owner_b = $owner_b + $size
  817. end
  818. if $replicate->state == STARPU_SHARED
  819. set $shared = $shared + 1
  820. set $shared_b = $shared_b + $size
  821. end
  822. if $replicate->state == STARPU_INVALID
  823. set $invalid = $invalid + 1
  824. set $invalid_b = $invalid_b + $size
  825. end
  826. if (may_free_subtree($handle,$node))
  827. set $nosubdataref = $nosubdataref + 1
  828. set $nosubdataref_b = $nosubdataref_b + $size
  829. end
  830. if $replicate->refcnt == 0
  831. set $nodataref = $nodataref + 1
  832. set $nodataref_b = $nodataref_b + $size
  833. else
  834. set $r = 0
  835. set $w = 0
  836. set $_node = 0
  837. while $_node < _starpu_descr.nnodes
  838. set $_node = $_node + 1
  839. if $_node != $node
  840. if $handle->per_node[$_node].request[$node] != 0
  841. set $r = $r + 1
  842. end
  843. if $handle->per_node[$node].request[$_node] != 0
  844. set $w = $w + 1
  845. end
  846. end
  847. end
  848. if $r != 0
  849. set $reading = $reading + 1
  850. set $reading_b = $reading_b + $size
  851. end
  852. if $w != 0
  853. set $writing = $writing + 1
  854. set $writing_b = $writing_b + $size
  855. end
  856. if $replicate->request[$node] != 0
  857. set $overwriting = $overwriting + 1
  858. set $overwriting_b = $overwriting_b + $size
  859. end
  860. end
  861. end
  862. set $mc = $mc->_next
  863. end
  864. set pagination on
  865. printf "\r \r"
  866. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  867. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  868. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  869. printf " OOC: %u, %uMiB\n", $ooc, $ooc_b / 1048576
  870. printf " prefetch: %u, %uMiB\n", $prefetch, $prefetch_b / 1048576
  871. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  872. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  873. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  874. printf " normal: %u, %uMiB\n", $normal, $normal_b / 1048576
  875. printf " owner: %u, %uMiB\n", $owner, $owner_b / 1048576
  876. printf " shared: %u, %uMiB\n", $shared, $shared_b / 1048576
  877. printf " invalid: %u, %uMiB\n", $invalid, $invalid_b / 1048576
  878. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  879. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  880. printf " reading: %u, %uMiB\n", $reading, $reading_b / 1048576
  881. printf " writing: %u, %uMiB\n", $writing, $writing_b / 1048576
  882. printf " overwriting: %u, %uMiB\n", $overwriting, $overwriting_b / 1048576
  883. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  884. set $node = $node + 1
  885. end
  886. end
  887. define starpu-print-model
  888. set $model = (struct starpu_perfmodel *)$arg0
  889. printf "Model %p type %d symbol ", $model, $model->type
  890. if $model->symbol
  891. printf "%s", $model->symbol
  892. else
  893. printf "NULL"
  894. end
  895. printf "\n"
  896. end
  897. define starpu-print-registered-models
  898. set $node = registered_models
  899. while $node
  900. starpu-print-model $node->model
  901. set $node = $node->next
  902. end
  903. end
  904. define starpu-sched-data
  905. print _starpu_config.sched_ctxs[$arg0]->policy_data
  906. end
  907. define starpu-print-spaces
  908. set $j = 0
  909. while $j < $arg0
  910. printf " "
  911. set $j = $j + 1
  912. end
  913. end
  914. define starpu-sched-print-component
  915. set $c = (struct starpu_sched_component *) $arg1
  916. starpu-print-spaces $arg0
  917. 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
  918. if $c->push_task == fifo_push_task
  919. set $f = &((struct _starpu_fifo_data *) $c->data)->fifo
  920. starpu-print-spaces $arg0
  921. 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
  922. end
  923. if $c->push_task == prio_push_task
  924. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  925. starpu-print-spaces $arg0
  926. 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
  927. end
  928. if $c->push_task == simple_worker_push_task
  929. set $d = (struct _starpu_worker_component_data *) $c->data
  930. set $l = $d->list
  931. starpu-print-spaces $arg0
  932. 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
  933. end
  934. end
  935. define starpu-sched-print-recur-component
  936. starpu-sched-print-component $arg0 $arg1
  937. set $i[$arg0] = 0
  938. while $i[$arg0] < $arg1->nchildren
  939. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  940. set $i[$arg0] = $i[$arg0] + 1
  941. end
  942. end
  943. define starpu-sched-print-modular
  944. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  945. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  946. starpu-sched-print-recur-component 0 $t->root
  947. end
  948. define starpu-mpi-print-request
  949. set $request = (struct _starpu_mpi_req *)$arg0
  950. 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,
  951. if $request->request_type == SEND_REQ
  952. printf "SEND_REQ"
  953. end
  954. if $request->request_type == RECV_REQ
  955. printf "RECV_REQ"
  956. end
  957. if $request->request_type == WAIT_REQ
  958. printf "WAIT_REQ"
  959. end
  960. if $request->request_type == TEST_REQ
  961. printf "TEST_REQ"
  962. end
  963. if $request->request_type == BARRIER_REQ
  964. printf "BARRIER_REQ"
  965. end
  966. if $request->request_type == PROBE_REQ
  967. printf "PROBE_REQ"
  968. end
  969. if $request->request_type == UNKNOWN_REQ
  970. printf "UNKNOWN_REQ"
  971. end
  972. printf " submitted %d completed %d posted %d detached %d\n", $request->submitted, $request->completed, $request->posted, $request->detached
  973. end
  974. define starpu-mpi-print-ready-recv-requests
  975. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  976. if $list
  977. set $request = $list.list._head
  978. while $request
  979. starpu-mpi-print-request $request
  980. set $request = $request->_next
  981. end
  982. else
  983. printf "No ready recv requests\n"
  984. end
  985. end
  986. define starpu-mpi-print-requests-list
  987. set $list = $arg0
  988. set $request = $list._head
  989. while $request
  990. starpu-mpi-print-request $request
  991. set $request = $request->_next
  992. end
  993. end
  994. define starpu-mpi-print-requests-tree
  995. if $arg0
  996. starpu-mpi-print-requests-tree $arg0->children[0]
  997. set $stage = (struct _starpu_mpi_req_prio_list_stage *) $arg0
  998. starpu-mpi-print-requests-list (&($stage->list))
  999. starpu-mpi-print-requests-tree $arg0->children[1]
  1000. end
  1001. end
  1002. define starpu-mpi-print-ready-send-requests
  1003. set $prio_list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  1004. if _starpu_debug
  1005. if $prio_list
  1006. starpu-mpi-print-requests-list $prio_list.list
  1007. else
  1008. printf "No ready send requests\n"
  1009. end
  1010. else
  1011. if $prio_list.empty == 0
  1012. starpu-mpi-print-requests-tree $prio_list.tree.root
  1013. else
  1014. printf "No ready send requests\n"
  1015. end
  1016. end
  1017. end
  1018. define starpu-mpi-print-detached-requests
  1019. set $list = (struct _starpu_mpi_req_list) detached_requests
  1020. if $list
  1021. set $request = $list._head
  1022. while $request
  1023. starpu-mpi-print-request $request
  1024. set $request = $request->_next
  1025. end
  1026. else
  1027. printf "No detached requests\n"
  1028. end
  1029. end
  1030. define starpu-mpi-print-early-data
  1031. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  1032. if $hash
  1033. while $hash
  1034. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1035. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  1036. if $list
  1037. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  1038. while $data
  1039. starpu-mpi-print-request $data->req
  1040. set $data = $data->_next
  1041. end
  1042. end
  1043. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  1044. end
  1045. else
  1046. printf "No early data\n"
  1047. end
  1048. end
  1049. define starpu-mpi-print-early-requests
  1050. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  1051. if $hash
  1052. while $hash
  1053. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1054. set $list = (struct _starpu_mpi_req_list*) $hash->list
  1055. if $list
  1056. set $request = $list->_head
  1057. while $request
  1058. starpu-mpi-print-request $request
  1059. set $request = $request->_next
  1060. end
  1061. end
  1062. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  1063. end
  1064. else
  1065. printf "No early request\n"
  1066. end
  1067. end
  1068. define starpu-mpi-print-sync-data
  1069. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  1070. if $hash
  1071. while $hash
  1072. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1073. set $list = (struct _starpu_mpi_req_list *) $hash->list
  1074. if $list
  1075. set $request = $list->_head
  1076. while $request
  1077. starpu-mpi-print-request $request
  1078. set $request = $request->_next
  1079. end
  1080. end
  1081. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  1082. end
  1083. else
  1084. printf "No sync data\n"
  1085. end
  1086. end
  1087. document starpu
  1088. List of StarPU-specific gdb functions:
  1089. starpu-workers prints a list of the StarPU workers
  1090. starpu-tasks-on-workers prints a list of the tasks queued on workers
  1091. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  1092. starpu-print-job prints a StarPU job
  1093. starpu-print-task prints a StarPU task
  1094. starpu-print-all-tasks prints all StarPU tasks
  1095. starpu-print-task-and-successor prints a StarPU task and its successors
  1096. starpu-print-data prints a StarPU data handle
  1097. starpu-print-datas prints all StarPU data handles
  1098. starpu-print-datas-summary prints a summary of data handles
  1099. starpu-print-replicate prints a StarPU data replicate
  1100. starpu-print-request prints a StarPU data request
  1101. starpu-print-prequests prints all pending StarPU data requests
  1102. starpu-print-requests prints all queued StarPU data requests
  1103. starpu-print-frequests prints all queued StarPU prefetch data requests
  1104. starpu-print-irequests prints all queued StarPU idle data requests
  1105. starpu-tasks prints a summary of the tasks flowing in StarPU
  1106. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  1107. starpu-tags prints a list of the tags known to StarPU
  1108. starpu-print-tag prints a given tag
  1109. starpu-memusage prints the memory node usage
  1110. starpu-print-archs prints all known arch combinations
  1111. starpu-print-arch prints a given arch combination
  1112. starpu-print-registered-models prints all registered performance models
  1113. starpu-print-model prints a given performance model
  1114. starpu-sched-data prints the data of the given scheduler
  1115. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  1116. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  1117. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  1118. starpu-mpi-print-detached-requests prints all MPI detached requests
  1119. starpu-mpi-print-early-data prints all MPI early received data
  1120. starpu-mpi-print-early-requests prints all MPI early requests
  1121. starpu-mpi-print-sync-data prints all MPI sync data
  1122. end