gdbinit 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  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 $j = all_jobs_list->next
  217. while $j != 0
  218. printf "task %p\n", $j->task
  219. starpu-print-task $j->task
  220. set $j = $j->all_submitted->next
  221. end
  222. end
  223. define starpu-all-tasks
  224. set language c
  225. set $j = all_jobs_list->next
  226. while $j != 0
  227. printf "task %p\n", $j->task
  228. set $j = $j->all_submitted->next
  229. end
  230. end
  231. define starpu
  232. printf "Here I am...\n"
  233. end
  234. define starpu-print-mode
  235. if ($arg0 & 1)
  236. printf "R"
  237. end
  238. if ($arg0 & 2)
  239. printf "W"
  240. end
  241. if ($arg0 & 4)
  242. printf " SCRATCH"
  243. end
  244. if ($arg0 & 8)
  245. printf " REDUX"
  246. end
  247. end
  248. define starpu-print-data
  249. set language c
  250. set $data = (starpu_data_handle_t) $arg0
  251. printf "Data handle %p\n", $data
  252. if $data->ops->interfaceid == 0
  253. printf "Matrix\n"
  254. end
  255. if $data->ops->interfaceid == 1
  256. printf "Block\n"
  257. end
  258. if $data->ops->interfaceid == 2
  259. printf "Vector\n"
  260. end
  261. if $data->ops->interfaceid == 3
  262. printf "CSR\n"
  263. end
  264. if $data->ops->interfaceid == 4
  265. printf "BCSR\n"
  266. end
  267. if $data->ops->interfaceid == 5
  268. printf "Variable\n"
  269. end
  270. if $data->ops->interfaceid == 6
  271. printf "Void\n"
  272. end
  273. if $data->ops->interfaceid == 7
  274. printf "Multiformat\n"
  275. end
  276. if $data->ops->interfaceid == 8
  277. printf "COO\n"
  278. end
  279. if $data->ops->interfaceid > 8
  280. printf "Interface id %d\n", $data->ops->interfaceid
  281. end
  282. printf "Home node %d\n", $data->home_node
  283. printf "RWlock refs %d\n", $data->refcnt
  284. printf "Busy count %d\n", $data->busy_count
  285. printf "Current mode "
  286. starpu-print-mode $data->current_mode
  287. printf "\n"
  288. if $data->current_mode & (4|8)
  289. set $n = 0
  290. while $n < _starpu_config.topology.nworkers
  291. set $replicate = $data->per_worker[$n]
  292. printf "Worker %2d %10s:", $n, _starpu_config->workers[$n]->name
  293. if $replicate.state == 0
  294. printf " OWNER"
  295. end
  296. if $replicate.state == 1
  297. printf " SHARED"
  298. end
  299. if $replicate.state == 2
  300. printf " INVALID"
  301. end
  302. if $replicate.initialized
  303. printf " initialized"
  304. end
  305. printf "\n"
  306. set $n = $n + 1
  307. end
  308. else
  309. set $n = 0
  310. while $n < descr.nnodes
  311. set $replicate = &$data->per_node[$n]
  312. printf "Node %2d (%2d):", $n, $replicate->refcnt
  313. if $replicate.state == 0
  314. printf " OWNER"
  315. end
  316. if $replicate.state == 1
  317. printf " SHARED"
  318. end
  319. if $replicate.state == 2
  320. printf " INVALID"
  321. end
  322. if $replicate.initialized
  323. printf " initialized"
  324. end
  325. printf "\n"
  326. set $m = 0
  327. while $m < descr.nnodes
  328. if $replicate->request[$m]
  329. printf " request %p from %d\n", $replicate->request[$m], $m
  330. end
  331. set $m = $m + 1
  332. end
  333. set $n = $n + 1
  334. end
  335. set $r = $data->write_invalidation_req
  336. if $r
  337. printf "w_req %p for %d\n", $r, $r->dst_replicate->memory_node
  338. end
  339. end
  340. printf "Post sync tasks\n"
  341. set $tasklist = $data->post_sync_tasks
  342. while $tasklist != 0x0
  343. starpu-print-task $tasklist->task
  344. set $tasklist = $tasklist->next
  345. end
  346. printf "Requester tasks\n"
  347. set $requesterlist = $data->req_list._head
  348. while $requesterlist != 0x0
  349. printf "mode: "
  350. starpu-print-mode $requesterlist->mode
  351. printf "\n"
  352. starpu-print-job $requesterlist->j
  353. set $requesterlist = $requesterlist->_next
  354. end
  355. printf "Arbitered requester tasks\n"
  356. set $requesterlist = $data->arbitered_req_list._head
  357. while $requesterlist != 0x0
  358. printf "mode: "
  359. starpu-print-mode $requesterlist->mode
  360. printf "\n"
  361. starpu-print-job $requesterlist->j
  362. set $requesterlist = $requesterlist->_next
  363. end
  364. if ($data->nchildren)
  365. printf "%d children\n", $data->nchildren
  366. end
  367. end
  368. define starpu-print-datas
  369. set $entry = registered_handles
  370. while $entry
  371. starpu-print-data $entry->handle
  372. printf "\n"
  373. set $entry = (struct handle_entry *) $entry.hh.next
  374. end
  375. end
  376. define starpu-print-datas-summary
  377. set language c
  378. set $entry = registered_handles
  379. set $data_n = 0
  380. set $pw_data_n = 0
  381. set $data_n_allocated = 0
  382. set $replicate_n_owners = 0
  383. set $replicate_n_shared = 0
  384. set $replicate_n_invalid = 0
  385. set $replicate_n_initialized = 0
  386. set $replicate_n_allocated = 0
  387. set $pw_replicate_n_owners = 0
  388. set $pw_replicate_n_shared = 0
  389. set $pw_replicate_n_invalid = 0
  390. set $pw_replicate_n_initialized = 0
  391. set $pw_replicate_n_allocated = 0
  392. while $entry
  393. set $data = (starpu_data_handle_t) $entry->handle
  394. if $data->current_mode & (4|8)
  395. set $pw_data_n = $pw_data_n + 1
  396. set $n = 0
  397. while $n < _starpu_config.topology.nworkers
  398. set $replicate = $data->per_worker[$n]
  399. if $replicate.state == 0
  400. set $pw_replicate_n_owners = $pw_replicate_n_owners + 1
  401. end
  402. if $replicate.state == 1
  403. set $pw_replicate_n_shared = $pw_replicate_n_shared + 1
  404. end
  405. if $replicate.state == 2
  406. set $pw_replicate_n_invalid = $pw_replicate_n_invalid + 1
  407. end
  408. if $replicate.initialized
  409. set $pw_replicate_n_initialized = $pw_replicate_n_initialized + 1
  410. end
  411. if $replicate.allocated
  412. set $pw_replicate_n_allocated = $pw_replicate_n_allocated + 1
  413. end
  414. set $n = $n + 1
  415. end
  416. else
  417. set $data_n = $data_n + 1
  418. set $n = 0
  419. while $n < descr.nnodes
  420. set $replicate = &$data->per_node[$n]
  421. if $replicate.state == 0
  422. set $replicate_n_owners = $replicate_n_owners + 1
  423. end
  424. if $replicate.state == 1
  425. set $replicate_n_shared = $replicate_n_shared + 1
  426. end
  427. if $replicate.state == 2
  428. set $replicate_n_invalid = $replicate_n_invalid + 1
  429. end
  430. if $replicate.initialized
  431. set $replicate_n_initialized = $replicate_n_initialized + 1
  432. end
  433. if $replicate.allocated
  434. set $replicate_n_allocated = $replicate_n_allocated + 1
  435. set $data_allocated = 1
  436. end
  437. set $n = $n + 1
  438. end
  439. if $data_allocated
  440. set $data_n_allocated = $data_n_allocated + 1
  441. end
  442. end
  443. set $entry = (struct handle_entry *) $entry.hh.next
  444. end
  445. printf "Number of handles: %d\n", $data_n
  446. printf "Number of allocated handles: %d\n", $data_n_allocated
  447. printf "Number of OWNER replicates: %d\n", $replicate_n_owners
  448. printf "Number of SHARED replicates: %d\n", $replicate_n_shared
  449. printf "Number of INVALID replicates: %d\n", $replicate_n_invalid
  450. printf "Number of initialized replicates: %d\n", $replicate_n_initialized
  451. printf "Number of allocated replicates: %d\n", $replicate_n_allocated
  452. printf "Number of per-worker handles: %d\n", $pw_data_n
  453. printf "Number of OWNER per-worker replicates: %d\n", $pw_replicate_n_owners
  454. printf "Number of SHARED per-worker replicates: %d\n", $pw_replicate_n_shared
  455. printf "Number of INVALID per-worker replicates: %d\n", $pw_replicate_n_invalid
  456. printf "Number of initialized per-worker replicates: %d\n", $pw_replicate_n_initialized
  457. printf "Number of allocated per-worker replicates: %d\n", $pw_replicate_n_allocated
  458. end
  459. define starpu-print-request
  460. set $r = (struct _starpu_data_request *)$arg0
  461. printf "Request %p\n", $r
  462. printf "Refcnt %d\n", $r->refcnt
  463. printf "Handle %p\n", $r->handle
  464. printf "src_replicate %p\n", $r->src_replicate
  465. printf "dst_replicate %p\n", $r->dst_replicate
  466. printf "handling_node %d\n", $r->handling_node
  467. if ($r->mode & 1)
  468. printf "R"
  469. end
  470. if ($r->mode & 2)
  471. printf "W"
  472. end
  473. if ($r->mode & 4)
  474. printf "S"
  475. end
  476. if ($r->mode & 8)
  477. printf "X"
  478. end
  479. printf "\n"
  480. printf "completed: %d\n", $r->completed
  481. printf "prefetch: %d\n", $r->prefetch
  482. printf "retval: %d\n", $r->retval
  483. printf "ndeps: %d\n", $r->ndeps
  484. printf "next_req_count: %d\n", $r->next_req_count
  485. printf "comid: %u\n", $r->com_id
  486. set $c = $r->callbacks
  487. while $c != 0
  488. printf "callback: %p %p\n", $c->callback_func, $c->callback_arg
  489. set $c = $c->next
  490. end
  491. end
  492. define starpu-print-requests
  493. set $node = 0
  494. while $node < descr.nnodes
  495. printf "Node %u:\n", $node
  496. set $request = data_requests[$node]._head
  497. while $request != 0
  498. printf " Request %p: handle %p ", $request, $request->handle
  499. starpu-print-mode $request->mode
  500. printf "\n"
  501. set $request = $request->_next
  502. end
  503. set $node = $node + 1
  504. end
  505. end
  506. define starpu-print-prequests
  507. set $node = 0
  508. while $node < descr.nnodes
  509. printf "Node %u:\n", $node
  510. printf "%u pending requests\n", data_requests_npending[$node]
  511. set $request = data_requests_pending[$node]._head
  512. while $request != 0
  513. printf " Request %p: handle %p ", $request, $request->handle
  514. starpu-print-mode $request->mode
  515. printf "\n"
  516. set $request = $request->_next
  517. end
  518. set $node = $node + 1
  519. end
  520. end
  521. define starpu-print-arch
  522. set $arch = (struct starpu_perfmodel_arch *)$arg0
  523. set $device = 0
  524. while $device < $arch->ndevices
  525. printf " Device type %d - devid: %d - ncores: %d\n", $arch->devices[$device].type, $arch->devices[$device].devid, $arch->devices[$device].ncores
  526. set $device = $device + 1
  527. end
  528. end
  529. define starpu-print-archs
  530. set $comb = 0
  531. while $comb < current_arch_comb
  532. printf "Combination %d with %d devices\n", $comb, arch_combs[$comb]->ndevices
  533. starpu-print-arch arch_combs[$comb]
  534. set $comb = $comb + 1
  535. end
  536. end
  537. define starpu-print-frequests
  538. set $node = 0
  539. while $node < descr.nnodes
  540. printf "Node %u:\n", $node
  541. set $request = prefetch_requests[$node]._head
  542. while $request != 0
  543. printf " Request %p: handle %p ", $request, $request->handle
  544. starpu-print-mode $request->mode
  545. printf "\n"
  546. set $request = $request->_next
  547. end
  548. set $node = $node + 1
  549. end
  550. end
  551. define starpu-print-irequests
  552. set $node = 0
  553. while $node < descr.nnodes
  554. printf "Node %u:\n", $node
  555. set $request = idle_requests[$node]._head
  556. while $request != 0
  557. printf " Request %p: handle %p ", $request, $request->handle
  558. starpu-print-mode $request->mode
  559. printf "\n"
  560. set $request = $request->_next
  561. end
  562. set $node = $node + 1
  563. end
  564. end
  565. define starpu-memusage
  566. set scheduler-locking on
  567. set $node = 0
  568. while $node < descr.nnodes
  569. printf "\n\nNode %u:\n", $node
  570. set $total = 0
  571. set $total_b = 0
  572. set $wt = 0
  573. set $wt_b = 0
  574. set $home = 0
  575. set $home_b = 0
  576. set $redux = 0
  577. set $redux_b = 0
  578. set $relax = 0
  579. set $relax_b = 0
  580. set $noref = 0
  581. set $noref_b = 0
  582. set $nodataref = 0
  583. set $nodataref_b = 0
  584. set $nosubdataref = 0
  585. set $nosubdataref_b = 0
  586. set $mc = mc_list[$node]->_head
  587. while $mc != 0
  588. set $handle = $mc->data
  589. set $size = _starpu_data_get_size($handle)
  590. set $total = $total + 1
  591. set $total_b = $total_b + $size
  592. if $handle->wt_mask & (1 << $node)
  593. set $wt = $wt + 1
  594. set $wt_b = $wt_b + $size
  595. end
  596. if $node == $handle->home_node
  597. set $home = $home + 1
  598. set $home_b = $home_b + $size
  599. end
  600. if $mc->relaxed_coherency == 2
  601. set $redux = $redux + 1
  602. set $redux_b = $redux_b + $size
  603. end
  604. if $mc->relaxed_coherency == 1
  605. set $relax = $relax + 1
  606. set $relax_b = $relax_b + $size
  607. if $mc->replicate
  608. if $mc->replicate->refcnt == 0
  609. set $noref = $noref + 1
  610. set $noref_b = $noref_b + $size
  611. end
  612. end
  613. end
  614. if $mc->relaxed_coherency == 0
  615. if (may_free_subtree($handle,$node))
  616. set $nosubdataref = $nosubdataref + 1
  617. set $nosubdataref_b = $nosubdataref_b + $size
  618. end
  619. if $handle->per_node[$node].refcnt == 0
  620. set $nodataref = $nodataref + 1
  621. set $nodataref_b = $nodataref_b + $size
  622. end
  623. end
  624. set $mc = $mc->_next
  625. end
  626. printf " Total used: %u, %uMiB\n", $total, $total_b / 1048576
  627. printf " WT: %u, %uMiB\n", $wt, $wt_b / 1048576
  628. printf " home: %u, %uMiB\n", $home, $home_b / 1048576
  629. printf " redux: %u, %uMiB\n", $redux, $redux_b / 1048576
  630. printf " relax: %u, %uMiB\n", $relax, $relax_b / 1048576
  631. printf " noref: %u, %uMiB\n", $noref, $noref_b / 1048576
  632. printf " nosubdataref: %u, %uMiB\n", $nosubdataref, $nosubdataref_b / 1048576
  633. printf " nodataref: %u, %uMiB\n", $nodataref, $nodataref_b / 1048576
  634. printf "\n cached: %u, %uMiB\n", mc_cache_nb[$node], mc_cache_size[$node] / 1048576
  635. set $node = $node + 1
  636. end
  637. end
  638. define starpu-print-model
  639. set $model = (struct starpu_perfmodel *)$arg0
  640. printf "Model %p type %d symbol ", $model, $model->type
  641. if $model->symbol
  642. printf "%s", $model->symbol
  643. else
  644. printf "NULL"
  645. end
  646. printf "\n"
  647. end
  648. define starpu-print-registered-models
  649. set $node = registered_models
  650. while $node
  651. starpu-print-model $node->model
  652. set $node = $node->next
  653. end
  654. end
  655. define starpu-mpi-print-request
  656. set $request = (struct _starpu_mpi_req *)$arg0
  657. set $request_type = "unknown_type"
  658. if $request->request_type == SEND_REQ
  659. set $request_type = "SEND_REQ"
  660. end
  661. if $request->request_type == RECV_REQ
  662. set $request_type = "RECV_REQ"
  663. end
  664. if $request->request_type == WAIT_REQ
  665. set $request_type = "WAIT_REQ"
  666. end
  667. if $request->request_type == TEST_REQ
  668. set $request_type = "TEST_REQ"
  669. end
  670. if $request->request_type == BARRIER_REQ
  671. set $request_type = "BARRIER_REQ"
  672. end
  673. if $request->request_type == PROBE_REQ
  674. set $request_type = "PROBE_REQ"
  675. end
  676. if $request->request_type == UNKNOWN_REQ
  677. set $request_type = "UNKNOWN_REQ"
  678. end
  679. printf "Request (struct _starpu_mpi_req *) %p data %p tag %d type %s submitted %d completed %d posted %d detached %d is_internal_req %d\n", $request, $request->data_handle, ((struct _starpu_mpi_node_tag *) ($request->data_handle->mpi_data))->data_tag, $request_type, $request->submitted, $request->completed, $request->posted, $request->detached, $request->is_internal_req
  680. end
  681. define starpu-mpi-print-ready-requests
  682. set $list = (struct _starpu_mpi_req_list *) ready_requests
  683. if $list
  684. set $request = $list->_head
  685. while $request
  686. starpu-mpi-print-request $request
  687. set $request = $request->_next
  688. end
  689. else
  690. printf "No ready requests"
  691. end
  692. end
  693. define starpu-mpi-print-detached-requests
  694. set $list = (struct _starpu_mpi_req_list *) detached_requests
  695. if $list
  696. set $request = $list->_head
  697. while $request
  698. starpu-mpi-print-request $request
  699. set $request = $request->_next
  700. end
  701. else
  702. printf "No detached requests"
  703. end
  704. end
  705. define starpu-mpi-print-early-data
  706. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *)_starpu_mpi_early_data_handle_hashmap
  707. if $hash
  708. while $hash
  709. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  710. set $list = (struct _starpu_mpi_early_data_handle_list *) $hash->list
  711. if $list
  712. set $data = (struct _starpu_mpi_early_data_handle *)$list->_head
  713. while $data
  714. starpu-mpi-print-request $data->req
  715. set $data = $data->_next
  716. end
  717. end
  718. set $hash = (struct _starpu_mpi_early_data_handle_hashlist *) $hash->hh.next
  719. end
  720. else
  721. printf "No early data\n"
  722. end
  723. end
  724. define starpu-mpi-print-early-requests
  725. set $hash = (struct _starpu_mpi_early_request_hashlist *)_starpu_mpi_early_request_hash
  726. if $hash
  727. while $hash
  728. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  729. set $list = (struct _starpu_mpi_req_list*) $hash->list
  730. if $list
  731. set $request = $list->_head
  732. while $request
  733. starpu-mpi-print-request $request
  734. set $request = $request->_next
  735. end
  736. end
  737. set $hash = (struct _starpu_mpi_early_request_hashlist *) $hash->hh.next
  738. end
  739. else
  740. printf "No early request\n"
  741. end
  742. end
  743. define starpu-mpi-print-sync-data
  744. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *)_starpu_mpi_sync_data_handle_hashmap
  745. if $hash
  746. while $hash
  747. printf "Communicator %p Rank %d Data_tag %d\n", $hash->node_tag->comm, $hash->node_tag->rank, $hash->node_tag->data_tag
  748. set $list = (struct _starpu_mpi_req_list *) $hash->list
  749. if $list
  750. set $request = $list->_head
  751. while $request
  752. starpu-mpi-print-request $request
  753. set $request = $request->_next
  754. end
  755. end
  756. set $hash = (struct _starpu_mpi_sync_data_handle_hashlist *) $hash->hh.next
  757. end
  758. else
  759. printf "No sync data\n"
  760. end
  761. end
  762. document starpu
  763. List of StarPU-specific gdb functions:
  764. starpu-workers prints a list of the StarPU workers
  765. starpu-tasks-on-workers prints a list of the tasks currently running on workers
  766. starpu-tasks-on-worker prints a list of the tasks running on the given worker
  767. starpu-print-job prints a StarPU job
  768. starpu-print-task prints a StarPU task
  769. starpu-print-all-tasks prints all StarPU tasks
  770. starpu-print-task-and-successor prints a StarPU task and its successors
  771. starpu-print-data prints a StarPU data handle
  772. starpu-print-datas prints all StarPU data handles
  773. starpu-print-datas-summary prints a summary of data handles
  774. starpu-print-request prints a StarPU data request
  775. starpu-print-prequests prints all pending StarPU data requests
  776. starpu-print-requests prints all queued StarPU data requests
  777. starpu-print-frequests prints all queued StarPU prefetch data requests
  778. starpu-print-irequests prints all queued StarPU idle data requests
  779. starpu-tasks prints a summary of the tasks flowing in StarPU
  780. starpu-all-tasks prints a list of all the tasks flowing in StarPU
  781. starpu-tags prints a list of the tags known to StarPU
  782. starpu-memusage prints the memory node usage
  783. starpu-print-archs prints all known arch combinations
  784. starpu-print-arch prints a given arch combination
  785. starpu-print-registered-models prints all registered performance models
  786. starpu-print-model prints a given performance model
  787. starpu-mpi-print-ready-requests prints all MPI ready requests
  788. starpu-mpi-print-detached-requests prints all MPI detached requests
  789. starpu-mpi-print-early-data prints all MPI early received data
  790. starpu-mpi-print-early-requests prints all MPI early requests
  791. starpu-mpi-print-sync-data prints all MPI sync data
  792. end