So an alternative to ClusterManagers approach which does not rely on array jobs is as follows:
### 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")