# ClusterManagers package not connecting for PBS batch system

**URL:** <https://discourse.julialang.org/t/clustermanagers-package-not-connecting-for-pbs-batch-system/8879>\
**Category:** General Usage\
**Tags:** parallel, cluster\
**Created:** [February 7, 2018, 2:03am UTC](https://discourse.julialang.org/t/clustermanagers-package-not-connecting-for-pbs-batch-system/8879 "2018-02-07T02:03:10Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Janis\_Erdmanis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janis_erdmanis/32/10869_2.png) [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Post date:** [April 15, 2018, 4:57pm UTC](https://discourse.julialang.org/t/clustermanagers-package-not-connecting-for-pbs-batch-system/8879/8 "2018-04-15T16:57:55Z")

</div>

So an alternative to ClusterManagers approach which does not rely on array jobs is as follows:

```julia
### Initializing cluster
isfile("machinefile") && rm("machinefile")

open(pipeline(`qsub -l nodes=2:ppn=2`), "w", STDOUT) do io
    println(io,"cat \$PBS_NODEFILE > machinefile; while [-f machinefile]; do sleep 1; done")
end

print("Queing")
while !isfile("machinefile")
    sleep(1)
    print(".")
end
println("")

cores = [(i, 1) for i in readlines("machinefile")]
clusterworkers = addprocs(cores; topology=:master_slave, dir="~",exename="julia")

### Doing some calculation

pmap(x->run(`hostname`),1:10)

### Killing the job and workers
rmprocs(clusterworkers)
rm("machinefile")

```

---

_[View the full topic](https://discourse.julialang.org/t/clustermanagers-package-not-connecting-for-pbs-batch-system/8879)._
