gdbinit 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  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 "Initialization submitted %d\n", $data->initialized
  378. printf "Current mode "
  379. starpu-print-mode $data->current_mode
  380. printf "\n"
  381. if $data->mpi_data
  382. printf "TAG %ld\n",((struct _starpu_mpi_data *) ($data->mpi_data))->node_tag.data_tag
  383. end
  384. if $data->current_mode & (4|8)
  385. set $n = 0
  386. while $n < _starpu_config.topology.nworkers
  387. set $replicate = $data->per_worker[$n]
  388. printf "Worker %2d %10s:", $n, _starpu_config->workers[$n]->name
  389. if $replicate.state == 0
  390. printf " OWNER"
  391. end
  392. if $replicate.state == 1
  393. printf " SHARED"
  394. end
  395. if $replicate.state == 2
  396. printf " INVALID"
  397. end
  398. if $replicate.initialized
  399. printf " initialized"
  400. end
  401. printf "\n"
  402. set $n = $n + 1
  403. end
  404. else
  405. set $n = 0
  406. while $n < _starpu_descr.nnodes
  407. set $replicate = &$data->per_node[$n]
  408. printf "Node %2d (%2d):", $n, $replicate->refcnt
  409. if $replicate.state == 0
  410. printf " OWNER"
  411. end
  412. if $replicate.state == 1
  413. printf " SHARED"
  414. end
  415. if $replicate.state == 2
  416. printf " INVALID"
  417. end
  418. if $replicate.initialized
  419. printf " initialized"
  420. end
  421. printf "\n"
  422. set $m = 0
  423. while $m < _starpu_descr.nnodes
  424. if $replicate->request[$m]
  425. printf " request %p from %d\n", $replicate->request[$m], $m
  426. end
  427. set $m = $m + 1
  428. end
  429. set $n = $n + 1
  430. end
  431. set $r = $data->write_invalidation_req
  432. if $r
  433. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  434. end
  435. end
  436. printf "Post sync tasks\n"
  437. set $tasklist = $data->post_sync_tasks
  438. while $tasklist != 0x0
  439. starpu-print-task $tasklist->task
  440. set $tasklist = $tasklist->next
  441. end
  442. if _starpu_debug
  443. printf "Requester tasks\n"
  444. set $requesterlist = $data->req_list.list._head
  445. while $requesterlist != 0x0
  446. printf "mode: "
  447. starpu-print-mode $requesterlist->mode
  448. printf "\n"
  449. starpu-print-job $requesterlist->j
  450. set $requesterlist = $requesterlist->_next
  451. end
  452. printf "Arbitered requester tasks\n"
  453. set $requesterlist = $data->arbitered_req_list.list._head
  454. while $requesterlist != 0x0
  455. printf "mode: "
  456. starpu-print-mode $requesterlist->mode
  457. printf "\n"
  458. starpu-print-job $requesterlist->j
  459. set $requesterlist = $requesterlist->_next
  460. end
  461. else
  462. printf "Printing requester tasks not supported yet without --enable-debug, sorry!\n"
  463. end
  464. if ($data->nchildren)
  465. printf "%d children\n", $data->nchildren
  466. end
  467. end
  468. define starpu-print-datas
  469. set $entry = registered_handles
  470. while $entry
  471. starpu-print-data $entry->handle
  472. printf "\n"
  473. set $entry = (struct handle_entry *) $entry.hh.next
  474. end
  475. end
  476. define starpu-print-datas-summary
  477. set language c
  478. set $entry = registered_handles
  479. set $data_n = 0
  480. set $pw_data_n = 0
  481. set $data_n_allocated = 0
  482. set $replicate_n_owners = 0
  483. set $replicate_n_shared = 0
  484. set $replicate_n_invalid = 0
  485. set $replicate_n_initialized = 0
  486. set $replicate_n_allocated = 0
  487. set $pw_replicate_n_owners = 0
  488. set $pw_replicate_n_shared = 0
  489. set $pw_replicate_n_invalid = 0
  490. set $pw_replicate_n_initialized = 0
  491. set $pw_replicate_n_allocated = 0
  492. while $entry
  493. set $data = (starpu_data_handle_t) $entry->handle
  494. if $data->current_mode & (4|8)
  495. set $pw_data_n = $pw_data_n + 1
  496. set $n = 0
  497. while $n < _starpu_config.topology.nworkers
  498. set $replicate = $data->per_worker[$n]
  499. if $replicate.state == 0
  500. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  501. end
  502. if $replicate.state == 1
  503. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  504. end
  505. if $replicate.state == 2
  506. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  507. end
  508. if $replicate.initialized
  509. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  510. end
  511. if $replicate.allocated
  512. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  513. end
  514. set $n = $n + 1
  515. end
  516. else
  517. set $data_n = $data_n + 1
  518. set $n = 0
  519. while $n < _starpu_descr.nnodes
  520. set $replicate = &$data->per_node[$n]
  521. if $replicate.state == 0
  522. set $replicate_n_owners = $replicate_n_owners + 1
  523. end
  524. if $replicate.state == 1
  525. set $replicate_n_shared = $replicate_n_shared + 1
  526. end
  527. if $replicate.state == 2
  528. set $replicate_n_invalid = $replicate_n_invalid + 1
  529. end
  530. if $replicate.initialized
  531. set $replicate_n_initialized = $replicate_n_initialized + 1
  532. end
  533. if $replicate.allocated
  534. set $replicate_n_allocated = $replicate_n_allocated + 1
  535. set $data_allocated = 1
  536. end
  537. set $n = $n + 1
  538. end
  539. if $data_allocated
  540. set $data_n_allocated = $data_n_allocated + 1
  541. end
  542. end
  543. set $entry = (struct handle_entry *) $entry.hh.next
  544. end
  545. printf "Number of handles: %d\n", $data_n
  546. printf "Number of allocated handles: %d\n", $data_n_allocated
  547. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  548. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  549. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  550. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  551. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  552. printf "Number of per-worker handles: %d\n", $pw_data_n
  553. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  554. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  555. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  556. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  557. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  558. end
  559. define starpu-print-replicate
  560. set $repl = (struct _starpu_data_replicate*) $arg0
  561. printf "Handle %p\n", $repl->handle
  562. printf "Interface %p\n", $repl->data_interface
  563. printf "Refcnt %u\n", $repl->refcnt
  564. printf "Node %u\n", $repl->memory_node
  565. if $repl->state == 0
  566. printf "Owner\n"
  567. end
  568. if $repl->state == 1
  569. printf "Shared\n"
  570. end
  571. if $repl->state == 2
  572. printf "Invalid\n"
  573. end
  574. if $repl->relaxed_coherency
  575. printf " relaxed_coherency"
  576. end
  577. if $repl->initialized
  578. printf " initialized"
  579. end
  580. if $repl->allocated
  581. printf " allocated"
  582. end
  583. if $repl->automatically_allocated
  584. printf " automatically allocated"
  585. end
  586. printf "\n"
  587. printf "MC %p\n", $repl->mc
  588. end
  589. define starpu-print-request
  590. set $r = (struct _starpu_data_request *)$arg0
  591. printf "Request %p\n", $r
  592. printf "Origin %s\n", $r->origin
  593. printf "Refcnt %d\n", $r->refcnt
  594. printf "Handle %p\n", $r->handle
  595. printf "src_replicate %p", $r->src_replicate
  596. if $r->src_replicate
  597. printf " (%d)", $r->src_replicate->memory_node
  598. end
  599. printf "\n"
  600. printf "dst_replicate %p", $r->dst_replicate
  601. if $r->dst_replicate
  602. printf " (%d)", $r->dst_replicate->memory_node
  603. end
  604. printf "\n"
  605. printf "handling_node %d\n", $r->handling_node
  606. if ($r->mode & 1)
  607. printf "R"
  608. end
  609. if ($r->mode & 2)
  610. printf "W"
  611. end
  612. if ($r->mode & 4)
  613. printf "S"
  614. end
  615. if ($r->mode & 8)
  616. printf "X"
  617. end
  618. printf "\n"
  619. printf "completed: %d\n", $r->completed
  620. printf "prefetch: %d\n", $r->prefetch
  621. printf "retval: %d\n", $r->retval
  622. printf "ndeps: %d\n", $r->ndeps
  623. printf "next_req_count: %d\n", $r->next_req_count
  624. set $c = 0
  625. while $c < $r->next_req_count
  626. printf " %p\n", $r->next_req[$c]
  627. set $c = $c + 1
  628. end
  629. printf "comid: %u\n", $r->com_id
  630. set $c = $r->callbacks
  631. while $c != 0
  632. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  633. set $c = $c->next
  634. end
  635. end
  636. define starpu-print-requests-treelist
  637. set $list = $arg0
  638. set $request = $list->_head
  639. while $request != 0
  640. printf " Request %p: handle %p ", $request, $request->handle
  641. starpu-print-mode $request->mode
  642. printf "\n"
  643. set $request = $request->_next
  644. end
  645. end
  646. define starpu-print-requests-tree
  647. if $arg0
  648. starpu-print-requests-tree $arg0->children[0]
  649. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  650. starpu-print-requests-treelist (&($stage->list))
  651. starpu-print-requests-tree $arg0->children[1]
  652. end
  653. end
  654. define starpu-print-requests-list
  655. if _starpu_debug
  656. starpu-print-requests-treelist &$arg0.list
  657. else
  658. starpu-print-requests-tree $arg0.tree.root
  659. end
  660. end
  661. define starpu-print-requests
  662. set $node = 0
  663. while $node < _starpu_descr.nnodes
  664. printf "Node %u:\n", $node
  665. set $node2 = 0
  666. while $node2 < _starpu_descr.nnodes
  667. starpu-print-requests-list data_requests[$node][$node2][0]
  668. starpu-print-requests-list data_requests[$node][$node2][1]
  669. set $node2 = $node2 + 1
  670. end
  671. set $node = $node + 1
  672. end
  673. end
  674. define starpu-print-prequests
  675. set $node = 0
  676. while $node < _starpu_descr.nnodes
  677. printf "Node %u:\n", $node
  678. set $node2 = 0
  679. while $node2 < _starpu_descr.nnodes
  680. if data_requests_npending[$node][$node2][0]
  681. printf "%u pending requests from %u\n", data_requests_npending[$node][$node2][0], $node2
  682. end
  683. starpu-print-requests-list data_requests_pending[$node][$node2][0]
  684. if data_requests_npending[$node][$node2][1]
  685. printf "%u pending requests to %u\n", data_requests_npending[$node][$node2][1], $node2
  686. end
  687. starpu-print-requests-list data_requests_pending[$node][$node2][1]
  688. set $node2 = $node2 + 1
  689. end
  690. set $node = $node + 1
  691. end
  692. end
  693. define starpu-print-arch
  694. set $arch = (struct starpu_perfmodel_arch *)$arg0
  695. set $device = 0
  696. while $device < $arch->ndevices
  697. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  698. set $device = $device + 1
  699. end
  700. end
  701. define starpu-print-archs
  702. set $comb = 0
  703. while $comb < current_arch_comb
  704. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  705. starpu-print-arch arch_combs[$comb]
  706. set $comb = $comb + 1
  707. end
  708. end
  709. define starpu-print-frequests
  710. set $node = 0
  711. while $node < _starpu_descr.nnodes
  712. printf "Node %u:\n", $node
  713. set $node2 = 0
  714. while $node2 < _starpu_descr.nnodes
  715. starpu-print-requests-list prefetch_requests[$node][$node2][0]
  716. starpu-print-requests-list prefetch_requests[$node][$node2][1]
  717. set $node2 = $node2 + 1
  718. end
  719. set $node = $node + 1
  720. end
  721. end
  722. define starpu-print-irequests
  723. set $node = 0
  724. while $node < _starpu_descr.nnodes
  725. printf "Node %u:\n", $node
  726. set $node2 = 0
  727. while $node2 < _starpu_descr.nnodes
  728. starpu-print-requests-list idle_requests[$node][$node2][0]
  729. starpu-print-requests-list idle_requests[$node][$node2][1]
  730. set $node2 = $node2 + 1
  731. end
  732. set $node = $node + 1
  733. end
  734. end
  735. define starpu-memusage
  736. set scheduler-locking on
  737. set $node = 0
  738. while $node < _starpu_descr.nnodes
  739. printf "\n\nNode %u (%d/MiB/%dMiB):\n", $node, used_size[$node] >> 20, global_size[$node] >> 20
  740. set $total = 0
  741. set $total_b = 0
  742. set $wt = 0
  743. set $wt_b = 0
  744. set $home = 0
  745. set $home_b = 0
  746. set $ooc = 0
  747. set $ooc_b = 0
  748. set $prefetch = 0
  749. set $prefetch_b = 0
  750. set $redux = 0
  751. set $redux_b = 0
  752. set $relax = 0
  753. set $relax_b = 0
  754. set $noref = 0
  755. set $noref_b = 0
  756. set $normal = 0
  757. set $normal_b = 0
  758. set $owner = 0
  759. set $owner_b = 0
  760. set $shared = 0
  761. set $shared_b = 0
  762. set $invalid = 0
  763. set $invalid_b = 0
  764. set $nodataref = 0
  765. set $nodataref_b = 0
  766. set $nosubdataref = 0
  767. set $nosubdataref_b = 0
  768. set $reading = 0
  769. set $reading_b = 0
  770. set $writing = 0
  771. set $writing_b = 0
  772. set $overwriting = 0
  773. set $overwriting_b = 0
  774. set $mc = mc_list[$node]->_head
  775. set pagination off
  776. while $mc != 0
  777. set $handle = $mc->data
  778. set $replicate = &$handle->per_node[$node]
  779. set $size = _starpu_data_get_size($handle)
  780. set $total = $total + 1
  781. if $total % 100 == 0
  782. printf "\rinspected %d data...", $total
  783. end
  784. set $total_b = $total_b + $size
  785. if $node < sizeof($handle->wt_mask) * 8 && $handle->wt_mask & (1 << $node)
  786. set $wt = $wt + 1
  787. set $wt_b = $wt_b + $size
  788. end
  789. if $node == $handle->home_node
  790. set $home = $home + 1
  791. set $home_b = $home_b + $size
  792. end
  793. if $handle->ooc
  794. set $ooc = $ooc + 1
  795. set $ooc_b = $ooc_b + $size
  796. end
  797. if $replicate->nb_tasks_prefetch
  798. set $prefetch = $prefetch + 1
  799. set $prefetch_b = $prefetch_b + $size
  800. end
  801. if $mc->relaxed_coherency == 2
  802. set $redux = $redux + 1
  803. set $redux_b = $redux_b + $size
  804. end
  805. if $mc->relaxed_coherency == 1
  806. set $relax = $relax + 1
  807. set $relax_b = $relax_b + $size
  808. if $mc->replicate
  809. if $mc->replicate->refcnt == 0
  810. set $noref = $noref + 1
  811. set $noref_b = $noref_b + $size
  812. end
  813. end
  814. end
  815. if $mc->relaxed_coherency == 0
  816. set $normal = $normal + 1
  817. set $normal_b = $normal_b + $size
  818. if $replicate->state == STARPU_OWNER
  819. set $owner = $owner + 1
  820. set $owner_b = $owner_b + $size
  821. end
  822. if $replicate->state == STARPU_SHARED
  823. set $shared = $shared + 1
  824. set $shared_b = $shared_b + $size
  825. end
  826. if $replicate->state == STARPU_INVALID
  827. set $invalid = $invalid + 1
  828. set $invalid_b = $invalid_b + $size
  829. end
  830. if (may_free_subtree($handle,$node))
  831. set $nosubdataref = $nosubdataref + 1
  832. set $nosubdataref_b = $nosubdataref_b + $size
  833. end
  834. if $replicate->refcnt == 0
  835. set $nodataref = $nodataref + 1
  836. set $nodataref_b = $nodataref_b + $size
  837. else
  838. set $r = 0
  839. set $w = 0
  840. set $_node = 0
  841. while $_node < _starpu_descr.nnodes
  842. set $_node = $_node + 1
  843. if $_node != $node
  844. if $handle->per_node[$_node].request[$node] != 0
  845. set $r = $r + 1
  846. end
  847. if $handle->per_node[$node].request[$_node] != 0
  848. set $w = $w + 1
  849. end
  850. end
  851. end
  852. if $r != 0
  853. set $reading = $reading + 1
  854. set $reading_b = $reading_b + $size
  855. end
  856. if $w != 0
  857. set $writing = $writing + 1
  858. set $writing_b = $writing_b + $size
  859. end
  860. if $replicate->request[$node] != 0
  861. set $overwriting = $overwriting + 1
  862. set $overwriting_b = $overwriting_b + $size
  863. end
  864. end
  865. end
  866. set $mc = $mc->_next
  867. end
  868. set pagination on
  869. printf "\r \r"
  870. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  871. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  872. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  873. printf " OOC: %u, %uMiB\n", $ooc, $ooc_b / 1048576
  874. printf " prefetch: %u, %uMiB\n", $prefetch, $prefetch_b / 1048576
  875. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  876. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  877. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  878. printf " normal: %u, %uMiB\n", $normal, $normal_b / 1048576
  879. printf " owner: %u, %uMiB\n", $owner, $owner_b / 1048576
  880. printf " shared: %u, %uMiB\n", $shared, $shared_b / 1048576
  881. printf " invalid: %u, %uMiB\n", $invalid, $invalid_b / 1048576
  882. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  883. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  884. printf " reading: %u, %uMiB\n", $reading, $reading_b / 1048576
  885. printf " writing: %u, %uMiB\n", $writing, $writing_b / 1048576
  886. printf " overwriting: %u, %uMiB\n", $overwriting, $overwriting_b / 1048576
  887. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  888. set $node = $node + 1
  889. end
  890. end
  891. define starpu-print-model
  892. set $model = (struct starpu_perfmodel *)$arg0
  893. printf "Model %p type %d symbol ", $model, $model->type
  894. if $model->symbol
  895. printf "%s", $model->symbol
  896. else
  897. printf "NULL"
  898. end
  899. printf "\n"
  900. end
  901. define starpu-print-registered-models
  902. set $node = registered_models
  903. while $node
  904. starpu-print-model $node->model
  905. set $node = $node->next
  906. end
  907. end
  908. define starpu-sched-data
  909. print _starpu_config.sched_ctxs[$arg0]->policy_data
  910. end
  911. define starpu-print-spaces
  912. set $j = 0
  913. while $j < $arg0
  914. printf " "
  915. set $j = $j + 1
  916. end
  917. end
  918. define starpu-sched-print-component
  919. set $c = (struct starpu_sched_component *) $arg1
  920. starpu-print-spaces $arg0
  921. 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
  922. if $c->push_task == fifo_push_task
  923. set $f = &((struct _starpu_fifo_data *) $c->data)->fifo
  924. starpu-print-spaces $arg0
  925. 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
  926. end
  927. if $c->push_task == prio_push_task
  928. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  929. starpu-print-spaces $arg0
  930. 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
  931. end
  932. if $c->push_task == simple_worker_push_task
  933. set $d = (struct _starpu_worker_component_data *) $c->data
  934. set $l = $d->list
  935. starpu-print-spaces $arg0
  936. 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
  937. end
  938. end
  939. define starpu-sched-print-recur-component
  940. starpu-sched-print-component $arg0 $arg1
  941. set $i[$arg0] = 0
  942. while $i[$arg0] < $arg1->nchildren
  943. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  944. set $i[$arg0] = $i[$arg0] + 1
  945. end
  946. end
  947. define starpu-sched-print-modular
  948. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  949. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  950. starpu-sched-print-recur-component 0 $t->root
  951. end
  952. define starpu-mpi-print-request
  953. set $request = (struct _starpu_mpi_req *)$arg0
  954. 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,
  955. if $request->request_type == SEND_REQ
  956. printf "SEND_REQ"
  957. end
  958. if $request->request_type == RECV_REQ
  959. printf "RECV_REQ"
  960. end
  961. if $request->request_type == WAIT_REQ
  962. printf "WAIT_REQ"
  963. end
  964. if $request->request_type == TEST_REQ
  965. printf "TEST_REQ"
  966. end
  967. if $request->request_type == BARRIER_REQ
  968. printf "BARRIER_REQ"
  969. end
  970. if $request->request_type == PROBE_REQ
  971. printf "PROBE_REQ"
  972. end
  973. if $request->request_type == UNKNOWN_REQ
  974. printf "UNKNOWN_REQ"
  975. end
  976. printf " submitted %d completed %d posted %d detached %d\n", $request->submitted, $request->completed, $request->posted, $request->detached
  977. end
  978. define starpu-mpi-print-ready-recv-requests
  979. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  980. if $list
  981. set $request = $list.list._head
  982. while $request
  983. starpu-mpi-print-request $request
  984. set $request = $request->_next
  985. end
  986. else
  987. printf "No ready recv requests\n"
  988. end
  989. end
  990. define starpu-mpi-print-requests-list
  991. set $list = $arg0
  992. set $request = $list._head
  993. while $request
  994. starpu-mpi-print-request $request
  995. set $request = $request->_next
  996. end
  997. end
  998. define starpu-mpi-print-requests-tree
  999. if $arg0
  1000. starpu-mpi-print-requests-tree $arg0->children[0]
  1001. set $stage = (struct _starpu_mpi_req_prio_list_stage *) $arg0
  1002. starpu-mpi-print-requests-list (&($stage->list))
  1003. starpu-mpi-print-requests-tree $arg0->children[1]
  1004. end
  1005. end
  1006. define starpu-mpi-print-ready-send-requests
  1007. set $prio_list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  1008. if _starpu_debug
  1009. if $prio_list
  1010. starpu-mpi-print-requests-list $prio_list.list
  1011. else
  1012. printf "No ready send requests\n"
  1013. end
  1014. else
  1015. if $prio_list.empty == 0
  1016. starpu-mpi-print-requests-tree $prio_list.tree.root
  1017. else
  1018. printf "No ready send requests\n"
  1019. end
  1020. end
  1021. end
  1022. define starpu-mpi-print-detached-requests
  1023. set $list = (struct _starpu_mpi_req_list) detached_requests
  1024. if $list
  1025. set $request = $list._head
  1026. while $request
  1027. starpu-mpi-print-request $request
  1028. set $request = $request->_next
  1029. end
  1030. else
  1031. printf "No detached requests\n"
  1032. end
  1033. end
  1034. define starpu-mpi-print-early-data
  1035. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  1036. if $hash
  1037. while $hash
  1038. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1039. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  1040. if $list
  1041. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  1042. while $data
  1043. starpu-mpi-print-request $data->req
  1044. set $data = $data->_next
  1045. end
  1046. end
  1047. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  1048. end
  1049. else
  1050. printf "No early data\n"
  1051. end
  1052. end
  1053. define starpu-mpi-print-early-requests
  1054. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  1055. if $hash
  1056. while $hash
  1057. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1058. set $list = (struct _starpu_mpi_req_list*) $hash->list
  1059. if $list
  1060. set $request = $list->_head
  1061. while $request
  1062. starpu-mpi-print-request $request
  1063. set $request = $request->_next
  1064. end
  1065. end
  1066. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  1067. end
  1068. else
  1069. printf "No early request\n"
  1070. end
  1071. end
  1072. define starpu-mpi-print-sync-data
  1073. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  1074. if $hash
  1075. while $hash
  1076. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  1077. set $list = (struct _starpu_mpi_req_list *) $hash->list
  1078. if $list
  1079. set $request = $list->_head
  1080. while $request
  1081. starpu-mpi-print-request $request
  1082. set $request = $request->_next
  1083. end
  1084. end
  1085. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  1086. end
  1087. else
  1088. printf "No sync data\n"
  1089. end
  1090. end
  1091. document starpu
  1092. List of StarPU-specific gdb functions:
  1093. starpu-workers prints a list of the StarPU workers
  1094. starpu-tasks-on-workers prints a list of the tasks queued on workers
  1095. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  1096. starpu-print-job prints a StarPU job
  1097. starpu-print-task prints a StarPU task
  1098. starpu-print-all-tasks prints all StarPU tasks
  1099. starpu-print-task-and-successor prints a StarPU task and its successors
  1100. starpu-print-data prints a StarPU data handle
  1101. starpu-print-datas prints all StarPU data handles
  1102. starpu-print-datas-summary prints a summary of data handles
  1103. starpu-print-replicate prints a StarPU data replicate
  1104. starpu-print-request prints a StarPU data request
  1105. starpu-print-prequests prints all pending StarPU data requests
  1106. starpu-print-requests prints all queued StarPU data requests
  1107. starpu-print-frequests prints all queued StarPU prefetch data requests
  1108. starpu-print-irequests prints all queued StarPU idle data requests
  1109. starpu-tasks prints a summary of the tasks flowing in StarPU
  1110. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  1111. starpu-tags prints a list of the tags known to StarPU
  1112. starpu-print-tag prints a given tag
  1113. starpu-memusage prints the memory node usage
  1114. starpu-print-archs prints all known arch combinations
  1115. starpu-print-arch prints a given arch combination
  1116. starpu-print-registered-models prints all registered performance models
  1117. starpu-print-model prints a given performance model
  1118. starpu-sched-data prints the data of the given scheduler
  1119. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  1120. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  1121. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  1122. starpu-mpi-print-detached-requests prints all MPI detached requests
  1123. starpu-mpi-print-early-data prints all MPI early received data
  1124. starpu-mpi-print-early-requests prints all MPI early requests
  1125. starpu-mpi-print-sync-data prints all MPI sync data
  1126. end