Add more notebooks

This commit is contained in:
Anton Reinhard 2023-09-29 01:12:43 +02:00
parent bef017130b
commit afb6af44ca
5 changed files with 671 additions and 75 deletions

View File

@ -0,0 +1,512 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling MetagraphOptimization [3e869610-d48d-4942-ba70-c1b702a33ca4]\n"
]
}
],
"source": [
"using MetagraphOptimization"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Graph:\n",
" Nodes: Total: 438436, DataTask: 219223, ComputeTaskV: 109600, \n",
" ComputeTaskS2: 40320, ComputeTaskU: 10, ComputeTaskS1: 69272, \n",
" ComputeTaskSum: 1, ComputeTaskP: 10\n",
" Edges: 628665\n",
" Total Compute Effort: 1.903443e6\n",
" Total Data Transfer: 1.8040896e7\n",
" Total Compute Intensity: 0.10550712115407128\n"
]
}
],
"source": [
"model = ABCModel()\n",
"process_str = \"AB->ABBBBBBB\"\n",
"process = parse_process(process_str, model)\n",
"graph = parse_dag(\"../input/$process_str.txt\", model)\n",
"print(graph)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"206.818746 seconds (1.13 G allocations: 25.945 GiB, 1.23% gc time, 0.72% compilation time)\n",
"Graph:\n",
" Nodes: Total: 277188, DataTask: 138599, ComputeTaskV: 69288, \n",
" ComputeTaskS2: 40320, ComputeTaskU: 10, ComputeTaskS1: 28960, \n",
" ComputeTaskSum: 1, ComputeTaskP: 10\n",
" Edges: 427105\n",
" Total Compute Effort: 1.218139e6\n",
" Total Data Transfer: 1.2235968e7\n",
" Total Compute Intensity: 0.0995539543745129\n"
]
}
],
"source": [
"include(\"../examples/profiling_utilities.jl\")\n",
"@time reduce_all!(graph)\n",
"print(graph)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1386.777950 seconds (24.13 M allocations: 66.185 GiB, 0.07% gc time, 0.03% compilation time)\n"
]
},
{
"data": {
"text/plain": [
"compute_e9c23e52_5e4c_11ee_224d_b9f7f711223c (generic function with 1 method)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@time compute_AB_AB7 = get_compute_function(graph, process)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 1.159809 seconds (4.65 M allocations: 298.953 MiB, 4.16% gc time, 99.08% compilation time)\n"
]
},
{
"data": {
"text/plain": [
"1000-element Vector{ABCProcessInput}:\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [7.297067641509725, 0.0, 0.0, 7.228222199460134]\n",
" A: [7.297067641509725, 0.0, 0.0, -7.228222199460134]\n",
" 8 Outgoing Particles:\n",
" B: [-2.3282358998532704, 0.8697549848718326, -1.6874272456860027, 0.9037687548110497]\n",
" B: [-1.7950616727878386, 0.8822273108812799, -0.9310006383349131, 0.759709939692145]\n",
" B: [-1.4999933965661898, -0.1410505152180896, -0.18020186127033475, 1.0943547099060673]\n",
" B: [-1.6505811903918177, 0.06898822945305061, 0.35478584181328143, 1.2624523344352627]\n",
" B: [-2.250363292401255, -1.102848658096137, 1.2543457128140263, -1.128927197771245]\n",
" B: [-1.0311955832101127, 0.02455791968070782, 0.24479618364224273, 0.053254745208234165]\n",
" B: [-2.9296972047757364, -0.4927435564692796, 1.0617779854349016, -2.4925803916573215]\n",
" A: [-1.109007043033229, -0.10888571510336481, -0.11707597841320116, -0.4520328946241927]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [7.2752489342950835, 0.0, 0.0, 7.2061950470384675]\n",
" A: [7.2752489342950835, 0.0, 0.0, -7.2061950470384675]\n",
" 8 Outgoing Particles:\n",
" B: [-2.341240544236933, -1.3236357313665439, 0.021740644281282348, -1.6519452415303726]\n",
" B: [-1.409574549584365, 0.13284441484329915, 0.0677274275347828, -0.982174000796411]\n",
" B: [-1.7198571854145448, -0.4774725937733959, -1.2995148112825703, 0.2029529888288706]\n",
" B: [-1.6840881871344047, 0.7545923621161664, 0.30425245239330906, 1.0835930206005606]\n",
" B: [-1.3940699691284604, -0.36965634367010136, -0.41575032455869604, -0.7962015662127381]\n",
" B: [-1.3042076919847856, -0.10554015810915561, -0.020603525646097947, 0.8302978222237647]\n",
" B: [-1.4109035865905348, -0.16670738646793687, -0.12497976754909207, -0.9732613398540193]\n",
" A: [-3.2865561545161373, 1.5555754364276677, 1.467127904827082, 2.2867383167403457]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [7.128857222395858, 0.0, 0.0, 7.058371292111629]\n",
" A: [7.128857222395858, 0.0, 0.0, -7.058371292111629]\n",
" 8 Outgoing Particles:\n",
" B: [-2.2387424246810923, 0.48262787966516907, -0.478530009046727, -1.8841568417407861]\n",
" B: [-2.2717343568852035, 0.2996384006891893, 0.989278021242636, 1.758500160298914]\n",
" B: [-2.288863759829488, -1.5753138344367694, -1.219821878029321, -0.518958784465514]\n",
" B: [-1.1965198718885652, -0.2984623706568589, 0.2110440132874452, 0.5459308029243678]\n",
" B: [-2.0412048759971997, 0.18837892021850178, 1.7692472949269265, -0.028191090894204802]\n",
" B: [-1.3721244113162085, 0.2950214396168393, -0.8455472765311393, -0.284143543736317]\n",
" B: [-1.2477893857541948, 0.2726438292529436, 0.056169243894447725, -0.6924512326593468]\n",
" A: [-1.6007353584397659, 0.3354657356509847, -0.4818394097442683, 1.1034705302728862]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [8.78592784031683, 0.0, 0.0, 8.728833141677894]\n",
" A: [8.78592784031683, 0.0, 0.0, -8.728833141677894]\n",
" 8 Outgoing Particles:\n",
" B: [-1.8429190025140756, -0.40770268652495845, 1.0373915706018513, -1.0742195764703006]\n",
" B: [-2.8879658474972127, -0.5803475770010614, -0.8959912274618989, -2.4901291425326946]\n",
" B: [-1.0033260956881072, 0.05546077055534206, 0.013578489188090362, -0.058335082493447064]\n",
" B: [-2.9968390870332224, -0.34445049775738557, -0.5371717928927938, 2.752061923919073]\n",
" B: [-3.766379101966564, 2.696872869750841, 2.142546036476936, -1.149775954570847]\n",
" B: [-3.049520802930434, -1.4764668293139291, -1.5076342914468233, 1.9612908179805428]\n",
" B: [-1.003774074073095, -0.03977250933304866, -0.07672361964992376, 0.009696673164828737]\n",
" A: [-1.0211316689309478, 0.09640645962419972, -0.17599516481543767, 0.049410341002844305]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [8.59497818662335, 0.0, 0.0, 8.536606470286142]\n",
" A: [8.59497818662335, 0.0, 0.0, -8.536606470286142]\n",
" 8 Outgoing Particles:\n",
" B: [-3.303785350402493, 2.9869208397266744, -0.016309896710415835, 0.9965116788126053]\n",
" B: [-1.303397955397487, 0.6559366127496623, -0.005462599236040695, 0.5182311744756732]\n",
" B: [-2.0796796918405804, 1.5547015102448614, -0.6392026985987374, -0.7066758413873873]\n",
" B: [-2.2171836668721503, -1.5372142315994315, -1.2412749802108427, 0.11005563281983931]\n",
" B: [-1.543259767928983, -0.2880122636303726, 0.753326818085288, -0.8551013696984833]\n",
" B: [-1.4595311971726983, -0.9179460946165987, -0.12356532059864597, -0.5218600333842959]\n",
" B: [-3.6074103495762215, -2.765875098033572, 1.990067456375145, -0.6348038211794063]\n",
" A: [-1.6757083940560864, 0.3114887251587781, -0.71757877910575, 1.0936425795414546]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.669200844748512, 0.0, 0.0, 6.593803144437531]\n",
" A: [6.669200844748512, 0.0, 0.0, -6.593803144437531]\n",
" 8 Outgoing Particles:\n",
" B: [-1.18373226006521, 0.39371727970580117, -0.2632195982479301, 0.4206235969110058]\n",
" B: [-2.119478680160756, 1.408133215595378, 1.1321058108188813, 0.477165753070277]\n",
" B: [-1.329423150415496, 0.14179491242559344, -0.4771256592779384, 0.7208406349044663]\n",
" B: [-1.578609687871729, -1.0594661135121535, -0.24077990318805478, -0.5581802031447219]\n",
" B: [-1.7164578941688053, 0.44657264095470856, 0.8718727422362944, -0.9932967835196647]\n",
" B: [-2.11819827099359, -1.4795553845809009, -0.7048891282932129, -0.8948804925865415]\n",
" B: [-1.8709573462291487, -0.189927903614252, 0.3160649103701958, 1.5376968996750284]\n",
" A: [-1.4215443995922872, 0.33873135302582497, -0.6340291744182351, -0.7099694053098498]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.470903601313192, 0.0, 0.0, 5.378734629525949]\n",
" A: [5.470903601313192, 0.0, 0.0, -5.378734629525949]\n",
" 8 Outgoing Particles:\n",
" B: [-1.4021158374469955, -0.33713368996236237, 0.828716134884258, -0.40681600815915203]\n",
" B: [-1.1563583213717814, 0.4669713256040394, 0.28028271633519913, -0.20135527654653723]\n",
" B: [-1.680077997136158, 1.029883999585246, -0.8569453707516226, -0.16626982710854143]\n",
" B: [-1.0859502536933687, 0.22568458750125922, 0.32038573500001044, 0.16033527768267747]\n",
" B: [-1.134683686030051, -0.18046292205015352, -0.4386242234263053, 0.25009796426907194]\n",
" B: [-1.274458758726785, -0.7413070027812927, 0.20162414481851987, -0.18454473590171666]\n",
" B: [-1.7725632726477032, 0.11110106661695422, -1.0581457304680515, 1.004970010312917]\n",
" A: [-1.435599075573539, -0.5747373645136903, 0.7227065936079918, -0.4564174045487203]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.797477162545017, 0.0, 0.0, 5.710581533454454]\n",
" A: [5.797477162545017, 0.0, 0.0, -5.710581533454454]\n",
" 8 Outgoing Particles:\n",
" B: [-1.5450719004726667, 0.8517269263387147, -0.6575731998066975, -0.47896336757188956]\n",
" B: [-1.8681787383135382, 0.9239774620581589, 0.05662442628207056, 1.2779480123399205]\n",
" B: [-1.328069221534724, -0.42458851386081026, 0.31994691787104906, -0.6936327708738483]\n",
" B: [-1.06027071864171, 0.21126510016283465, 0.19859954153249007, -0.20024803710718375]\n",
" B: [-1.1831265177723247, 0.20108685767548962, -0.2946698611954912, 0.5220364983689306]\n",
" B: [-1.9417129471209476, -1.1911753540025534, 0.6799034923902431, -0.9429112821838329]\n",
" B: [-1.5809251620841955, -0.8166741148237361, -0.2861634729958438, 0.8663014631239887]\n",
" A: [-1.0875991191499284, 0.24438163645190153, -0.01666784407782057, -0.35053051609608543]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.1827176380704065, 0.0, 0.0, 5.085328122743516]\n",
" A: [5.1827176380704065, 0.0, 0.0, -5.085328122743516]\n",
" 8 Outgoing Particles:\n",
" B: [-1.9685088100342798, -0.3904041497416891, -1.5627655525026516, 0.5295048280782026]\n",
" B: [-1.030160361155713, -0.07535582463512125, 0.19063710907839407, -0.13859784281244267]\n",
" B: [-1.2219225483553735, 0.6840170034583941, 0.15631124179375314, -0.0279687119471718]\n",
" B: [-1.1507364218251361, -0.07738095134041947, 0.5640840339340665, 0.003962769894949415]\n",
" B: [-1.1688834731663604, -0.16423932962218155, 0.10659198850061305, -0.572671078747823]\n",
" B: [-1.3139731925816502, -0.28327679049052584, -0.3461643179576484, -0.7255687946470113]\n",
" B: [-1.3819957593386174, 0.4082395984907682, 0.40574756908515375, 0.7606718209816284]\n",
" A: [-1.1292547096836842, -0.10159955611922504, 0.4855579280683192, 0.17066700919966749]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.69426264881418, 0.0, 0.0, 5.60576730819968]\n",
" A: [5.69426264881418, 0.0, 0.0, -5.60576730819968]\n",
" 8 Outgoing Particles:\n",
" B: [-1.1686642377734457, 0.3119007269546548, 0.07983898811071112, -0.5119763404232704]\n",
" B: [-1.3698446786688139, 0.024422137551429482, -0.9336560540551144, -0.06453197347763913]\n",
" B: [-2.286375537440295, -0.7489461722148772, 1.3243906862302417, -1.3829613297401602]\n",
" B: [-1.2764203314056075, 0.19147075967274907, -0.6988385529595283, -0.3228195897298891]\n",
" B: [-1.1000453527174736, 0.3930525082621053, -0.18973683240054473, 0.14003370385298727]\n",
" B: [-1.3409037805805533, -0.6410325458506799, 0.15263734740708942, 0.6031600650838413]\n",
" B: [-1.3933443408324893, 0.4598121590148031, 0.6478969707730007, 0.556965659457779]\n",
" A: [-1.452927038209682, 0.009320426609815335, -0.3825325531058559, 0.9821298049763512]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.367432685308519, 0.0, 0.0, 6.288417845685452]\n",
" A: [6.367432685308519, 0.0, 0.0, -6.288417845685452]\n",
" 8 Outgoing Particles:\n",
" B: [-1.390267258638053, 0.6275324547731649, 0.20451880141536874, 0.7051369572749351]\n",
" B: [-1.9039437559086116, 0.4510910335703079, -0.6590504847861329, -1.4096705869099437]\n",
" B: [-1.1853333708320322, 0.3254579737444668, 0.33076168516541243, -0.4355330239611121]\n",
" B: [-1.125369006990044, -0.11551337227603503, -0.5030416237325495, 0.007822244671168007]\n",
" B: [-1.1460227184362763, -0.5367962179605811, -0.1365607258769146, 0.08104973598513128]\n",
" B: [-2.7512633229570334, -1.6948481597767724, 1.5466514102511044, 1.1422823655813548]\n",
" B: [-1.5749940303967573, -0.15965379863878912, -1.0544249772390906, 0.5859222028050912]\n",
" A: [-1.657671906458233, 1.102730086564237, 0.27114591480280403, -0.6770098954466284]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.936871910217603, 0.0, 0.0, 5.85204648634397]\n",
" A: [5.936871910217603, 0.0, 0.0, -5.85204648634397]\n",
" 8 Outgoing Particles:\n",
" B: [-1.1977447908071144, -0.5208843383505731, -0.29466892923692334, 0.2764820285462133]\n",
" B: [-1.4339638808744681, 0.17353187662173764, 0.9292299695494735, 0.4033246374073723]\n",
" B: [-1.0481012050053067, 0.19708368984168353, -0.24156408393499315, -0.03634485499504191]\n",
" B: [-2.2241539774877466, 1.0115406169999834, -1.0380370787420174, 1.3587220167829017]\n",
" B: [-1.0522861512714377, -0.1902262203963507, 0.1279208048019239, -0.23400084813992042]\n",
" B: [-2.3818245359738817, -0.4952353098736381, 0.6157891811369108, -2.0121217141157963]\n",
" B: [-1.1852543863662754, 0.5457506201424419, 0.2954807101179548, -0.14026892372448407]\n",
" A: [-1.3504148926489736, -0.7215609349852846, -0.39415057369232925, 0.38420765823875563]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [9.852912437162026, 0.0, 0.0, 9.802034660945763]\n",
" A: [9.852912437162026, 0.0, 0.0, -9.802034660945763]\n",
" 8 Outgoing Particles:\n",
" B: [-4.3217547214772, 0.3006617090826956, 0.30060056695047277, 4.182918324382032]\n",
" B: [-1.8398073471556307, 0.7372918490442457, -1.235374697300333, 0.5613743503677984]\n",
" B: [-1.8743147864753342, -0.732045557595005, -0.9521643334086932, -1.0346730413951422]\n",
" B: [-1.3953205341341666, 0.4336744412700569, -0.46004135572480787, -0.7397349680719717]\n",
" B: [-1.950304091083263, 0.8965289321581407, 1.0137006195122968, -0.9860694577461983]\n",
" B: [-2.6005709642066717, 2.0489705793122135, 0.5748540328357682, -1.1109598309211022]\n",
" B: [-2.3750535744184678, -0.8155704501301804, -0.0947720055798232, -1.9916682929621512]\n",
" A: [-3.3486988553733195, -2.869511503142167, 0.8531971727151203, 1.1188129163467355]\n",
"\n",
" ⋮\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.1272054195735475, 0.0, 0.0, 5.028740937302731]\n",
" A: [5.1272054195735475, 0.0, 0.0, -5.028740937302731]\n",
" 8 Outgoing Particles:\n",
" B: [-1.2759132086369238, 0.7088484304225325, -0.29887603116913986, -0.19016186961182752]\n",
" B: [-1.1779522775983573, 0.41803841905140154, -0.45675251170539183, -0.06475022430060037]\n",
" B: [-1.1481761366626901, -0.4437023136420629, 0.34830654963136826, -0.010919942959201066]\n",
" B: [-1.4379810868005531, -0.6351701874948475, -0.059163905195223354, 0.8129256246643419]\n",
" B: [-1.3828873393138725, -0.8812833033405845, 0.23611519283598345, -0.2827839249316266]\n",
" B: [-1.33376143924824, 0.4383405825580403, 0.7637478896663866, -0.058875050219558064]\n",
" B: [-1.278378917935277, -0.007026488522286364, -0.31396565194856196, -0.7318666925587813]\n",
" A: [-1.219360432951181, 0.4019548609678069, -0.21941153211542153, 0.5264320799172535]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [7.6029796810241095, 0.0, 0.0, 7.536929084850505]\n",
" A: [7.6029796810241095, 0.0, 0.0, -7.536929084850505]\n",
" 8 Outgoing Particles:\n",
" B: [-2.495625599363338, 0.17195331697679445, -1.421295024808554, 1.7828347207278505]\n",
" B: [-2.3247770827115106, -0.4842961856772881, 1.5916928687740521, -1.2792808527969537]\n",
" B: [-1.6004875132645686, -0.7246443707991035, -0.6287268529374866, -0.8007205257643256]\n",
" B: [-2.2935495836704267, 1.6828759072541282, -0.6216953077311024, 1.020682770445115]\n",
" B: [-1.6841223705419472, -0.15136722397138147, -1.088694434115097, -0.7925279500395149]\n",
" B: [-1.7610877078517306, 0.6608553615709418, 1.0261342048695203, -0.7821436565147093]\n",
" B: [-1.0851670972782637, 0.17258442918121256, 0.3025146696084896, 0.23724906425778386]\n",
" A: [-1.9611424073664336, -1.3279612345353033, 0.8400698763401785, 0.6139064296847537]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.992590856163222, 0.0, 0.0, 6.920717223069984]\n",
" A: [6.992590856163222, 0.0, 0.0, -6.920717223069984]\n",
" 8 Outgoing Particles:\n",
" B: [-2.822980650932899, -2.564595508900629, -0.09432122198604756, -0.619009804729552]\n",
" B: [-1.0974277084261912, 0.017540537657498946, -0.231887659602663, -0.3876441900560964]\n",
" B: [-1.1239874528072817, -0.4945185041136732, -0.09310437746946441, -0.10065196497535307]\n",
" B: [-2.1713139360453084, 1.8206777932997238, 0.006028027938971819, 0.6322185102707673]\n",
" B: [-2.723748045321534, 0.7655804205481372, -1.9920897904718349, 1.3653821079698159]\n",
" B: [-1.1799610763673014, 0.09222483207708872, 0.5878213304380843, -0.19562414363322736]\n",
" B: [-1.3511131845747593, -0.0920425289119762, 0.8345532514223162, -0.34721157950689996]\n",
" A: [-1.5146496578511677, 0.4551329583438295, 0.9830004397306376, -0.3474589353394537]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.147153446646183, 0.0, 0.0, 6.065269614503055]\n",
" A: [6.147153446646183, 0.0, 0.0, -6.065269614503055]\n",
" 8 Outgoing Particles:\n",
" B: [-1.016188912560254, -0.13697636540681832, 0.11748833306507175, 0.008594935946244903]\n",
" B: [-1.1360093083664402, -0.5079347349092443, -0.17963659939393273, -0.01581600221476525]\n",
" B: [-1.7092824014796542, -0.7891675791008793, -0.7223044431106161, 0.8815538279462988]\n",
" B: [-1.9192700349186136, 0.1237305478301286, -1.0851075251029303, -1.2209954452966416]\n",
" B: [-1.469286709386631, -0.2635598190385343, 1.0027221080818196, 0.28963430413630475]\n",
" B: [-1.5088265360380027, -0.732569485372415, -0.8401661674887627, 0.18444586186975667]\n",
" B: [-2.0179299753278324, 1.5035832195688477, 0.899191457478353, -0.052283935922221136]\n",
" A: [-1.5175130152149356, 0.8028942164289148, 0.8078128364709978, -0.07513354646497722]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [8.476921541840353, 0.0, 0.0, 8.417731216100751]\n",
" A: [8.476921541840353, 0.0, 0.0, -8.417731216100751]\n",
" 8 Outgoing Particles:\n",
" B: [-1.7538473485555315, -0.9965865865820887, -1.0269887958877189, 0.16759985262828772]\n",
" B: [-2.2424706680343123, 1.5336690696555233, -0.12788621971414102, -1.2884793349462171]\n",
" B: [-1.9516293942416962, -0.332998801919277, -1.6407841791068538, 0.07613388195268905]\n",
" B: [-2.859281760370176, 2.5141699034195697, 0.7891164012469956, 0.48139088816449227]\n",
" B: [-1.305183288774148, -0.38321818731386625, -0.02282033150337396, -0.7457388756644321]\n",
" B: [-1.8024514296684413, 0.16127952536927562, 1.0125217007678309, -1.0943582030051626]\n",
" B: [-2.659766637628699, -2.4121666849276377, 0.3691192808476085, 0.3457765279402697]\n",
" A: [-2.3792125564077033, -0.0841482377014984, 0.647722143349652, 2.057675262930073]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [8.624646884670907, 0.0, 0.0, 8.56647733232649]\n",
" A: [8.624646884670907, 0.0, 0.0, -8.56647733232649]\n",
" 8 Outgoing Particles:\n",
" B: [-3.867443674456446, 2.055526777157907, 3.030742490685273, 0.7392768078567271]\n",
" B: [-1.7934878303680706, -0.5000733363648106, -1.0116698419390304, -0.9711072993477046]\n",
" B: [-2.6128053379450074, -1.4077167277359781, -1.5035505333762953, 1.258737916339256]\n",
" B: [-2.5295672204001716, 0.6495125229101625, 2.0471142470161805, 0.886660625475892]\n",
" B: [-1.5638606530033585, -0.08397443970070877, -0.6384907390237163, -1.01535117652465]\n",
" B: [-1.398281438823116, -0.46529071643315806, -0.009094789780325336, -0.8594258642589327]\n",
" B: [-1.8357084823189076, 0.46249283401972147, -1.1869685935882734, -0.864309879830763]\n",
" A: [-1.6481391320267396, -0.7104769138531365, -0.7280822399938128, 0.8255188702901759]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.001252847065808, 0.0, 0.0, 4.9002581605752]\n",
" A: [5.001252847065808, 0.0, 0.0, -4.9002581605752]\n",
" 8 Outgoing Particles:\n",
" B: [-1.2253065319501055, 0.5822781598199206, 0.3314418067646216, -0.22907328644982872]\n",
" B: [-1.0786346171567884, 0.1820904562535535, 0.3604976786746933, 0.018361011423713165]\n",
" B: [-1.443011976427815, -0.8651359890021318, -0.2856682661617125, 0.502212033264408]\n",
" B: [-1.173769929336385, -0.5289514976498968, 0.2948922549388864, 0.10480800601734341]\n",
" B: [-1.4017613372429005, 0.6451966342855364, 0.06876704973583925, -0.7375142321109804]\n",
" B: [-1.023640220772291, 0.022027108004137586, -0.10056103790303386, -0.19298079114664024]\n",
" B: [-1.3049794561819603, 0.7202426203017741, -0.18998374147348418, 0.38487417026027565]\n",
" A: [-1.3514016250633702, -0.7577474920128907, -0.4793857445758094, 0.1493130887417088]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [8.96392902704659, 0.0, 0.0, 8.907975280720553]\n",
" A: [8.96392902704659, 0.0, 0.0, -8.907975280720553]\n",
" 8 Outgoing Particles:\n",
" B: [-2.3893793434010293, -0.14541908941249562, 1.1744750611669779, -1.8189544430256628]\n",
" B: [-2.0802027977001645, 1.683798894576558, 0.41465308743706897, 0.5657983556544335]\n",
" B: [-2.8021551416275847, -0.8730063299537363, 0.6172249959287677, 2.3893444059011983]\n",
" B: [-1.282870124595495, -0.1317177386142356, -0.27025705867504474, -0.7452297069698219]\n",
" B: [-1.8960716643333162, -0.7036305697937141, 1.4218891176648742, 0.27968395485921654]\n",
" B: [-1.0488989026854814, -0.26010877348210254, 0.17797714106142565, 0.02926553044188003]\n",
" B: [-2.389710780404753, -0.7265445366908958, -0.8235444674133567, 1.8720644113865725]\n",
" A: [-4.038569299345353, 1.1566281433706218, -2.7124178771707133, -2.5719725082478164]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [9.51582153132561, 0.0, 0.0, 9.463131586110388]\n",
" A: [9.51582153132561, 0.0, 0.0, -9.463131586110388]\n",
" 8 Outgoing Particles:\n",
" B: [-2.198860075158402, -0.42521433364826555, 0.002989971532631837, -1.9115882037342424]\n",
" B: [-3.164412600828866, -2.892224355353346, 0.7367385818980625, 0.32521016055507507]\n",
" B: [-2.3813179922199987, -0.506545178582416, 0.7108442645181019, 1.9770654500363183]\n",
" B: [-1.9538700209386655, -0.8618707380363797, 1.186000681720045, -0.8174284510579963]\n",
" B: [-3.371884539662021, 2.8395690061431638, 1.4581158121389344, -0.42467809756720504]\n",
" B: [-2.6593380883580546, 0.8931649323333468, -2.091082202154905, 0.9495844858004108]\n",
" B: [-1.1300723243009745, -0.16527807657001936, -0.4394099238200392, -0.2380452360472458]\n",
" A: [-2.1718874211842363, 1.1183987437139151, -1.5641971858328316, 0.13987989201488576]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.357743380256554, 0.0, 0.0, 6.278606604111778]\n",
" A: [6.357743380256554, 0.0, 0.0, -6.278606604111778]\n",
" 8 Outgoing Particles:\n",
" B: [-1.4137331879075177, -0.233323462534503, -0.48124156481430536, 0.8441612670083491]\n",
" B: [-2.6870961992411644, 2.4029040091317038, 0.5082900029119076, -0.43379670332415793]\n",
" B: [-1.4075987059037833, -0.39813856207735293, 0.8806743446562326, 0.21733039574182572]\n",
" B: [-1.952172579900526, -0.5278337652432512, 0.07149668911634006, -1.5897350475566703]\n",
" B: [-1.2349347923179552, 0.04506793000664283, -0.5214490376206476, -0.5011224642009255]\n",
" B: [-1.1165758258836163, 0.02086820074549926, -0.43701016167280243, 0.23521949693857516]\n",
" B: [-1.2905637143198243, -0.6819933176862016, -0.4018578571749612, 0.19735774111267287]\n",
" A: [-1.612811755038721, -0.627551032342536, 0.3810975845982358, 1.0305853142803303]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [6.130345720289975, 0.0, 0.0, 6.048234341547756]\n",
" A: [6.130345720289975, 0.0, 0.0, -6.048234341547756]\n",
" 8 Outgoing Particles:\n",
" B: [-1.4326072521483875, -0.2772762950504434, -0.24466877320483055, 0.956879609214083]\n",
" B: [-1.5776360936332103, -0.2583249349585627, -0.4255133253556846, 1.1140656541953249]\n",
" B: [-1.0147620530760844, 0.13949346024875797, -0.08328820868034556, 0.05785043825103748]\n",
" B: [-1.293580660025528, 0.6852335955973128, 0.3975970785880869, 0.21382798356407548]\n",
" B: [-1.2976287195107719, 0.15887464753799807, 0.782036259346533, -0.21683733335411753]\n",
" B: [-1.7761624248601753, 0.7276287341291825, -1.2726314820020064, -0.07562073638968408]\n",
" B: [-2.590056806381479, -0.3973282137195602, 0.9895073267790887, -2.1380832072480156]\n",
" A: [-1.2782574309443122, -0.7783009937846852, -0.1430388754708429, 0.08791759176729656]\n",
"\n",
" Input for ABC Process: 'AB->ABBBBBBB':\n",
" 2 Ingoing particles:\n",
" B: [5.614031384111412, 0.0, 0.0, 5.524250933998916]\n",
" A: [5.614031384111412, 0.0, 0.0, -5.524250933998916]\n",
" 8 Outgoing Particles:\n",
" B: [-1.1975327132078701, -0.1893270691431532, 0.6301793280237195, 0.03337476028738165]\n",
" B: [-1.8780203352470435, 0.3804442998242718, -0.6924590977588293, 1.3793922256789994]\n",
" B: [-2.0692007193909774, -1.0383662307089536, 1.010356939895161, -1.0874585242928134]\n",
" B: [-1.1162504316135156, 0.02668980907078698, -0.42171590435133693, 0.25972750371544917]\n",
" B: [-1.0629241444846567, -0.12121334536781084, 0.29190610487423235, 0.17293318874737984]\n",
" B: [-1.0164452123103798, 0.1408149996539992, 0.012518491824283254, -0.11478367855920323]\n",
" B: [-1.4812661461667407, 0.7469275648138908, 0.14658769496490245, -0.7840667423030614]\n",
" A: [-1.4064230658016392, 0.05402997185696898, -0.9773735574721323, 0.14088126672586804]\n"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@time inputs = [gen_process_input(process) for _ in 1:1000]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"using BenchmarkTools\n",
"@benchmark compute_AB_AB7.(inputs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.3",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 1,
"id": "20768e45-df62-4638-ba33-b0ccf239f1aa",
"metadata": {},
"outputs": [],
@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 2,
"id": "9df482a4-ca44-44c5-9ea7-7a2977d529be",
"metadata": {},
"outputs": [
@ -24,8 +24,9 @@
"ABCModel()"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -35,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 3,
"id": "30b16872-07f7-4d47-8ff8-8c3a849c9d4e",
"metadata": {},
"outputs": [
@ -45,8 +46,9 @@
"ABC Process: 'AB->ABBB'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -57,10 +59,17 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 4,
"id": "043bd9e2-f89a-4362-885a-8c89d4cdd76f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total: 280, ComputeTaskS2"
]
},
{
"data": {
"text/plain": [
@ -72,14 +81,15 @@
" Total Compute Intensity: 0.09822733918128655\n"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total: 280, ComputeTaskS2: 24, DataTask: 143, \n",
": 24, DataTask: 143, \n",
" ComputeTaskU: 6, ComputeTaskSum: 1, ComputeTaskS1: 36, \n",
" ComputeTaskV: 64, ComputeTaskP: 6"
]
@ -92,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 5,
"id": "02f01ad3-fd10-48d5-a0e0-c03dc83c80a4",
"metadata": {},
"outputs": [
@ -101,17 +111,18 @@
"text/plain": [
"Input for ABC Process: 'AB->ABBB':\n",
" Input particles:\n",
" A: [3.1643943055419363, 0.0, 0.0, 3.002231057221651]\n",
" B: [3.1643943055419363, 0.0, 0.0, -3.002231057221651]\n",
" A: [5.77986599979293, 0.0, 0.0, 5.692701553354288]\n",
" B: [5.77986599979293, 0.0, 0.0, -5.692701553354288]\n",
" Output Particles:\n",
" A: [-2.256745792111763, -1.8187612014283614, 0.7623781267848754, -0.45142978877450474]\n",
" B: [-1.2010630585601612, 0.48677829051626326, -0.3095511190586244, -0.33132683442411753]\n",
" B: [-1.851230645629639, 1.2170428203792298, -0.6136921618583376, 0.7544823438327369]\n",
" B: [-1.0197491147823097, 0.11494009053286842, 0.16086515413208705, 0.02827427936588541]\n"
" A: [-3.8835293143673746, -1.4292027910861678, 2.8576090179942106, 1.968057422378813]\n",
" B: [-1.1554024905063585, -0.1464656500147254, -0.2082400426692148, 0.5197487980391896]\n",
" B: [-2.849749730594798, -1.0177034035100576, -2.464951858896686, -0.09677625137882176]\n",
" B: [-3.6710504641173287, 2.5933718446109513, -0.1844171164283155, -2.391029969039186]\n"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -121,18 +132,19 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 6,
"id": "083fb1be-ce2a-47f9-afb9-60a6fdfaed0b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"compute_ca11d460_5e25_11ee_14ab_5ddab1542812 (generic function with 1 method)"
"compute_2f2a5dca_5e3a_11ee_3973_bfa5c42acee3 (generic function with 1 method)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -142,18 +154,19 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 7,
"id": "a40c9500-8f79-4f04-b3c5-59b72a6b7ba9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-2.133138322948753e-12"
"-1.8924431710735022e-13"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -163,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 8,
"id": "80c70010",
"metadata": {},
"outputs": [],
@ -176,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 9,
"id": "5b192b44",
"metadata": {},
"outputs": [],
@ -187,7 +200,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 10,
"id": "9b2f4a3f",
"metadata": {},
"outputs": [
@ -195,30 +208,37 @@
"data": {
"text/plain": [
"1000-element Vector{Float64}:\n",
" -4.414620594828263e-10\n",
" -6.52806527801196e-13\n",
" -1.697445561359304e-14\n",
" -3.0968989470125384e-10\n",
" -4.502627629291429e-15\n",
" -1.5151443298524234e-12\n",
" -4.6735707896483893e-11\n",
" -4.39957245807686e-12\n",
" -4.9303667114098105e-12\n",
" -7.978610716067286e-12\n",
" -2.1491995259940396e-11\n",
" -1.04995646459455e-11\n",
" 5.8217606911879465e-15\n",
" -6.556969485683647e-14\n",
" -1.3588086164373804e-14\n",
" -1.8789662441593714e-13\n",
" -2.1319733018358848e-13\n",
" -5.335975907200479e-12\n",
" -9.053914191490206e-13\n",
" -5.611079017069238e-13\n",
" -5.063492275603427e-11\n",
" 2.9168508985810955e-15\n",
" -1.6420151378194154e-13\n",
" ⋮\n",
" -3.274950681363404e-15\n",
" 3.720176763468205e-14\n",
" -1.6979650967920612e-16\n",
" -1.2110610922665538e-11\n",
" -3.488772363060999e-13\n",
" -7.743825512592736e-12\n",
" -1.1887405783378775e-11\n",
" -1.7657864496526309e-13\n",
" -8.099730579187646e-12"
" 1.0931677247833414e-13\n",
" -7.704755306464438e-16\n",
" -1.8385907037491413e-12\n",
" -6.036215596560112e-14\n",
" -9.988724014003618e-12\n",
" 3.4861755637292744e-13\n",
" -1.1051119822969222e-10\n",
" -2.4965725132161986e-12\n",
" -3.868242784720193e-11\n",
" 7.904149696653533e-15\n",
" -7.606811743178718e-11\n",
" -5.100594937480289e-13"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -231,27 +251,28 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 11,
"id": "d43e4ff0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"BenchmarkTools.Trial: 1338 samples with 1 evaluation.\n",
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m2.718 ms\u001b[22m\u001b[39m … \u001b[35m7.994 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.00% … 32.43%\n",
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m3.007 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m0.00%\n",
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m3.736 ms\u001b[22m\u001b[39m ± \u001b[32m1.156 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m5.92% ± 11.07%\n",
"BenchmarkTools.Trial: 1453 samples with 1 evaluation.\n",
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m2.596 ms\u001b[22m\u001b[39m … \u001b[35m6.983 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.00% … 27.07%\n",
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m2.715 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m0.00%\n",
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m3.443 ms\u001b[22m\u001b[39m ± \u001b[32m1.068 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m4.39% ± 8.86%\n",
"\n",
" \u001b[39m█\u001b[39m█\u001b[39m▃\u001b[39m▂\u001b[34m▂\u001b[39m\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m▁\u001b[39m \u001b[39m▁\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m▂\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m▁\u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▃\u001b[39m▃\u001b[39m▄\u001b[39m▂\u001b[39m▂\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
" \u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[39m▆\u001b[39m█\u001b[32m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▆\u001b[39m▅\u001b[39m▁\u001b[39m▅\u001b[39m▄\u001b[39m▅\u001b[39m▄\u001b[39m▄\u001b[39m▁\u001b[39m▅\u001b[39m▄\u001b[39m▅\u001b[39m▅\u001b[39m▅\u001b[39m▄\u001b[39m▆\u001b[39m▁\u001b[39m▄\u001b[39m▆\u001b[39m▇\u001b[39m \u001b[39m█\n",
" 2.72 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 7.16 ms \u001b[0m\u001b[1m<\u001b[22m\n",
" \u001b[39m▇\u001b[39m█\u001b[34m▃\u001b[39m\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m▂\u001b[39m▃\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m▃\u001b[39m▂\u001b[39m▃\u001b[39m▂\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
" \u001b[39m█\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[39m▆\u001b[39m▆\u001b[39m▆\u001b[39m▆\u001b[39m▅\u001b[39m▆\u001b[39m▇\u001b[32m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▆\u001b[39m▇\u001b[39m█\u001b[39m▇\u001b[39m▅\u001b[39m▇\u001b[39m▆\u001b[39m▇\u001b[39m▆\u001b[39m▅\u001b[39m▇\u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▅\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▅\u001b[39m▆\u001b[39m▆\u001b[39m▆\u001b[39m \u001b[39m█\n",
" 2.6 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 6.44 ms \u001b[0m\u001b[1m<\u001b[22m\n",
"\n",
" Memory estimate\u001b[90m: \u001b[39m\u001b[33m6.17 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m143004\u001b[39m."
]
},
"execution_count": 11,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
@ -260,40 +281,33 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 12,
"id": "e18d9546",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"BenchmarkTools.Trial: 1739 samples with 1 evaluation.\n",
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m2.178 ms\u001b[22m\u001b[39m … \u001b[35m 6.643 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.00% … 37.05%\n",
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m2.291 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m0.00%\n",
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m2.873 ms\u001b[22m\u001b[39m ± \u001b[32m902.626 μs\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m6.58% ± 12.21%\n",
"BenchmarkTools.Trial: 1890 samples with 1 evaluation.\n",
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m2.007 ms\u001b[22m\u001b[39m … \u001b[35m 5.588 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.00% … 29.53%\n",
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m2.086 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m0.00%\n",
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m2.644 ms\u001b[22m\u001b[39m ± \u001b[32m840.095 μs\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m5.18% ± 10.46%\n",
"\n",
" \u001b[39m█\u001b[39m▇\u001b[34m▄\u001b[39m\u001b[39m▂\u001b[39m▂\u001b[39m▂\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▂\u001b[39m▂\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
" \u001b[39m█\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[32m█\u001b[39m\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[39m▅\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▅\u001b[39m▆\u001b[39m▆\u001b[39m▁\u001b[39m▁\u001b[39m▄\u001b[39m▅\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▄\u001b[39m▆\u001b[39m▅\u001b[39m▁\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▅\u001b[39m▄\u001b[39m▆\u001b[39m \u001b[39m█\n",
" 2.18 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 5.97 ms \u001b[0m\u001b[1m<\u001b[22m\n",
" \u001b[39m█\u001b[34m▇\u001b[39m\u001b[39m▃\u001b[39m▁\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▃\u001b[39m▃\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m▂\u001b[39m▃\u001b[39m▃\u001b[39m▂\u001b[39m▂\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
" \u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▆\u001b[39m▇\u001b[39m▇\u001b[32m▅\u001b[39m\u001b[39m▆\u001b[39m▆\u001b[39m▇\u001b[39m▆\u001b[39m▇\u001b[39m▇\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m▄\u001b[39m▇\u001b[39m▆\u001b[39m▇\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▅\u001b[39m▄\u001b[39m▆\u001b[39m▆\u001b[39m▅\u001b[39m▅\u001b[39m▆\u001b[39m \u001b[39m█\n",
" 2.01 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 5.32 ms \u001b[0m\u001b[1m<\u001b[22m\n",
"\n",
" Memory estimate\u001b[90m: \u001b[39m\u001b[33m5.26 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m123004\u001b[39m."
]
},
"execution_count": 12,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
"@benchmark results = AB_AB3_reduced_compute.($inputs)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "8bc5dece",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {

70
notebooks/profiling.ipynb Normal file
View File

@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"using Revise; using MetagraphOptimization; using BenchmarkTools; using ProfileView\n",
"using Base.Threads\n",
"nthreads()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model = ABCModel()\n",
"process_str = \"AB->ABBBBB\"\n",
"process = parse_process(process_str, model)\n",
"graph = parse_dag(\"../input/$process_str.txt\", model)\n",
"print(graph)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"include(\"../examples/profiling_utilities.jl\")\n",
"@ProfileView.profview reduce_all!(graph)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"@ProfileView.profview comp_func = get_compute_function(graph, process)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.3",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.3"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@ -36,11 +36,11 @@ Pretty print an [`ABCProcessInput`](@ref) (with newlines).
"""
function show(io::IO, processInput::ABCProcessInput)
println(io, "Input for $(processInput.process):")
println(io, " Input particles:")
println(io, " $(length(processInput.inParticles)) Incoming particles:")
for particle in processInput.inParticles
println(io, " $particle")
end
println(io, " Output Particles:")
println(io, " $(length(processInput.outParticles)) Outgoing Particles:")
for particle in processInput.outParticles
println(io, " $particle")
end

View File

@ -68,13 +68,13 @@ function types end
in_particles(::AbstractProcessDescription)
Interface function that must be implemented for every subtype of [`AbstractProcessDescription`](@ref).
Returns a `<: Dict{Type{AbstractParticle}, Int}` object, representing the number of ingoing particles for the process per particle type.
Returns a `<: Dict{Type{AbstractParticle}, Int}` object, representing the number of incoming particles for the process per particle type.
in_particles(::AbstractProcessInput)
Interface function that must be implemented for every subtype of [`AbstractProcessInput`](@ref).
Returns a `<: Vector{AbstractParticle}` object with the values of all ingoing particles for the corresponding `ProcessDescription`.
Returns a `<: Vector{AbstractParticle}` object with the values of all incoming particles for the corresponding `ProcessDescription`.
"""
function in_particles end