gdbinit 34 KB

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