System details: Windows 10 64-bit, Python 2.6, Abaqus/CAE 6.12 or 6.14Įxample Test Script: # multi.py import multiprocessingįname = ''.join(( 'worker_', str(num), '.txt'))į.write( 'Starting Worker \n'. Note that any solution must be available in the Python 2.6 standard library. What might be causing the hang-up, and how can I fix it? Is there an environment variable that must be set? Are there other commercial systems that use a similar procedure that I can learn from/emulate? The processes are created, but they all hang and do nothing. Abaqus then checks out licenses for each process successfully, spawns the new processes, and. Where the global namespace arg _main_._dict_ is setup by Abaqus. However, when called from the Abaqus/CAE Python environment using: abaqus cae noGUI=multi.pyĪbaqus will then start up, automatically import its own proprietary modules, and then executes my file using: execfile( "multi.py", _main_._dict_) This spawns the new processes, and each runs the function and writes the result to file as expected. The example code below works as expected when run from the command line using either of the following: C:\some\path>python multi.py # abaqus python multi.py # <- Using Python bundled with Abaqus
This way, I can run the same script from the regular system Python installation as well as from the Python bundled with Abaqus. To try to get multiprocessing working, I've attempted to run a script that avoids accessing any Abaqus objects, and instead just performs a calculation and prints the result to file 2. The script itself uses various objects/methods available only through Abaqus's proprietary cae module, which can only be loaded by starting up the Python bundled with Abaqus/CAE first, which then executes my script with Python's execfile.
However, once spawned the processes just hang. I've developed a long-running script that I'm attempting to split into simultaneous, independent tasks using Python's multiprocessing module. I am using a commercial application called Abaqus/CAE 1 with a built-in Python 2.6 interpreter and API.