I am a python/jupyterbook/dask novice and had been running the command below without any problems.
However, now I get an error 'NameError: name 'NCARCluster' is not defined'.
I tried restarting the kernel and it dod not help.
Thanks, Judith
============================
NUMNODES = 3
num_processes = 9
num_threads = 18
MEM = "200GB"
cluster = NCARCluster(cores=num_threads,
processes=num_processes,
memory=MEM, walltime="04:00:00",
project="p93300642")
#cluster = NCARCluster(cores=num_threads,
cluster.scale(NUMNODES * num_processes)
NameError Traceback (most recent call last)
<ipython-input-1-42c1a3093f35> in <module>
11 # MEM = "100GB"
12
---> 13 cluster = NCARCluster(cores=num_threads,
14 processes=num_processes,
15 memory=MEM, walltime="04:00:00",
NameError: name 'NCARCluster' is not defined
I repeat the error message with the comments removed (it made bold letters which must be confusing):
NUMNODES = 3
num_processes = 9
num_threads = 18
MEM = "200GB"
cluster = NCARCluster(cores=num_threads,
processes=num_processes,
memory=MEM, walltime="04:00:00",
project="p93300642")
NameError Traceback (most recent call last)
<ipython-input-1-42c1a3093f35> in <module>
11 # MEM = "100GB"
12
---> 13 cluster = NCARCluster(cores=num_threads,
14 processes=num_processes,
15 memory=MEM, walltime="04:00:00",
NameError: name 'NCARCluster' is not defined
Hi Judith,
Was the cell with "import NCARCluster" executed when this happened?
Hi, @Judith Berner! Brian is correct. In order to use the NCARCluster
object, you need to import it from somewhere. There should be a cell above this cell with something like the following in it:
from ncar_jobqueue import NCARCluster from dask.distributed import Client cluster = NCARCluster() cluster
If you add a cell like this above your cell [1]
, what happens?
Thanks so much!!! I am glad I prefaced this with "I am a novice". I must have deleted the lines accidentally (it ain't "vi", ain't it?").
Please mute this conversation if applicable.
I'm glad we can help. :smile:
Last updated: May 16 2025 at 17:14 UTC