gdbinit 35 KB

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