Skip to content
34 changes: 30 additions & 4 deletions nanshe_ipython.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,27 @@
"from psutil import cpu_count\n",
"\n",
"cluster_kwargs = {\n",
" \"ip\": \"\"\n",
" \"preexec_commands\": (\n",
" \"singularity exec --bind /scratch --bind /misc ~/nanshe_workflow.simg \\\\\",\n",
" ),\n",
" \"ip\": \"\",\n",
" \"threads_per_worker\": 1,\n",
" \"local_dir\": \"/scratch/\" + os.environ[\"USER\"],\n",
" \"template\": {\n",
" \"args\": [\n",
" \"--nthreads\", \"1\",\n",
" \"--local-directory\", \"/scratch/\" + os.environ[\"USER\"]\n",
" ],\n",
" \"jobEnvironment\": os.environ,\n",
" \"nativeSpecification\": \"-q normal\"\n",
" }\n",
"}\n",
"client_kwargs = {}\n",
"adaptive_kwargs = {\n",
" \"startup_cost\": \"12s\",\n",
" \"interval\": \"6s\",\n",
" \"minimum\": 0,\n",
" \"maximum\": int(os.environ.get(\"CORES\", cpu_count())) - 1\n",
" \"maximum\": 256\n",
"}"
]
},
Expand Down Expand Up @@ -1261,13 +1276,24 @@
"from psutil import cpu_count\n",
"\n",
"\n",
"ncores = int(os.environ.get(\"CORES\", cpu_count())) - 1\n",
"ncores = 32\n",
"\n",
"\n",
"dict_client = startup_distributed(\n",
" 1,\n",
" cluster_kwargs={\n",
" \"threads_per_worker\": ncores\n",
" \"preexec_commands\": (\n",
" \"singularity exec --bind /scratch --bind /misc ~/nanshe_workflow.simg \\\\\",\n",
" ),\n",
" \"template\":\n",
" {\n",
" \"args\": [\n",
" \"--nthreads\", str(ncores),\n",
" \"--local-directory\", \"/scratch/\" + os.environ[\"USER\"]\n",
" ],\n",
" \"jobEnvironment\": os.environ,\n",
" \"nativeSpecification\": \"-q normal -n %i\" % ncores,\n",
" },\n",
" },\n",
" client_kwargs={}\n",
")\n",
Expand Down