


{"id":283931,"date":"2023-05-15T09:49:07","date_gmt":"2023-05-15T09:49:07","guid":{"rendered":"\/forum\/forums\/topic\/workbench-execution-failure-from-jupyter-notebook\/"},"modified":"2023-05-15T09:49:07","modified_gmt":"2023-05-15T09:49:07","slug":"workbench-execution-failure-from-jupyter-notebook","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/workbench-execution-failure-from-jupyter-notebook\/","title":{"rendered":"Workbench execution failure from Jupyter notebook"},"content":{"rendered":"<p><span style=\"font-size: 12pt\">Hi,<\/span><\/p>\n<p><span style=\"font-size: 12pt\">I have a workbench project which is executed from a Jupyter notebook. The input parameters for the workbench file is written by the notebook and call to the workbench project is made using the python function subprocess.run(). The entire process is placed in a &#8216;for&#8217; loop. The simulation was running without any issues until one of the FE simulations ran out of memory and I had to force stop it. I restarted the simulation from avoiding the particular input which created memory shortage. Now the simulation is not entering the solving phase (At least this is what I understood from looking at the time frame) and exiting before producing the output. I am using ANSYS 2022 R2 Academic version. Things I did to rectify the problem:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 12pt\">Opened Workbench and removed the &#8220;file locked&#8221; condition.<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Try to run the workbench project from windows command prompt with the input file (created by Jupyter notebook) &#8211; Successful simulation<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Reduced the number of cores from 10 to 8 to see the influence of memory. I have maximum 64GB availabile for the simulation &#8211; No change if I run from Jupyter notebook. But successful from windows command prompt.<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Changed solver from distributed to iterative &#8211; No change with Jupyter notebook<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Checked ANSYS license manager &#8211; It is running without any problem. No logs of license lose during simulation.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-size: 12pt\">I am using Python 3.8.8 to run my Jupyter notebook. The python function from my Jupyter code is<\/span><\/p>\n<div>\n<div><span style=\"font-size: 12pt\">def simulation():<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; # Location of file containg ANSYS workbench executable<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; cmd = &#8220;&#8230;\/Framework\/bin\/Win64\/RunWB2.exe&#8221;<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; # Location of file containg ANSYS workbench journal<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; input_file = &#8220;&#8230;\/Plate.wbjn&#8221;<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; start = time.time()<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; # Run the simulation in batch mode<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; subprocess.run([cmd,&#8217;-B&#8217;,&#8217;-R&#8217;,input_file], shell=True)<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; end = time.time()<\/span><\/div>\n<div><span style=\"font-size: 12pt\">&nbsp; &nbsp; print(end-start)<\/span><\/div>\n<div>&nbsp;<\/div>\n<div><span style=\"font-size: 12pt\">I was successfully completed approximately 1500 simulations with my code. The problem started as soon as I force stopped my simulation and restarted. My understanding is that python is failing to open MAPDL solver.&nbsp;<\/span><\/div>\n<div>&nbsp;<\/div>\n<div><span style=\"font-size: 12pt\">Can you shed some light on potential solutions for the problem?<\/span><\/div>\n<div>&nbsp;<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"template":"","class_list":["post-283931","topic","type-topic","status-closed","hentry","topic-tag-ansysstructuresolveIssue-1","topic-tag-ansysworkbench-ansys-staticstructural","topic-tag-batch-command","topic-tag-journal"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["201888","170445"],"_bbp_author_ip":["23.39.172.22"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["903"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["283931"],"_bbp_forum_id":["27791"],"_bbp_engagement":["170445","201888"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["284757"],"_bbp_last_active_id":["284757"],"_bbp_last_active_time":["2023-05-18 18:06:01"]},"test":"jmjosephuliege-be"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/283931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/283931\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=283931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}