gdbinit 25 KB

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