gdbinit 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  16. # To set a breakpoint when starting gdb with option "-ex run",
  17. # here what you need to do:
  18. #set breakpoint pending on
  19. #break starpu_mpi.c:419
  20. define starpu-print-job
  21. set language c
  22. set $job = (struct _starpu_job *)$arg0
  23. printf "StarPU Job (%p)\n", $job
  24. if ($job != 0)
  25. printf "\ttask:\t\t\t\t<%p>\n", $job->task
  26. printf "\tsubmitted:\t\t\t<%d>\n", $job->submitted
  27. printf "\tterminated:\t\t\t<%d>\n", $job->terminated
  28. printf "\tjob_id:\t\t\t\t<%d>\n", $job->job_id
  29. if $job->task && $job->task->name
  30. printf "\tname:\t\t\t\t<%s>\n", $job->task->name
  31. end
  32. end
  33. end
  34. define starpu-print-task
  35. set language c
  36. set $task = (struct starpu_task *)$arg0
  37. set $job = (struct _starpu_job *)$task->starpu_private
  38. set $status=0
  39. if $task->status == 0
  40. set $status="STARPU_TASK_INVALID"
  41. end
  42. if $task->status == 1
  43. set $status="STARPU_TASK_BLOCKED"
  44. end
  45. if $task->status == 2
  46. set $status="STARPU_TASK_READY"
  47. end
  48. if $task->status == 3
  49. set $status="STARPU_TASK_RUNNING"
  50. end
  51. if $task->status == 4
  52. set $status="STARPU_TASK_FINISHED"
  53. end
  54. if $task->status == 5
  55. set $status="STARPU_TASK_BLOCKED_ON_TAG"
  56. end
  57. if $task->status == 6
  58. set $status="STARPU_TASK_BLOCKED_ON_TASK"
  59. end
  60. if $task->status == 7
  61. set $status="STARPU_TASK_BLOCKED_ON_DATA"
  62. end
  63. if $task->status == 8
  64. set $status="STARPU_TASK_STOPPED"
  65. end
  66. printf "StarPU Task (%p)\n", $task
  67. if $task->name
  68. printf "\tname:\t\t\t\t<%s>\n", $task->name
  69. end
  70. printf "\tcodelet:\t\t\t<%p>\n", $task->cl
  71. if $task->cl && $task->cl->name
  72. printf "\tcodelet name:\t\t\t<%s>\n", $task->cl->name
  73. end
  74. 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-replicate
  508. set $repl = (struct _starpu_data_replicate*) $arg0
  509. printf "Handle %p\n", $repl->handle
  510. printf "Interface %p\n", $repl->data_interface
  511. printf "Refcnt %u\n", $repl->refcnt
  512. printf "Node %u\n", $repl->memory_node
  513. if $repl->state == 0
  514. printf "Owner\n"
  515. end
  516. if $repl->state == 1
  517. printf "Shared\n"
  518. end
  519. if $repl->state == 2
  520. printf "Invalid\n"
  521. end
  522. if $repl->relaxed_coherency
  523. printf " relaxed_coherency"
  524. end
  525. if $repl->initialized
  526. printf " initialized"
  527. end
  528. if $repl->allocated
  529. printf " allocated"
  530. end
  531. if $repl->automatically_allocated
  532. printf " automatically allocated"
  533. end
  534. if $repl->requested
  535. printf " requested"
  536. end
  537. printf "\n"
  538. printf "MC %p\n", $repl->mc
  539. end
  540. define starpu-print-request
  541. set $r = (struct _starpu_data_request *)$arg0
  542. printf "Request %p\n", $r
  543. printf "Origin %s\n", $r->origin
  544. printf "Refcnt %d\n", $r->refcnt
  545. printf "Handle %p\n", $r->handle
  546. printf "src_replicate %p", $r->src_replicate
  547. if $r->src_replicate
  548. printf " (%d)", $r->src_replicate->memory_node
  549. end
  550. printf "\n"
  551. printf "dst_replicate %p", $r->dst_replicate
  552. if $r->dst_replicate
  553. printf " (%d)", $r->dst_replicate->memory_node
  554. end
  555. printf "\n"
  556. printf "handling_node %d\n", $r->handling_node
  557. if ($r->mode & 1)
  558. printf "R"
  559. end
  560. if ($r->mode & 2)
  561. printf "W"
  562. end
  563. if ($r->mode & 4)
  564. printf "S"
  565. end
  566. if ($r->mode & 8)
  567. printf "X"
  568. end
  569. printf "\n"
  570. printf "completed: %d\n", $r->completed
  571. printf "prefetch: %d\n", $r->prefetch
  572. printf "retval: %d\n", $r->retval
  573. printf "ndeps: %d\n", $r->ndeps
  574. printf "next_req_count: %d\n", $r->next_req_count
  575. set $c = 0
  576. while $c < $r->next_req_count
  577. printf " %p\n", $r->next_req[$c]
  578. set $c = $c + 1
  579. end
  580. printf "comid: %u\n", $r->com_id
  581. set $c = $r->callbacks
  582. while $c != 0
  583. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  584. set $c = $c->next
  585. end
  586. end
  587. define starpu-print-requests-treelist
  588. set $list = $arg0
  589. set $request = $list->_head
  590. while $request != 0
  591. printf " Request %p: handle %p ", $request, $request->handle
  592. starpu-print-mode $request->mode
  593. printf "\n"
  594. set $request = $request->_next
  595. end
  596. end
  597. define starpu-print-requests-tree
  598. if $arg0
  599. starpu-print-requests-tree $arg0->children[0]
  600. set $stage = (struct _starpu_data_request_prio_list_stage *) $arg0
  601. starpu-print-requests-treelist (&($stage->list))
  602. starpu-print-requests-tree $arg0->children[1]
  603. end
  604. end
  605. define starpu-print-requests-list
  606. starpu-print-requests-tree $arg0.tree.root
  607. end
  608. define starpu-print-requests
  609. set $node = 0
  610. while $node < _starpu_descr.nnodes
  611. printf "Node %u:\n", $node
  612. starpu-print-requests-list data_requests[$node]
  613. set $node = $node + 1
  614. end
  615. end
  616. define starpu-print-prequests
  617. set $node = 0
  618. while $node < _starpu_descr.nnodes
  619. printf "Node %u:\n", $node
  620. printf "%u pending requests\n", data_requests_npending[$node]
  621. starpu-print-requests-list data_requests_pending[$node]
  622. set $node = $node + 1
  623. end
  624. end
  625. define starpu-print-arch
  626. set $arch = (struct starpu_perfmodel_arch *)$arg0
  627. set $device = 0
  628. while $device < $arch->ndevices
  629. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  630. set $device = $device + 1
  631. end
  632. end
  633. define starpu-print-archs
  634. set $comb = 0
  635. while $comb < current_arch_comb
  636. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  637. starpu-print-arch arch_combs[$comb]
  638. set $comb = $comb + 1
  639. end
  640. end
  641. define starpu-print-frequests
  642. set $node = 0
  643. while $node < _starpu_descr.nnodes
  644. printf "Node %u:\n", $node
  645. starpu-print-requests-list prefetch_requests[$node]
  646. set $node = $node + 1
  647. end
  648. end
  649. define starpu-print-irequests
  650. set $node = 0
  651. while $node < _starpu_descr.nnodes
  652. printf "Node %u:\n", $node
  653. starpu-print-requests-list idle_requests[$node]
  654. set $node = $node + 1
  655. end
  656. end
  657. define starpu-memusage
  658. set scheduler-locking on
  659. set $node = 0
  660. while $node < _starpu_descr.nnodes
  661. printf "\n\nNode %u:\n", $node
  662. set $total = 0
  663. set $total_b = 0
  664. set $wt = 0
  665. set $wt_b = 0
  666. set $home = 0
  667. set $home_b = 0
  668. set $ooc = 0
  669. set $ooc_b = 0
  670. set $diduse = 0
  671. set $diduse_b = 0
  672. set $redux = 0
  673. set $redux_b = 0
  674. set $relax = 0
  675. set $relax_b = 0
  676. set $noref = 0
  677. set $noref_b = 0
  678. set $normal = 0
  679. set $normal_b = 0
  680. set $owner = 0
  681. set $owner_b = 0
  682. set $shared = 0
  683. set $shared_b = 0
  684. set $invalid = 0
  685. set $invalid_b = 0
  686. set $nodataref = 0
  687. set $nodataref_b = 0
  688. set $nosubdataref = 0
  689. set $nosubdataref_b = 0
  690. set $reading = 0
  691. set $reading_b = 0
  692. set $writing = 0
  693. set $writing_b = 0
  694. set $overwriting = 0
  695. set $overwriting_b = 0
  696. set $mc = mc_list[$node]->_head
  697. set pagination off
  698. while $mc != 0
  699. set $handle = $mc->data
  700. set $size = _starpu_data_get_size($handle)
  701. set $total = $total + 1
  702. if $total % 100 == 0
  703. printf "\rinspected %d data...", $total
  704. end
  705. set $total_b = $total_b + $size
  706. if $handle->wt_mask & (1 << $node)
  707. set $wt = $wt + 1
  708. set $wt_b = $wt_b + $size
  709. end
  710. if $node == $handle->home_node
  711. set $home = $home + 1
  712. set $home_b = $home_b + $size
  713. end
  714. if $handle->ooc
  715. set $ooc = $ooc + 1
  716. set $ooc_b = $ooc_b + $size
  717. end
  718. if $mc->diduse
  719. set $diduse = $diduse + 1
  720. set $diduse_b = $diduse_b + $size
  721. end
  722. if $mc->relaxed_coherency == 2
  723. set $redux = $redux + 1
  724. set $redux_b = $redux_b + $size
  725. end
  726. if $mc->relaxed_coherency == 1
  727. set $relax = $relax + 1
  728. set $relax_b = $relax_b + $size
  729. if $mc->replicate
  730. if $mc->replicate->refcnt == 0
  731. set $noref = $noref + 1
  732. set $noref_b = $noref_b + $size
  733. end
  734. end
  735. end
  736. if $mc->relaxed_coherency == 0
  737. set $normal = $normal + 1
  738. set $normal_b = $normal_b + $size
  739. if $handle->per_node[$node].state == STARPU_OWNER
  740. set $owner = $owner + 1
  741. set $owner_b = $owner_b + $size
  742. end
  743. if $handle->per_node[$node].state == STARPU_SHARED
  744. set $shared = $shared + 1
  745. set $shared_b = $shared_b + $size
  746. end
  747. if $handle->per_node[$node].state == STARPU_INVALID
  748. set $invalid = $invalid + 1
  749. set $invalid_b = $invalid_b + $size
  750. end
  751. if (may_free_subtree($handle,$node))
  752. set $nosubdataref = $nosubdataref + 1
  753. set $nosubdataref_b = $nosubdataref_b + $size
  754. end
  755. if $handle->per_node[$node].refcnt == 0
  756. set $nodataref = $nodataref + 1
  757. set $nodataref_b = $nodataref_b + $size
  758. else
  759. set $r = 0
  760. set $w = 0
  761. set $_node = 0
  762. while $_node < _starpu_descr.nnodes
  763. set $_node = $_node + 1
  764. if $_node != $node
  765. if $handle->per_node[$_node].request[$node] != 0
  766. set $r = $r + 1
  767. end
  768. if $handle->per_node[$node].request[$_node] != 0
  769. set $w = $w + 1
  770. end
  771. end
  772. end
  773. if $r != 0
  774. set $reading = $reading + 1
  775. set $reading_b = $reading_b + $size
  776. end
  777. if $w != 0
  778. set $writing = $writing + 1
  779. set $writing_b = $writing_b + $size
  780. end
  781. if $handle->per_node[$node].request[$node] != 0
  782. set $overwriting = $overwriting + 1
  783. set $overwriting_b = $overwriting_b + $size
  784. end
  785. end
  786. end
  787. set $mc = $mc->_next
  788. end
  789. set pagination on
  790. printf "\r \r"
  791. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  792. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  793. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  794. printf " OOC: %u, %uMiB\n", $ooc, $ooc_b / 1048576
  795. printf " diduse: %u, %uMiB\n", $diduse, $diduse_b / 1048576
  796. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  797. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  798. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  799. printf " normal: %u, %uMiB\n", $normal, $normal_b / 1048576
  800. printf " owner: %u, %uMiB\n", $owner, $owner_b / 1048576
  801. printf " shared: %u, %uMiB\n", $shared, $shared_b / 1048576
  802. printf " invalid: %u, %uMiB\n", $invalid, $invalid_b / 1048576
  803. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  804. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  805. printf " reading: %u, %uMiB\n", $reading, $reading_b / 1048576
  806. printf " writing: %u, %uMiB\n", $writing, $writing_b / 1048576
  807. printf " overwriting: %u, %uMiB\n", $overwriting, $overwriting_b / 1048576
  808. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  809. set $node = $node + 1
  810. end
  811. end
  812. define starpu-print-model
  813. set $model = (struct starpu_perfmodel *)$arg0
  814. printf "Model %p type %d symbol ", $model, $model->type
  815. if $model->symbol
  816. printf "%s", $model->symbol
  817. else
  818. printf "NULL"
  819. end
  820. printf "\n"
  821. end
  822. define starpu-print-registered-models
  823. set $node = registered_models
  824. while $node
  825. starpu-print-model $node->model
  826. set $node = $node->next
  827. end
  828. end
  829. define starpu-sched-data
  830. print _starpu_config.sched_ctxs[$arg0]->policy_data
  831. end
  832. define starpu-print-spaces
  833. set $j = 0
  834. while $j < $arg0
  835. printf " "
  836. set $j = $j + 1
  837. end
  838. end
  839. define starpu-sched-print-component
  840. set $c = (struct starpu_sched_component *) $arg1
  841. starpu-print-spaces $arg0
  842. 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
  843. if $c->push_task == fifo_push_task
  844. set $f = ((struct _starpu_fifo_data *) $c->data)->fifo
  845. starpu-print-spaces $arg0
  846. 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
  847. end
  848. if $c->push_task == prio_push_task
  849. set $q = &((struct _starpu_prio_data *) $c->data)->prio
  850. starpu-print-spaces $arg0
  851. 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
  852. end
  853. if $c->push_task == simple_worker_push_task
  854. set $d = (struct _starpu_worker_component_data *) $c->data
  855. set $l = $d->list
  856. starpu-print-spaces $arg0
  857. 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
  858. end
  859. end
  860. define starpu-sched-print-recur-component
  861. starpu-sched-print-component $arg0 $arg1
  862. set $i[$arg0] = 0
  863. while $i[$arg0] < $arg1->nchildren
  864. starpu-sched-print-recur-component ($arg0+1) $arg1->children[$i[$arg0]]
  865. set $i[$arg0] = $i[$arg0] + 1
  866. end
  867. end
  868. define starpu-sched-print-modular
  869. set $t = (struct starpu_sched_tree *) _starpu_config.sched_ctxs[$arg0]->policy_data
  870. set $i = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
  871. starpu-sched-print-recur-component 0 $t->root
  872. end
  873. define starpu-mpi-print-request
  874. set $request = (struct _starpu_mpi_req *)$arg0
  875. set $request_type = "unknown_type"
  876. if $request->request_type == SEND_REQ
  877. set $request_type = "SEND_REQ"
  878. end
  879. if $request->request_type == RECV_REQ
  880. set $request_type = "RECV_REQ"
  881. end
  882. if $request->request_type == WAIT_REQ
  883. set $request_type = "WAIT_REQ"
  884. end
  885. if $request->request_type == TEST_REQ
  886. set $request_type = "TEST_REQ"
  887. end
  888. if $request->request_type == BARRIER_REQ
  889. set $request_type = "BARRIER_REQ"
  890. end
  891. if $request->request_type == PROBE_REQ
  892. set $request_type = "PROBE_REQ"
  893. end
  894. if $request->request_type == UNKNOWN_REQ
  895. set $request_type = "UNKNOWN_REQ"
  896. end
  897. 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
  898. end
  899. define starpu-mpi-print-ready-recv-requests
  900. set $list = (struct _starpu_mpi_req_list) ready_recv_requests
  901. if $list
  902. set $request = $list.list._head
  903. while $request
  904. starpu-mpi-print-request $request
  905. set $request = $request->_next
  906. end
  907. else
  908. printf "No ready recv requests\n"
  909. end
  910. end
  911. define starpu-mpi-print-ready-send-requests
  912. set $list = (struct _starpu_mpi_req_prio_list) ready_send_requests
  913. if $list
  914. set $request = $list.list._head
  915. while $request
  916. starpu-mpi-print-request $request
  917. set $request = $request->_next
  918. end
  919. else
  920. printf "No ready send requests\n"
  921. end
  922. end
  923. define starpu-mpi-print-detached-requests
  924. set $list = (struct _starpu_mpi_req_list) detached_requests
  925. if $list
  926. set $request = $list.list._head
  927. while $request
  928. starpu-mpi-print-request $request
  929. set $request = $request->_next
  930. end
  931. else
  932. printf "No detached requests\n"
  933. end
  934. end
  935. define starpu-mpi-print-early-data
  936. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  937. if $hash
  938. while $hash
  939. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  940. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  941. if $list
  942. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  943. while $data
  944. starpu-mpi-print-request $data->req
  945. set $data = $data->_next
  946. end
  947. end
  948. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  949. end
  950. else
  951. printf "No early data\n"
  952. end
  953. end
  954. define starpu-mpi-print-early-requests
  955. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  956. if $hash
  957. while $hash
  958. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  959. set $list = (struct _starpu_mpi_req_list*) $hash->list
  960. if $list
  961. set $request = $list->_head
  962. while $request
  963. starpu-mpi-print-request $request
  964. set $request = $request->_next
  965. end
  966. end
  967. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  968. end
  969. else
  970. printf "No early request\n"
  971. end
  972. end
  973. define starpu-mpi-print-sync-data
  974. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  975. if $hash
  976. while $hash
  977. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  978. set $list = (struct _starpu_mpi_req_list *) $hash->list
  979. if $list
  980. set $request = $list->_head
  981. while $request
  982. starpu-mpi-print-request $request
  983. set $request = $request->_next
  984. end
  985. end
  986. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  987. end
  988. else
  989. printf "No sync data\n"
  990. end
  991. end
  992. document starpu
  993. List of StarPU-specific gdb functions:
  994. starpu-workers prints a list of the StarPU workers
  995. starpu-tasks-on-workers prints a list of the tasks queued on workers
  996. starpu-tasks-on-worker prints a list of the tasks queued on the given worker
  997. starpu-print-job prints a StarPU job
  998. starpu-print-task prints a StarPU task
  999. starpu-print-all-tasks prints all StarPU tasks
  1000. starpu-print-task-and-successor prints a StarPU task and its successors
  1001. starpu-print-data prints a StarPU data handle
  1002. starpu-print-datas prints all StarPU data handles
  1003. starpu-print-datas-summary prints a summary of data handles
  1004. starpu-print-replicate prints a StarPU data replicate
  1005. starpu-print-request prints a StarPU data request
  1006. starpu-print-prequests prints all pending StarPU data requests
  1007. starpu-print-requests prints all queued StarPU data requests
  1008. starpu-print-frequests prints all queued StarPU prefetch data requests
  1009. starpu-print-irequests prints all queued StarPU idle data requests
  1010. starpu-tasks prints a summary of the tasks flowing in StarPU
  1011. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  1012. starpu-tags prints a list of the tags known to StarPU
  1013. starpu-print-tag prints a given tag
  1014. starpu-memusage prints the memory node usage
  1015. starpu-print-archs prints all known arch combinations
  1016. starpu-print-arch prints a given arch combination
  1017. starpu-print-registered-models prints all registered performance models
  1018. starpu-print-model prints a given performance model
  1019. starpu-sched-data prints the data of the given scheduler
  1020. starpu-sched-print-modular prints the hierarchy of modular scheduling components
  1021. starpu-mpi-print-ready-recv-requests prints all MPI ready recv requests
  1022. starpu-mpi-print-ready-send-requests prints all MPI ready send requests
  1023. starpu-mpi-print-detached-requests prints all MPI detached requests
  1024. starpu-mpi-print-early-data prints all MPI early received data
  1025. starpu-mpi-print-early-requests prints all MPI early requests
  1026. starpu-mpi-print-sync-data prints all MPI sync data
  1027. end