Skip to content

Commit 8d48481

Browse files
authored
Merge pull request #492 from minrk/send-recv-files
add ControllerLauncher.get_connection_info()
2 parents bc375ae + cfa79ca commit 8d48481

File tree

5 files changed

+194
-153
lines changed

5 files changed

+194
-153
lines changed

examples/Cluster API.ipynb

Lines changed: 49 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{
4040
"data": {
4141
"text/plain": [
42-
"<Cluster(cluster_id='touchy-1623263478-xhlt', profile_dir='~/.ipython/profile_default')>"
42+
"<Cluster(cluster_id='touchy-1623757384-cpbt', profile='default')>"
4343
]
4444
},
4545
"execution_count": 1,
@@ -71,7 +71,7 @@
7171
{
7272
"data": {
7373
"text/plain": [
74-
"<Cluster(cluster_id='touchy-1623263478-xhlt', profile_dir='~/.ipython/profile_default', controller=<running>)>"
74+
"<Cluster(cluster_id='touchy-1623757384-cpbt', profile='default', controller=<running>)>"
7575
]
7676
},
7777
"execution_count": 2,
@@ -100,7 +100,7 @@
100100
{
101101
"data": {
102102
"text/plain": [
103-
"<Cluster(cluster_id='touchy-1623263478-xhlt', profile_dir='~/.ipython/profile_default', controller=<running>, engine_sets=['1623263481-w75s'])>"
103+
"<Cluster(cluster_id='touchy-1623757384-cpbt', profile='default', controller=<running>, engine_sets=['1623757384-b3pm'])>"
104104
]
105105
},
106106
"execution_count": 3,
@@ -138,7 +138,7 @@
138138
{
139139
"data": {
140140
"text/plain": [
141-
"'1623263483-iafz'"
141+
"'1623757385-pe8h'"
142142
]
143143
},
144144
"execution_count": 4,
@@ -185,7 +185,7 @@
185185
}
186186
],
187187
"source": [
188-
"rc = cluster.connect_client()\n",
188+
"rc = await cluster.connect_client()\n",
189189
"rc.wait_for_engines(6)\n",
190190
"rc.ids"
191191
]
@@ -207,12 +207,12 @@
207207
{
208208
"data": {
209209
"text/plain": [
210-
"{0: {'host': 'touchy', 'pid': 81944},\n",
211-
" 1: {'host': 'touchy', 'pid': 81945},\n",
212-
" 2: {'host': 'touchy', 'pid': 81946},\n",
213-
" 3: {'host': 'touchy', 'pid': 81947},\n",
214-
" 4: {'host': 'touchy', 'pid': 81952},\n",
215-
" 5: {'host': 'touchy', 'pid': 81953}}"
210+
"{0: {'host': 'touchy', 'pid': 24774},\n",
211+
" 1: {'host': 'touchy', 'pid': 24775},\n",
212+
" 2: {'host': 'touchy', 'pid': 24776},\n",
213+
" 3: {'host': 'touchy', 'pid': 24762},\n",
214+
" 4: {'host': 'touchy', 'pid': 24769},\n",
215+
" 5: {'host': 'touchy', 'pid': 24773}}"
216216
]
217217
},
218218
"execution_count": 6,
@@ -264,8 +264,8 @@
264264
"name": "stdout",
265265
"output_type": "stream",
266266
"text": [
267-
"Sending signal 2 to engine(s) 1623263481-w75s\n",
268-
"Sending signal 2 to engine(s) 1623263483-iafz\n"
267+
"Sending signal 2 to engine(s) 1623757384-b3pm\n",
268+
"Sending signal 2 to engine(s) 1623757385-pe8h\n"
269269
]
270270
},
271271
{
@@ -320,7 +320,7 @@
320320
"name": "stdout",
321321
"output_type": "stream",
322322
"text": [
323-
"Stopping engine(s): 1623263483-iafz\n"
323+
"Stopping engine(s): 1623757385-pe8h\n"
324324
]
325325
}
326326
],
@@ -346,9 +346,9 @@
346346
"name": "stdout",
347347
"output_type": "stream",
348348
"text": [
349-
"Stopping engine(s): 1623263481-w75s\n",
349+
"Stopping engine(s): 1623757384-b3pm\n",
350350
"Stopping controller\n",
351-
"Controller stopped: {'exit_code': 0, 'pid': 81906}\n"
351+
"Controller stopped: {'exit_code': 0, 'pid': 24758}\n"
352352
]
353353
}
354354
],
@@ -386,27 +386,19 @@
386386
"output_type": "stream",
387387
"text": [
388388
"Starting 4 engines with <class 'ipyparallel.cluster.launcher.LocalEngineSetLauncher'>\n",
389-
"Waiting for connection file: ~/.ipython/profile_default/security/ipcontroller-touchy-1623263508-mdel-client.json\n",
390-
"Stopping engine(s): 1623263508-5i4g\n",
389+
"Stopping engine(s): 1623757397-ng0s\n",
391390
"Stopping controller\n"
392391
]
393392
},
394393
{
395394
"data": {
396395
"text/plain": [
397-
"{0: 82284, 1: 82282, 2: 82283, 3: 82285}"
396+
"{0: 24989, 1: 24991, 2: 24990, 3: 24992}"
398397
]
399398
},
400399
"execution_count": 11,
401400
"metadata": {},
402401
"output_type": "execute_result"
403-
},
404-
{
405-
"name": "stdout",
406-
"output_type": "stream",
407-
"text": [
408-
"Controller stopped: {'exit_code': 0, 'pid': 82281}\n"
409-
]
410402
}
411403
],
412404
"source": [
@@ -436,27 +428,20 @@
436428
"output_type": "stream",
437429
"text": [
438430
"Starting 2 engines with <class 'ipyparallel.cluster.launcher.LocalEngineSetLauncher'>\n",
439-
"Waiting for connection file: ~/.ipython/profile_default/security/ipcontroller-touchy-1623263514-nqk6-client.json\n",
440-
"Stopping engine(s): 1623263514-b9f9\n",
431+
"Controller stopped: {'exit_code': 0, 'pid': 24988}\n",
432+
"Stopping engine(s): 1623757400-5fq1\n",
441433
"Stopping controller\n"
442434
]
443435
},
444436
{
445437
"data": {
446438
"text/plain": [
447-
"{0: 82407, 1: 82408}"
439+
"{0: 25058, 1: 25059}"
448440
]
449441
},
450442
"execution_count": 12,
451443
"metadata": {},
452444
"output_type": "execute_result"
453-
},
454-
{
455-
"name": "stdout",
456-
"output_type": "stream",
457-
"text": [
458-
"Controller stopped: {'exit_code': 0, 'pid': 82406}\n"
459-
]
460445
}
461446
],
462447
"source": [
@@ -497,14 +482,18 @@
497482
"name": "stdout",
498483
"output_type": "stream",
499484
"text": [
485+
"Controller stopped: {'exit_code': 0, 'pid': 25057}\n",
500486
"Starting 4 engines with <class 'ipyparallel.cluster.launcher.MPIEngineSetLauncher'>\n"
501487
]
502488
}
503489
],
504490
"source": [
491+
"import os\n",
492+
"os.environ[\"OMPI_MCA_rmaps_base_oversubscribe\"] = \"1\"\n",
493+
"\n",
505494
"cluster = Cluster(n=4, engine_launcher_class='MPI')\n",
506495
"await cluster.start_cluster()\n",
507-
"rc = cluster.connect_client()"
496+
"rc = await cluster.connect_client()"
508497
]
509498
},
510499
{
@@ -550,7 +539,7 @@
550539
"traceback": [
551540
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
552541
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
553-
"\u001b[0;32m/var/folders/qr/3vxfnp1x2t1fw55dr288mphc0000gn/T/ipykernel_81840/824703262.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0mar\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapply_async\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0muhoh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 14\u001b[0;31m \u001b[0mar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
542+
"\u001b[0;32m/var/folders/qr/3vxfnp1x2t1fw55dr288mphc0000gn/T/ipykernel_24747/824703262.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0mar\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapply_async\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0muhoh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 14\u001b[0;31m \u001b[0mar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
554543
"\u001b[0;32m~/dev/ip/parallel/ipyparallel/client/asyncresult.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTimeoutError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Result not ready.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_check_ready\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
555544
"\u001b[0;31mTimeoutError\u001b[0m: Result not ready."
556545
]
@@ -585,30 +574,10 @@
585574
},
586575
{
587576
"cell_type": "code",
588-
"execution_count": 16,
577+
"execution_count": null,
589578
"id": "ebe3e6d1-10cf-49be-83b6-da8dbaf712b1",
590579
"metadata": {},
591-
"outputs": [
592-
{
593-
"name": "stdout",
594-
"output_type": "stream",
595-
"text": [
596-
"Sending signal 2 to engine(s) 1623263525-cijg\n"
597-
]
598-
},
599-
{
600-
"ename": "TimeoutError",
601-
"evalue": "Result not ready.",
602-
"output_type": "error",
603-
"traceback": [
604-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
605-
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
606-
"\u001b[0;32m/var/folders/qr/3vxfnp1x2t1fw55dr288mphc0000gn/T/ipykernel_81840/3902026823.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0msignal\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mcluster\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msignal_engines\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msignal\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSIGINT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
607-
"\u001b[0;32m~/dev/ip/parallel/ipyparallel/client/asyncresult.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTimeoutError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Result not ready.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_check_ready\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
608-
"\u001b[0;31mTimeoutError\u001b[0m: Result not ready."
609-
]
610-
}
611-
],
580+
"outputs": [],
612581
"source": [
613582
"import signal\n",
614583
"await cluster.signal_engines(signal.SIGINT)\n",
@@ -627,17 +596,16 @@
627596
},
628597
{
629598
"cell_type": "code",
630-
"execution_count": 17,
599+
"execution_count": 16,
631600
"id": "2ae1cb50-965b-400e-b39f-4567df667da2",
632601
"metadata": {},
633602
"outputs": [
634603
{
635604
"name": "stdout",
636605
"output_type": "stream",
637606
"text": [
638-
"Stopping engine(s): 1623263525-cijg\n",
639-
"Starting 4 engines with <class 'ipyparallel.cluster.launcher.MPIEngineSetLauncher'>\n",
640-
"engine set stopped 1623263525-cijg: {'exit_code': -9, 'pid': 82790}\n"
607+
"Stopping engine(s): 1623757404-oexv\n",
608+
"Starting 4 engines with <class 'ipyparallel.cluster.launcher.MPIEngineSetLauncher'>\n"
641609
]
642610
}
643611
],
@@ -647,19 +615,26 @@
647615
},
648616
{
649617
"cell_type": "code",
650-
"execution_count": 19,
618+
"execution_count": 17,
651619
"id": "c676323b-1bf7-4983-8139-5b085c2fdf91",
652620
"metadata": {},
653621
"outputs": [
654622
{
655623
"data": {
656624
"text/plain": [
657-
"[4, 5, 6, 7]"
625+
"[0, 1, 2, 3]"
658626
]
659627
},
660-
"execution_count": 19,
628+
"execution_count": 17,
661629
"metadata": {},
662630
"output_type": "execute_result"
631+
},
632+
{
633+
"name": "stdout",
634+
"output_type": "stream",
635+
"text": [
636+
"engine set stopped 1623757404-oexv: {'exit_code': -9, 'pid': 25078}\n"
637+
]
663638
}
664639
],
665640
"source": [
@@ -678,17 +653,17 @@
678653
},
679654
{
680655
"cell_type": "code",
681-
"execution_count": 20,
656+
"execution_count": 19,
682657
"id": "7e261d39-0793-4207-813a-24caa4ec9a92",
683658
"metadata": {},
684659
"outputs": [
685660
{
686661
"data": {
687662
"text/plain": [
688-
"{4: 0, 5: 3, 6: 1, 7: 2}"
663+
"{4: 0, 5: 2, 6: 3, 7: 1}"
689664
]
690665
},
691-
"execution_count": 20,
666+
"execution_count": 19,
692667
"metadata": {},
693668
"output_type": "execute_result"
694669
}
@@ -713,18 +688,18 @@
713688
},
714689
{
715690
"cell_type": "code",
716-
"execution_count": 21,
691+
"execution_count": 20,
717692
"id": "060108bb-229b-4829-bf32-0dc7d0db0345",
718693
"metadata": {},
719694
"outputs": [
720695
{
721696
"name": "stdout",
722697
"output_type": "stream",
723698
"text": [
724-
"Stopping engine(s): 1623263525-cijg\n",
699+
"Stopping engine(s): 1623757404-oexv\n",
725700
"Stopping controller\n",
726-
"Controller stopped: {'exit_code': 0, 'pid': 82767}\n",
727-
"engine set stopped 1623263525-cijg: {'exit_code': 1, 'pid': 82998}\n"
701+
"Controller stopped: {'exit_code': 0, 'pid': 25076}\n",
702+
"engine set stopped 1623757404-oexv: {'exit_code': -9, 'pid': 25154}\n"
728703
]
729704
}
730705
],

0 commit comments

Comments
 (0)