gdbinit 33 KB

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