[Pympi-users] Idle as the console
Status: Alpha
Brought to you by:
patmiller
From: Julian C. <rjc...@cs...> - 2005-08-17 16:21:40
|
Pat I tried using idle as the main interpreter for pyMPI at np >1. But not suprisingly it didn't work. I executed pyMPI with the following simple script: % mpirun - np 2 pyMPI pyMPI_idle.py -n Contents of pyMPI_idle.py: import mpi if (mpi.rank == 0): import idlelib.PyShell idlelib.PyShell.main() idle will run, but with no communication. When I inspected the stacks (using pstack), not suprisingly, they were quite different, though part of it is because the idle stack actually executes the above script: Stack for the python interactive console: You can see that from Py_Main, we end up at call_readline after parallelReadline.. 4280: /home/jcook/python/Python-2.4/bin/pyMPI -p4pg /ironside/home/jcook/PI4 ----------------- lwp# 1 / thread# 1 -------------------- fef9d5fc poll (ffbee3a8, 1, 64) fef4d534 select (1, 0, 0, ffbee3b0, fefbf1bc, ffbee3a8) + 348 feddaa28 select (252274, 0, fefbc008, fed774d0, 1, fed83480) + 34 fed83294 call_readline (2c8668, 2c8678, 466c74, 4159d8, 2c8668, 0) + 7c 0003df64 parallelReadline (2c8668, 2c8678, 466c74, 0, 4990f8, 4a00c0) + 36c 00065618 PyOS_Readline (2c8c00, 252000, 35ea48, 264c00, 2c7c00, 466c74) + e0 00106fb8 tok_nextc (1413f08, 10, 2, c, a, b) + 64 00107b88 tok_get (2c7e40, 22fff4, 2c7ce8, 7f, 3a3d10, 3a3818) + 70 00108830 PyTokenizer_Get (1413f08, ffbeede4, ffbeede0, 27556c, 2c8668, 35f030) + c 00105c50 parsetok (0, 27556c, 100, ffbeee54, 0, 4a4b58) + 64 000e389c PyRun_InteractiveOneFlags (466ca0, 466cb4, ffbeef9c, 29b4f4, 466c74, 466c60) + 15c 000e3714 PyRun_InteractiveLoopFlags (466ca0, 29b4f4, 2c8668, ffbeef9c, 22e9c0, 466c60) + fc 000e35dc PyRun_AnyFileExFlags (2c8668, 2c8668, 0, ffbeef9c, 29b4f4, 0) + 38 000ea664 Py_Main (2c8688, 29b468, 2c8668, 0, 0, 1) + 8e0 00035f6c pyMPI_Main_with_communicator (1, ffbef12c, ffbef130, 5b, fefc21d0, 0) + 19c 0003600c pyMPI_Main (1, ffbef12c, ffbef130, fef1bc20, 31ea0, 0) + 2c 00035d98 main (5, ffbef14c, ffbef164, 251400, 0, 0) + 30 00035d40 _start (0, 0, 0, 0, 0, 0) + b8 The stack for idle is completely different. I had to show only the first portion up to the select loop: 29203: /home/jcook/python/Python-2.4/bin/pyMPI pyMPI_idle.py -n -p4pg /ironsi 00103e70 Tkapp_MainLoop (1, 35ea48, 0, 2c0950, 642670, 26e274) + 1dc 000c3cfc call_function (60d508, 35ea48, 0, 642670, ffbee914, 3bd89c) + 3b8 000c0d10 PyEval_EvalFrame (bd20c, 26f0fc, 26f0f0, 253c54, 35ea48, 0) + 38c8 000c2304 PyEval_EvalCodeEx (53a95c, 4, 1, 8, 0, 1) + 9f8 000c4018 fast_function (53c7b0, ffbeeb1c, 1, 1, 0, 469270) + 170 000c3df8 call_function (43a144, 468990, 0, 53c7b0, ffbeeb1c, 43a140) + 4b4 000c0d10 PyEval_EvalFrame (bd20c, 26f0fc, 26f0f0, 253c54, 35ea48, 0) + 38c8 000c3f7c fast_function (ffbeecac, 35ea48, 439fb0, 0, 0, 0) + d4 000c3df8 call_function (3a37b8, 0, 0, 404af0, ffbeecac, 3a37b4) + 4b4 000c0d10 PyEval_EvalFrame (bd20c, 26f0fc, 26f0f0, 253c54, 35ea48, 0) + 38c8 000c2304 PyEval_EvalCodeEx (0, 377a50, 0, 0, 0, 0) + 9f8 000bd1d4 PyEval_EvalCode (460060, 377a50, 377a50, 4688e0, 35f030, 35f030) + 28 000e4d28 run_node (368368, 460060, 377a50, 377a50, ffbeeecc, 368368) + 3c 000e3c98 PyRun_SimpleFileExFlags (4686d8, 377a50, ffbef299, ffbeeecc, 1, 2c8698) + 1b4 000ea664 Py_Main (3, 29b468, 2c8668, 0, 0, 1) + 8e0 00035f6c pyMPI_Main_with_communicator (1, ffbef05c, ffbef060, 5b, fefc21d0, 0) + 19c 0003600c pyMPI_Main (1, ffbef05c, ffbef060, fef1bc20, 31ea0, 0) + 2c 00035d98 main (7, ffbef07c, ffbef09c, 251400, 0, 0) + 30 00035d40 _start (0, 0, 0, 0, 0, 0) + b8 Obviously the big question is: Is it even feasible to consider using a graphical shell such as idle, or are they just too different? regards Julian Cook |