gdbinit 34 KB

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