Functions for creating and closing a job queue

Share:

Description

Q.make creates a 1-node socket cluster to be used with all the other jobqueue functions. Q.close destroys the jobqueue and frees its resources, deleting all data which it may still contain.

Usage

1
2
Q.make(...)
Q.close(Q, cleanup = TRUE)

Arguments

...

Q.make passes all supplied arguments through to parallel::makeCluster(1, "PSOCK", ...). Usually, no such options need to be specified. Setting methods=FALSE reduces the memory usage of the queue, but can only be used if the methods package and S4 classes are not needed.

Q

A job queue as created by Q.make.

cleanup

If TRUE, the queue's temporary data and all variables assigned with Q.assign are deleted before closing the socket. Otherwise, only the socket is closed (potentially not freeing all resources).

Value

Q.make returns an S3 jobqueue object to be used with the other jobqueue functions.

Q.close returns NULL invisibly.

Author(s)

Bastian Laubner

See Also

Q.push, Q.collect

Examples

1
2
Q = Q.make()
Q.close(Q)