gdbinit 36 KB

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