gdbinit 35 KB

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