Stream: dask

Topic: NCARCluster' is not defined


view this post on Zulip Judith Berner (Feb 04 2021 at 21:06):

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
============================

Casper

NUMNODES = 3
num_processes = 9
num_threads = 18
MEM = "200GB"

Cheyenne

NUMNODES = 5

num_processes = 18

num_threads = 36

MEM = "100GB"


cluster = NCARCluster(cores=num_threads,
processes=num_processes,
memory=MEM, walltime="04:00:00",
project="p93300642")

#cluster = NCARCluster(cores=num_threads,

processes=num_processes,

memory=MEM,

walltime="02:00:00",

)

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

view this post on Zulip Judith Berner (Feb 04 2021 at 21:07):

I repeat the error message with the comments removed (it made bold letters which must be confusing):

Casper

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

view this post on Zulip Judith Berner (Feb 04 2021 at 21:11):

pasted image

view this post on Zulip Brian Bonnlander (Feb 04 2021 at 21:15):

Hi Judith,

view this post on Zulip Brian Bonnlander (Feb 04 2021 at 21:15):

Was the cell with "import NCARCluster" executed when this happened?

view this post on Zulip Kevin Paul (Feb 04 2021 at 21:18):

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?

view this post on Zulip Judith Berner (Feb 04 2021 at 21:34):

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.

view this post on Zulip Kevin Paul (Feb 04 2021 at 21:34):

I'm glad we can help. :smile:


Last updated: Jan 30 2022 at 12:01 UTC