gdbinit 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2018 Université de Bordeaux
  4. # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 CNRS
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  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
  72. printf "\tcodelet name:\t\t\t<%s>\n", $task->cl->name
  73. end
  74. printf "\tcallback:\t\t\t<%p>\n", $task->callback_func
  75. printf "\tsynchronous:\t\t\t<%d>\n", $task->synchronous
  76. printf "\texecute_on_a_specific_worker:\t<%d>\n", $task->execute_on_a_specific_worker
  77. printf "\tworkerid:\t\t\t<%d>\n", $task->workerid
  78. printf "\tdetach:\t\t\t\t<%d>\n", $task->detach
  79. printf "\tdestroy:\t\t\t<%d>\n", $task->destroy
  80. printf "\tregenerate:\t\t\t<%d>\n", $task->regenerate
  81. printf "\tstatus:\t\t\t\t<%s>\n", $status
  82. printf "\tjob:\t\t\t\t<%p>\n", $job
  83. printf "\ttag_id:\t\t\t\t<%d>\n", $task->tag_id
  84. printf "\tndeps:\t\t\t\t<%u>\n", $job->job_successors->ndeps
  85. printf "\tndeps_remaining:\t\t<%u>\n", $job->job_successors->ndeps - $job->job_successors->ndeps_completed
  86. if _starpu_debug
  87. set $n = 0
  88. while $n < $job->job_successors->ndeps
  89. if ! $job->job_successors->done[$n]
  90. set $cg = $job->job_successors->deps[$n]
  91. set $m = 0
  92. while $m < $cg->ndeps
  93. if ! $cg->done[$m]
  94. set $depj = (struct _starpu_job *) $cg->deps[$m]
  95. printf "\t\ttask %p\n", $depj->task
  96. end
  97. set $m = $m + 1
  98. end
  99. end
  100. set $n = $n + 1
  101. end
  102. end
  103. printf "\tndeps_completed:\t\t<%u>\n", $job->job_successors->ndeps_completed
  104. printf "\tnsuccs:\t\t\t\t<%u>\n", $job->job_successors->nsuccs
  105. if $job
  106. starpu-print-job $job
  107. end
  108. end
  109. define starpu-print-task-and-successor
  110. set language c
  111. set $t = (struct starpu_task *) ($arg0)
  112. starpu-print-task $t
  113. set $j = (struct _starpu_job *) $t->starpu_private
  114. set $nsuccs = $j->job_successors.nsuccs
  115. set $i = 0
  116. while $i < $nsuccs
  117. set $cg = $j->job_successors.succ[$i]
  118. if ($cg->cg_type == 1)
  119. # STARPU_CG_APPS
  120. printf "waited for by application"
  121. end
  122. if ($cg->cg_type == 2)
  123. # STARPU_CG_TAG
  124. printf "will produce tag %x\n", $cg->succ.tag
  125. end
  126. if ($cg->cg_type == 4)
  127. # STARPU_CG_TASK
  128. printf "dep of task %p\n", $cg->succ.job
  129. starpu-print-task $cg->succ.job->task
  130. end
  131. set $i = $i + 1
  132. end
  133. end
  134. define starpu-tasks-on-worker
  135. set language c
  136. set $worker=_starpu_config->workers[$arg0]
  137. set $task=$worker.local_tasks.head
  138. while $task != 0x0
  139. starpu-print-task $task
  140. set $task=$task->next
  141. end
  142. end
  143. define starpu-tasks-on-workers
  144. set language c
  145. set $num=0
  146. while $num<_starpu_config->topology->nworkers
  147. printf "Worker %s\n", _starpu_config->workers[$num].name
  148. starpu-tasks-on-worker $num
  149. set $num = $num + 1
  150. end
  151. end
  152. define starpu-workers
  153. set language c
  154. set $num=0
  155. printf "[Id] Name Arch Mask Devid Bindid Workerid Isrunning Isinitialized Status\n"
  156. while $num<_starpu_config->topology->nworkers
  157. set $worker=&_starpu_config->workers[$num]
  158. if $worker->status == STATUS_INVALID
  159. set $status="INVALID"
  160. end
  161. if $worker->status == STATUS_UNKNOWN
  162. set $status="UNKNOWN"
  163. end
  164. if $worker->status == STATUS_INITIALIZING
  165. set $status="INITIALIZING"
  166. end
  167. if $worker->status == STATUS_EXECUTING
  168. set $status="EXECUTING"
  169. end
  170. if $worker->status == STATUS_CALLBACK
  171. set $status="CALLBACK"
  172. end
  173. if $worker->status == STATUS_SCHEDULING
  174. set $status="SCHEDULING"
  175. end
  176. if $worker->status == STATUS_WAITING
  177. set $status="WAITING"
  178. end
  179. if $worker->status == STATUS_SLEEPING
  180. set $status="SLEEPING"
  181. end
  182. printf "[%2d] %-40s %-4d %-4d %-5d %-6d %-8d %-9d %-13d %s\n", $num, $worker->name, $worker->arch, $worker->worker_mask, \
  183. $worker->devid, $worker->bindid, $worker->workerid, $worker->worker_is_running, $worker->worker_is_initialized, $status
  184. set $num = $num + 1
  185. end
  186. end
  187. define starpu-print-tag
  188. set language c
  189. set $tag_struct = (struct _starpu_tag *)_gettag_struct($arg0)
  190. if $tag_struct->state == STARPU_INVALID_STATE
  191. set $status="STARPU_INVALID_STATE"
  192. end
  193. if $tag_struct->state == STARPU_ASSOCIATED
  194. set $status="STARPU_ASSOCIATED"
  195. end
  196. if $tag_struct->state == STARPU_BLOCKED
  197. set $status="STARPU_BLOCKED"
  198. end
  199. if $tag_struct->state == STARPU_READY
  200. set $status="STARPU_READY"
  201. end
  202. if $tag_struct->state == STARPU_DONE
  203. set $status="STARPU_DONE"
  204. end
  205. printf "tag %d state %s\n", $arg0, $status
  206. end
  207. define starpu-tags
  208. set language c
  209. printf "tags htbl %p\n", tag_htbl
  210. set $tags = tag_htbl
  211. while $tags
  212. starpu-print-tag $tags->id
  213. set $tags = (struct _starpu_tag_table *) $tags.hh.next
  214. end
  215. end
  216. define starpu-tasks
  217. set language c
  218. set $num=0
  219. set $nsubmitted=0
  220. set $nready=0
  221. while $num<_starpu_config->topology->nsched_ctxs
  222. set $nsubmitted = $nsubmitted + _starpu_config->sched_ctxs[$num]->tasks_barrier->barrier->reached_start
  223. set $nready = $nready + _starpu_config->sched_ctxs[$num]->ready_tasks_barrier->barrier->reached_start
  224. set $num = $num + 1
  225. end
  226. printf "%d submitted tasks\n", $nsubmitted
  227. printf "%d ready tasks\n", $nready
  228. printf "Tasks being run:\n"
  229. set $n = 0
  230. while $n < _starpu_config.topology.nworkers
  231. printf "worker %d %s:\n", $n, _starpu_config.workers[$n].short_name
  232. if _starpu_config.workers[$n].pipeline_length > 0
  233. set $m = 0
  234. while $m < _starpu_config.workers[$n].ntasks
  235. 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]))]
  236. printf " task %p\n", $t
  237. set $m = $m + 1
  238. end
  239. end
  240. set $task = _starpu_config.workers[$n].current_task
  241. if ($task)
  242. printf " task %p\n", $task
  243. end
  244. set $n = $n + 1
  245. end
  246. if (tag_htbl)
  247. printf "TODO: tags\n"
  248. end
  249. print "TODO: complete\n"
  250. end
  251. define starpu-print-all-tasks
  252. set language c
  253. if ! _starpu_debug
  254. printf "you need to configure with --enable-debug to get starpu-print-all-tasks working\n"
  255. else
  256. set $l = all_jobs_list->next
  257. while $l != &all_jobs_list
  258. set $j = (struct _starpu_job*) (((unsigned long) $l) - ((unsigned long) &((struct _starpu_job *)0)->all_submitted))
  259. printf "task %p\n", $j->task
  260. starpu-print-task $j->task
  261. set $l = $l->next
  262. end
  263. end
  264. end
  265. define starpu-all-tasks
  266. set language c
  267. if ! _starpu_debug
  268. printf "you need to configure with --enable-debug to get starpu-all-tasks working\n"
  269. else
  270. set $l = all_jobs_list->next
  271. while $l != &all_jobs_list
  272. set $j = (struct _starpu_job*) (((unsigned long) $l) - ((unsigned long) &((struct _starpu_job *)0)->all_submitted))
  273. set $task = $j->task
  274. printf "task %p %s\n", $task, $task->name ? $task->name : ""
  275. set $l = $l->next
  276. end
  277. end
  278. end
  279. define starpu
  280. printf "Here I am...\n"
  281. end
  282. define starpu-print-mode
  283. if ($arg0 & 1)
  284. printf "R"
  285. end
  286. if ($arg0 & 2)
  287. printf "W"
  288. end
  289. if ($arg0 & 4)
  290. printf " SCRATCH"
  291. end
  292. if ($arg0 & 8)
  293. printf " REDUX"
  294. end
  295. end
  296. define starpu-print-data
  297. set language c
  298. set $data = (starpu_data_handle_t) $arg0
  299. printf "Data handle %p\n", $data
  300. if $data->ops->interfaceid == 0
  301. printf "Matrix\n"
  302. end
  303. if $data->ops->interfaceid == 1
  304. printf "Block\n"
  305. end
  306. if $data->ops->interfaceid == 2
  307. printf "Vector\n"
  308. end
  309. if $data->ops->interfaceid == 3
  310. printf "CSR\n"
  311. end
  312. if $data->ops->interfaceid == 4
  313. printf "BCSR\n"
  314. end
  315. if $data->ops->interfaceid == 5
  316. printf "Variable\n"
  317. end
  318. if $data->ops->interfaceid == 6
  319. printf "Void\n"
  320. end
  321. if $data->ops->interfaceid == 7
  322. printf "Multiformat\n"
  323. end
  324. if $data->ops->interfaceid == 8
  325. printf "COO\n"
  326. end
  327. if $data->ops->interfaceid > 8
  328. printf "Interface id %d\n", $data->ops->interfaceid
  329. end
  330. printf "Home node %d\n", $data->home_node
  331. printf "RWlock refs %d\n", $data->refcnt
  332. printf "Busy count %d\n", $data->busy_count
  333. printf "Current mode "
  334. starpu-print-mode $data->current_mode
  335. printf "\n"
  336. if $data->current_mode & (4|8)
  337. set $n = 0
  338. while $n < _starpu_config.topology.nworkers
  339. set $replicate = $data->per_worker[$n]
  340. printf "Worker %2d %10s:", $n, _starpu_config->workers[$n]->name
  341. if $replicate.state == 0
  342. printf " OWNER"
  343. end
  344. if $replicate.state == 1
  345. printf " SHARED"
  346. end
  347. if $replicate.state == 2
  348. printf " INVALID"
  349. end
  350. if $replicate.initialized
  351. printf " initialized"
  352. end
  353. printf "\n"
  354. set $n = $n + 1
  355. end
  356. else
  357. set $n = 0
  358. while $n < _starpu_descr.nnodes
  359. set $replicate = &$data->per_node[$n]
  360. printf "Node %2d (%2d):", $n, $replicate->refcnt
  361. if $replicate.state == 0
  362. printf " OWNER"
  363. end
  364. if $replicate.state == 1
  365. printf " SHARED"
  366. end
  367. if $replicate.state == 2
  368. printf " INVALID"
  369. end
  370. if $replicate.initialized
  371. printf " initialized"
  372. end
  373. printf "\n"
  374. set $m = 0
  375. while $m < _starpu_descr.nnodes
  376. if $replicate->request[$m]
  377. printf " request %p from %d\n", $replicate->request[$m], $m
  378. end
  379. set $m = $m + 1
  380. end
  381. set $n = $n + 1
  382. end
  383. set $r = $data->write_invalidation_req
  384. if $r
  385. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  386. end
  387. end
  388. printf "Post sync tasks\n"
  389. set $tasklist = $data->post_sync_tasks
  390. while $tasklist != 0x0
  391. starpu-print-task $tasklist->task
  392. set $tasklist = $tasklist->next
  393. end
  394. printf "Requester tasks\n"
  395. set $requesterlist = $data->req_list._head
  396. while $requesterlist != 0x0
  397. printf "mode: "
  398. starpu-print-mode $requesterlist->mode
  399. printf "\n"
  400. starpu-print-job $requesterlist->j
  401. set $requesterlist = $requesterlist->_next
  402. end
  403. printf "Arbitered requester tasks\n"
  404. set $requesterlist = $data->arbitered_req_list._head
  405. while $requesterlist != 0x0
  406. printf "mode: "
  407. starpu-print-mode $requesterlist->mode
  408. printf "\n"
  409. starpu-print-job $requesterlist->j
  410. set $requesterlist = $requesterlist->_next
  411. end
  412. if ($data->nchildren)
  413. printf "%d children\n", $data->nchildren
  414. end
  415. end
  416. define starpu-print-datas
  417. set $entry = registered_handles
  418. while $entry
  419. starpu-print-data $entry->handle
  420. printf "\n"
  421. set $entry = (struct handle_entry *) $entry.hh.next
  422. end
  423. end
  424. define starpu-print-datas-summary
  425. set language c
  426. set $entry = registered_handles
  427. set $data_n = 0
  428. set $pw_data_n = 0
  429. set $data_n_allocated = 0
  430. set $replicate_n_owners = 0
  431. set $replicate_n_shared = 0
  432. set $replicate_n_invalid = 0
  433. set $replicate_n_initialized = 0
  434. set $replicate_n_allocated = 0
  435. set $pw_replicate_n_owners = 0
  436. set $pw_replicate_n_shared = 0
  437. set $pw_replicate_n_invalid = 0
  438. set $pw_replicate_n_initialized = 0
  439. set $pw_replicate_n_allocated = 0
  440. while $entry
  441. set $data = (starpu_data_handle_t) $entry->handle
  442. if $data->current_mode & (4|8)
  443. set $pw_data_n = $pw_data_n + 1
  444. set $n = 0
  445. while $n < _starpu_config.topology.nworkers
  446. set $replicate = $data->per_worker[$n]
  447. if $replicate.state == 0
  448. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  449. end
  450. if $replicate.state == 1
  451. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  452. end
  453. if $replicate.state == 2
  454. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  455. end
  456. if $replicate.initialized
  457. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  458. end
  459. if $replicate.allocated
  460. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  461. end
  462. set $n = $n + 1
  463. end
  464. else
  465. set $data_n = $data_n + 1
  466. set $n = 0
  467. while $n < _starpu_descr.nnodes
  468. set $replicate = &$data->per_node[$n]
  469. if $replicate.state == 0
  470. set $replicate_n_owners = $replicate_n_owners + 1
  471. end
  472. if $replicate.state == 1
  473. set $replicate_n_shared = $replicate_n_shared + 1
  474. end
  475. if $replicate.state == 2
  476. set $replicate_n_invalid = $replicate_n_invalid + 1
  477. end
  478. if $replicate.initialized
  479. set $replicate_n_initialized = $replicate_n_initialized + 1
  480. end
  481. if $replicate.allocated
  482. set $replicate_n_allocated = $replicate_n_allocated + 1
  483. set $data_allocated = 1
  484. end
  485. set $n = $n + 1
  486. end
  487. if $data_allocated
  488. set $data_n_allocated = $data_n_allocated + 1
  489. end
  490. end
  491. set $entry = (struct handle_entry *) $entry.hh.next
  492. end
  493. printf "Number of handles: %d\n", $data_n
  494. printf "Number of allocated handles: %d\n", $data_n_allocated
  495. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  496. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  497. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  498. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  499. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  500. printf "Number of per-worker handles: %d\n", $pw_data_n
  501. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  502. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  503. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  504. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  505. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  506. end
  507. define starpu-print-request
  508. set $r = (struct _starpu_data_request *)$arg0
  509. printf "Request %p\n", $r
  510. printf "Origin %s\n", $r->origin
  511. printf "Refcnt %d\n", $r->refcnt
  512. printf "Handle %p\n", $r->handle
  513. printf "src_replicate %p\n", $r->src_replicate
  514. printf "dst_replicate %p\n", $r->dst_replicate
  515. printf "handling_node %d\n", $r->handling_node
  516. if ($r->mode & 1)
  517. printf "R"
  518. end
  519. if ($r->mode & 2)
  520. printf "W"
  521. end
  522. if ($r->mode & 4)
  523. printf "S"
  524. end
  525. if ($r->mode & 8)
  526. printf "X"
  527. end
  528. printf "\n"
  529. printf "completed: %d\n", $r->completed
  530. printf "prefetch: %d\n", $r->prefetch
  531. printf "retval: %d\n", $r->retval
  532. printf "ndeps: %d\n", $r->ndeps
  533. printf "next_req_count: %d\n", $r->next_req_count
  534. set $c = 0
  535. while $c < $r->next_req_count
  536. printf " %p\n", $r->next_req[$c]
  537. set $c = $c + 1
  538. end
  539. printf "comid: %u\n", $r->com_id
  540. set $c = $r->callbacks
  541. while $c != 0
  542. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  543. set $c = $c->next
  544. end
  545. end
  546. define starpu-print-requests-treelist
  547. set $list = $arg0
  548. set $request = $list->_head
  549. while $request != 0
  550. printf " Request %p: handle %p ", $request, $request->handle
  551. starpu-print-mode $request->mode
  552. printf "\n"
  553. set $request = $request->_next
  554. end
  555. end
  556. define starpu-print-requests-tree
  557. if $arg0
  558. starpu-print-requests-tree $arg0->children[0]
  559. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  560. starpu-print-requests-treelist (&($stage->list))
  561. starpu-print-requests-tree $arg0->children[1]
  562. end
  563. end
  564. define starpu-print-requests-list
  565. starpu-print-requests-tree $arg0.tree.root
  566. end
  567. define starpu-print-requests
  568. set $node = 0
  569. while $node < _starpu_descr.nnodes
  570. printf "Node %u:\n", $node
  571. starpu-print-requests-list data_requests[$node]
  572. set $node = $node + 1
  573. end
  574. end
  575. define starpu-print-prequests
  576. set $node = 0
  577. while $node < _starpu_descr.nnodes
  578. printf "Node %u:\n", $node
  579. printf "%u pending requests\n", data_requests_npending[$node]
  580. starpu-print-requests-list data_requests_pending[$node]
  581. set $node = $node + 1
  582. end
  583. end
  584. define starpu-print-arch
  585. set $arch = (struct starpu_perfmodel_arch *)$arg0
  586. set $device = 0
  587. while $device < $arch->ndevices
  588. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  589. set $device = $device + 1
  590. end
  591. end
  592. define starpu-print-archs
  593. set $comb = 0
  594. while $comb < current_arch_comb
  595. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  596. starpu-print-arch arch_combs[$comb]
  597. set $comb = $comb + 1
  598. end
  599. end
  600. define starpu-print-frequests
  601. set $node = 0
  602. while $node < _starpu_descr.nnodes
  603. printf "Node %u:\n", $node
  604. starpu-print-requests-list prefetch_requests[$node]
  605. set $node = $node + 1
  606. end
  607. end
  608. define starpu-print-irequests
  609. set $node = 0
  610. while $node < _starpu_descr.nnodes
  611. printf "Node %u:\n", $node
  612. starpu-print-requests-list idle_requests[$node]
  613. set $node = $node + 1
  614. end
  615. end
  616. define starpu-memusage
  617. set scheduler-locking on
  618. set $node = 0
  619. while $node < _starpu_descr.nnodes
  620. printf "\n\nNode %u:\n", $node
  621. set $total = 0
  622. set $total_b = 0
  623. set $wt = 0
  624. set $wt_b = 0
  625. set $home = 0
  626. set $home_b = 0
  627. set $redux = 0
  628. set $redux_b = 0
  629. set $relax = 0
  630. set $relax_b = 0
  631. set $noref = 0
  632. set $noref_b = 0
  633. set $nodataref = 0
  634. set $nodataref_b = 0
  635. set $nosubdataref = 0
  636. set $nosubdataref_b = 0
  637. set $mc = mc_list[$node]->_head
  638. while $mc != 0
  639. set $handle = $mc->data
  640. set $size = _starpu_data_get_size($handle)
  641. set $total = $total + 1
  642. set $total_b = $total_b + $size
  643. if $handle->wt_mask & (1 << $node)
  644. set $wt = $wt + 1
  645. set $wt_b = $wt_b + $size
  646. end
  647. if $node == $handle->home_node
  648. set $home = $home + 1
  649. set $home_b = $home_b + $size
  650. end
  651. if $mc->relaxed_coherency == 2
  652. set $redux = $redux + 1
  653. set $redux_b = $redux_b + $size
  654. end
  655. if $mc->relaxed_coherency == 1
  656. set $relax = $relax + 1
  657. set $relax_b = $relax_b + $size
  658. if $mc->replicate
  659. if $mc->replicate->refcnt == 0
  660. set $noref = $noref + 1
  661. set $noref_b = $noref_b + $size
  662. end
  663. end
  664. end
  665. if $mc->relaxed_coherency == 0
  666. if (may_free_subtree($handle,$node))
  667. set $nosubdataref = $nosubdataref + 1
  668. set $nosubdataref_b = $nosubdataref_b + $size
  669. end
  670. if $handle->per_node[$node].refcnt == 0
  671. set $nodataref = $nodataref + 1
  672. set $nodataref_b = $nodataref_b + $size
  673. end
  674. end
  675. set $mc = $mc->_next
  676. end
  677. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  678. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  679. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  680. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  681. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  682. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  683. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  684. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  685. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  686. set $node = $node + 1
  687. end
  688. end
  689. define starpu-print-model
  690. set $model = (struct starpu_perfmodel *)$arg0
  691. printf "Model %p type %d symbol ", $model, $model->type
  692. if $model->symbol
  693. printf "%s", $model->symbol
  694. else
  695. printf "NULL"
  696. end
  697. printf "\n"
  698. end
  699. define starpu-print-registered-models
  700. set $node = registered_models
  701. while $node
  702. starpu-print-model $node->model
  703. set $node = $node->next
  704. end
  705. end
  706. define starpu-sched-data
  707. print _starpu_config.sched_ctxs[$arg0]->policy_data
  708. end
  709. define starpu-print-spaces
  710. set $j = 0
  711. while $j < $arg0
  712. printf " "
  713. set $j = $j + 1
  714. end
  715. end
  716. define starpu-sched-print-component
  717. set $c = $arg1
  718. starpu-print-spaces $arg0
  719. 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
  720. if $c->push_task == fifo_push_task
  721. set $f = ((struct _starpu_fifo_data *) $c->data)->fifo
  722. starpu-print-spaces $arg0
  723. 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
  724. end
  725. if $c->push_task == prio_push_task
  726. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  727. starpu-print-spaces $arg0
  728. 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
  729. end
  730. if $c->push_task == simple_worker_push_task
  731. set $d = (struct _starpu_worker_component_data *) $c->data
  732. set $l = $d->list
  733. starpu-print-spaces $arg0
  734. 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
  735. end
  736. end
  737. define starpu-sched-print-recur-component
  738. starpu-sched-print-component $arg0 $arg1
  739. set $i[$arg0] = 0
  740. while $i[$arg0] < $arg1->nchildren
  741. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  742. set $i[$arg0] = $i[$arg0] + 1
  743. end
  744. end
  745. define starpu-sched-print-modular
  746. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  747. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  748. starpu-sched-print-recur-component 0 $t->root
  749. end
  750. define starpu-mpi-print-request
  751. set $request = (struct _starpu_mpi_req *)$arg0
  752. set $request_type = "unknown_type"
  753. if $request->request_type == SEND_REQ
  754. set $request_type = "SEND_REQ"
  755. end
  756. if $request->request_type == RECV_REQ
  757. set $request_type = "RECV_REQ"
  758. end
  759. if $request->request_type == WAIT_REQ
  760. set $request_type = "WAIT_REQ"
  761. end
  762. if $request->request_type == TEST_REQ
  763. set $request_type = "TEST_REQ"
  764. end
  765. if $request->request_type == BARRIER_REQ
  766. set $request_type = "BARRIER_REQ"
  767. end
  768. if $request->request_type == PROBE_REQ
  769. set $request_type = "PROBE_REQ"
  770. end
  771. if $request->request_type == UNKNOWN_REQ
  772. set $request_type = "UNKNOWN_REQ"
  773. end
  774. 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
  775. end
  776. define starpu-mpi-print-ready-recv-requests
  777. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  778. if $list
  779. set $request = $list.list._head
  780. while $request
  781. starpu-mpi-print-request $request
  782. set $request = $request->_next
  783. end
  784. else
  785. printf "No ready recv requests\n"
  786. end
  787. end
  788. define starpu-mpi-print-ready-send-requests
  789. set $list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  790. if $list
  791. set $request = $list.list._head
  792. while $request
  793. starpu-mpi-print-request $request
  794. set $request = $request->_next
  795. end
  796. else
  797. printf "No ready send requests\n"
  798. end
  799. end
  800. define starpu-mpi-print-detached-requests
  801. set $list = (struct _starpu_mpi_req_list) detached_requests
  802. if $list
  803. set $request = $list.list._head
  804. while $request
  805. starpu-mpi-print-request $request
  806. set $request = $request->_next
  807. end
  808. else
  809. printf "No detached requests\n"
  810. end
  811. end
  812. define starpu-mpi-print-early-data
  813. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  814. if $hash
  815. while $hash
  816. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  817. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  818. if $list
  819. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  820. while $data
  821. starpu-mpi-print-request $data->req
  822. set $data = $data->_next
  823. end
  824. end
  825. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  826. end
  827. else
  828. printf "No early data\n"
  829. end
  830. end
  831. define starpu-mpi-print-early-requests
  832. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  833. if $hash
  834. while $hash
  835. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  836. set $list = (struct _starpu_mpi_req_list*) $hash->list
  837. if $list
  838. set $request = $list->_head
  839. while $request
  840. starpu-mpi-print-request $request
  841. set $request = $request->_next
  842. end
  843. end
  844. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  845. end
  846. else
  847. printf "No early request\n"
  848. end
  849. end
  850. define starpu-mpi-print-sync-data
  851. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  852. if $hash
  853. while $hash
  854. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  855. set $list = (struct _starpu_mpi_req_list *) $hash->list
  856. if $list
  857. set $request = $list->_head
  858. while $request
  859. starpu-mpi-print-request $request
  860. set $request = $request->_next
  861. end
  862. end
  863. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  864. end
  865. else
  866. printf "No sync data\n"
  867. end
  868. end
  869. document starpu
  870. List of StarPU-specific gdb functions:
  871. starpu-workers prints a list of the StarPU workers
  872. starpu-tasks-on-workers prints a list of the tasks queued on workers
  873. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  874. starpu-print-job prints a StarPU job
  875. starpu-print-task prints a StarPU task
  876. starpu-print-all-tasks prints all StarPU tasks
  877. starpu-print-task-and-successor prints a StarPU task and its successors
  878. starpu-print-data prints a StarPU data handle
  879. starpu-print-datas prints all StarPU data handles
  880. starpu-print-datas-summary prints a summary of data handles
  881. starpu-print-request prints a StarPU data request
  882. starpu-print-prequests prints all pending StarPU data requests
  883. starpu-print-requests prints all queued StarPU data requests
  884. starpu-print-frequests prints all queued StarPU prefetch data requests
  885. starpu-print-irequests prints all queued StarPU idle data requests
  886. starpu-tasks prints a summary of the tasks flowing in StarPU
  887. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  888. starpu-tags prints a list of the tags known to StarPU
  889. starpu-print-tag prints a given tag
  890. starpu-memusage prints the memory node usage
  891. starpu-print-archs prints all known arch combinations
  892. starpu-print-arch prints a given arch combination
  893. starpu-print-registered-models prints all registered performance models
  894. starpu-print-model prints a given performance model
  895. starpu-sched-data prints the data of the given scheduler
  896. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  897. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  898. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  899. starpu-mpi-print-detached-requests prints all MPI detached requests
  900. starpu-mpi-print-early-data prints all MPI early received data
  901. starpu-mpi-print-early-requests prints all MPI early requests
  902. starpu-mpi-print-sync-data prints all MPI sync data
  903. end