gdbinit 35 KB

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