gdbinit 33 KB

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