gdbinit 33 KB

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