0

我使用 wolframscript 生成数百个图像,例如 八面体 4 倍对称的可视化 (将在动画视频中组合),如下所示:

      Map[
       Export[
          "img" <> IntegerString[# , 10, 6] <> ".jpg",
          Show[
              (* Graphics3D with >300,000 polygons *),
      
              ViewVector -> {#, {0,0,#[[3]]}}& @ viewPoints[[#]],
              ViewVertical -> {0, 0, 1},
              ViewAngle -> 35 Degree,
              ImageSize -> Large
          ]
       ] &,
       Range[ ToExpression[#[[1]]], ToExpression[#[[2]]] ]& @ Rest[$ScriptCommandLine]
      ]

由于 FE 中的光栅化操作触发 Mathematica Frontend 12.1.1 中的内存泄漏,我被迫从这样的 shell 脚本分段运行脚本

./hp-h+h-bps+ghp-t7-s2-9.wls 1 5
./hp-h+h-bps+ghp-t7-s2-9.wls 6 10
./hp-h+h-bps+ghp-t7-s2-9.wls 11 15
...
./hp-h+h-bps+ghp-t7-s2-9.wls 191 195
./hp-h+h-bps+ghp-t7-s2-9.wls 196 200

是否可以从 wolframscript 中杀死前端?(Run["kill -9 pidOfMathematicaServer"] 将不起作用,因为这也会杀死产生 FE 的内核。)

4

1 回答 1

1

ihojnicki 在 mathematica.stackexchange 上回答:“您可以通过 Developer`UninstallFrontEnd[] 发布您的 FrontEnd 副本。”

效果很好,让我摆脱了 shell 脚本。

于 2021-04-20T13:24:04.217 回答