gdbinit 34 KB

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