将Scala代码提交给集群

时间:2012-10-21 09:42:32

标签: scala cluster-computing akka

是否可以使用多个节点在oracle Grid Engine上运行一些akka代码?

因此,如果我使用actor模型,这是一个“消息传递模型”,是否可以使用Scala和akka框架在分布式内存系统(如集群或网格)上运行我的代码?

如果是这样,在mpirun中是否有类似mpi -c的内容,在不同的节点上运行我的程序?你能用oracle Grid Engine提交一个提交示例吗?

我如何知道我在哪个节点上的scala以及作业已提交了多少个节点?

是否可以通过actor-model与其他节点进行通信?

1 个答案:

答案 0 :(得分:7)

某些系统上的

mpirun或(mpiexec)可以运行任何类型的可执行文件(即使它们不使用MPI)。我目前用它来在集群上启动java和scala代码。在调用mpirun时将参数传递给可执行文件可能会很棘手,因此您可以使用中间脚本。

我们使用与GridEngine不兼容的Torque / Maui脚本,但这是我的同事目前正在使用的脚本:

#!/bin/bash
#PBS -l walltime=24:00:00
#PBS -l nodes=10:ppn=1
#PBS -l pmem=45gb
#PBS -q spc
# Find the list of nodes in the cluster
id=$PBS_JOBID
nodes_fn="${id}.nodes"
# Config file
config_fn="human_stability_article.conf"
# Java command to call
java_cmd="java -Xmx10g -cp akka/:EvoProteo-assembly-0.0.2.jar ch.unige.distrib.BuildTree ${nodes_fn} ${config_fn} ${id}"
# Create a small script to pass properly the parameters
aktor_fn="./${id}_aktor.sh"
echo -e "${java_cmd}" >> $aktor_fn
# Copy the machine file to the proper location
rm -f $nodes_fn
cp $PBS_NODEFILE $nodes_fn
# Launch the script on 10 notes
mpirun -np 10 sh $aktor_fn > "${id}_human_stability_out.txt"