Skip to content

Snakes and Ladders needs Function definition in Windows #19

@aegerton

Description

@aegerton

When I run the Snakes and Ladders example on Windows with the following code;-

cl = makeCluster(4)
parSapply(cl, 1:N, snakes_ladders)

I get the following error message;-

Error in checkForRemoteErrors(val) : 
  4 nodes produced errors; first error: could not find function "move"

Researching further elsewhere, I seem to need the following code in addition when using Windows;-

clusterExport(cl, list("move", "check_snake", "check_ladders", "snakes_ladders"))

Something about under Windows, "Parallel Socket Cluster (PSOCK) starting out with only the base packages loaded, whereas on Mac/Linux it automatically contains all environment variables" (https://stackoverflow.com/questions/12532257/could-not-find-function-inside-clusterapply) . Is that right, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions