gdbinit 29 KB

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