SLURM and OpenMPI

本文介绍SLURM集群管理系统如何与OpenMPI结合使用进行高效的任务调度与资源分配。详细阐述了通过slurm.conf配置文件指定默认的MPI实现,并通过srun命令启动任务时预留通信端口的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1) The MpiDefault configuration parameter in slurm.conf establishes the system default MPI to be supported. 

The srun option --mpi= (or the equivalent environment variable SLURM_MPI_TYPE can be used to specify when a different MPI implementation is to be supported for an individual job.



2) SLURM creates a resource allocation for the job and then mpirun launches tasks using SLURM's infrastructure (OpenMPI, LAM/MPI and HP-MPI).


3) The current versions of SLURM and Open MPI support task launch using the srun command.

 It relies upon SLURM version 2.0 (or higher) managing reservations of communication ports for use by the Open MPI version 1.5 (or higher). The system administrator must specify the range of ports to be reserved in the slurm.conf file using the MpiParams parameter. For example: 

MpiParams=ports=12000-12999


Launch tasks using the srun command plus the option --resv-ports. The ports reserved on every allocated node will be identified in an environment variable available to the tasks as shown here: 
SLURM_STEP_RESV_PORTS=12000-12015


If the ports reserved for a job step are found by the Open MPI library to be in use, a message of this form will be printed and the job step will be re-launched:
srun: error: sun000: task 0 unble to claim reserved port, retrying
After three failed attempts, the job step will be aborted. Repeated failures should be reported to your system administrator in order to rectify the problem by cancelling the processes holding those ports.


Note: Older releases


Older versions of Open MPI and SLURM rely upon SLURM to allocate resources for the job and then mpirun to initiate the tasks. For example:


$ salloc -n4 sh    # allocates 4 processors  # and spawns shell for job
> mpirun a.out
> exit          # exits shell spawned by initial salloc command
#extclientserver_bgTraffic [General] scheduler-class = "inet::RealTimeScheduler" cmdenv-express-mode = true image-path=../../../images output-scalar-file-append = false sim-time-limit = 100s **.routingRecorder.enabled = false **.networkConfiguratorModule = "" **.fcsMode = "computed" **.crcMode = "computed" ############### Statistics ################## **.scalar-recording = true **.vector-recording = false output-scalar-file = ${resultdir}/${configname}/${iterationvars}-${repetition}.sca output-vector-file = ${resultdir}/${configname}/${iterationvars}-${repetition}.vec seed-set = ${repetition} ############# Floorplan definition ################## **.mobility.constraintAreaMaxX = 2500m **.mobility.constraintAreaMaxY = 2500m **.mobility.constraintAreaMinX = -500m **.mobility.constraintAreaMinY = -500m **.mobility.constraintAreaMinZ = 0m **.mobility.constraintAreaMaxZ = 0m **.mobility.initFromDisplayString = false ############### Phy layer parameters ################ **.amcType = "NRAmc" **.pilotMode = "AVG_CQI" **.targetBler = 0.01 **.blerShift = 5 **.fbPeriod = 40 ############### IPv4 configurator config ################# *.configurator.config = xmldoc("./demo.xml") # MultiCellBackground configuration # # The central cell is surrounded by a configurable number of background cells. # Each surrounding cell has a number of bgUEs [Config MultiCellBackground] network = simu5g.emulation.extclientserver_bgTraffic.ExtClientServer_bgCells ########### C//entral gNodeB configuration ############## *.gnb.mobility.initialX = 1000m *.gnb.mobility.initialY = 1000m # the central gNB has a number of background UEs *.gnb.cellularNic.bgTrafficGenerator[0].numBgUes = ${numBgUEs=10} ########## Background cells configuration ############# *.numBgCells = ${numBgCells=3..99 step 3} # each background cell has the same number of background UEs as the central gNB *.bgCell[*].bgTrafficGenerator.numBgUes = ${numBgUEs} *.bgCell[0].mobility.initialX = 750m *.bgCell[0].mobility.initialY = 567m *.bgCell[1].mobility.initialX = 1500m *.bgCell[1].mobility.initialY = 1000m *.bgCell[2].mobility.initialX = 750m *.bgCell[2].mobility.initialY = 1433m *.bgCell[3].mobility.initialX = 1250m *.bgCell[3].mobility.initialY = 567m *.bgCell[4].mobility.initialX = 1250m *.bgCell[4].mobility.initialY = 1433m *.bgCell[5].mobility.initialX = 500m *.bgCell[5].mobility.initialY = 1000m *.bgCell[6].mobility.initialX = 500m *.bgCell[6].mobility.initialY = 134m *.bgCell[7].mobility.initialX = 2000m *.bgCell[7].mobility.initialY = 1000m *.bgCell[8].mobility.initialX = 500m *.bgCell[8].mobility.initialY = 1866m *.bgCell[9..98].mobility.initialX = uniform(250m,750m) *.bgCell[9..98].mobility.initialY = uniform(1000m,2000m) ############## ue configuration ################## # connect the ue's NIC to the corresponding serving gnb *.ue*.macCellId = 0 *.ue*.masterId = 0 *.ue*.nrMacCellId = 1 *.ue*.nrMasterId = 1 # ue position *.ue*.mobility.typename = "StationaryMobility" *.ue*.mobility.initialX = 1000m *.ue*.mobility.initialY = 1000m + ${dist=50m} ############### CA configuration ######################## *.carrierAggregation.numComponentCarriers = 1 *.carrierAggregation.componentCarrier[0].carrierFrequency = 2GHz *.carrierAggregation.componentCarrier[0].numBands = ${rbs=100} *.carrierAggregation.componentCarrier[0].numerologyIndex = ${u=2} *.gnb.cellularNic.numCarriers = 1 *.gnb.cellularNic.channelModel[0].componentCarrierIndex = 0 *.ue.cellularNic.numNRCarriers = 1 *.ue.cellularNic.nrChannelModel[0].componentCarrierIndex = 0 *.bgCell[*].bgScheduler.isNr = true *.bgCell[*].bgScheduler.numBands = ${rbs} *.bgCell[*].bgScheduler.carrierFrequency = 2GHz *.bgCell[*].bgScheduler.numerologyIndex = ${u} **.downlink_interference = false # there are no real cells, so this can be disabled **.uplink_interference = false # there are no real cells, so this can be disabled **.bgCell_interference = true # enable UL/DL interference from bg cells ############# Background traffic configuration ################# # --- Background UEs in the central cell --- # *.gnb.cellularNic.bgTrafficGenerator[0].enablePeriodicCqiUpdate = true *.gnb.cellularNic.bgTrafficGenerator[0].useProbabilisticCqi = ${probCqi=false} *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].trafficGeneratorType = "TrafficGeneratorCbr" *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.startTimeDl = uniform(0s,0.5s) *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.startTimeUl = uniform(0s,0.5s) *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.packetSizeDl = ${msgLen=1000B} *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.packetSizeUl = ${msgLen} *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.periodDl = ${sndInt=0.04s} *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].generator.periodUl = ${sndInt} # position of background UEs in the central cell *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].mobility.initialX = uniform(750m,1250m) *.gnb.cellularNic.bgTrafficGenerator[0].bgUE[*].mobility.initialY = uniform(750m,1250m) # --- Background UEs in the background cells --- # *.bgCell[*].bgTrafficGenerator.enablePeriodicCqiUpdate = true *.bgCell[*].bgTrafficGenerator.useProbabilisticCqi = ${probCqi} *.bgCell[*].bgTrafficGenerator.bgUE[*].trafficGeneratorType = "TrafficGeneratorCbr" *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.startTimeDl = uniform(0s,0.5s) *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.startTimeUl = uniform(0s,0.5s) *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.packetSizeDl = ${msgLen} *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.packetSizeUl = ${msgLen} *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.periodDl = ${sndInt} *.bgCell[*].bgTrafficGenerator.bgUE[*].generator.periodUl = ${sndInt} # position of background UEs in the background cells *.bgCell[0].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(500m,1000m) *.bgCell[0].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(317m,817m) *.bgCell[1].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(1250m,1750m) *.bgCell[1].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(750m,1250m) *.bgCell[2].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(500m,1000m) *.bgCell[2].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(1183m,1933m) *.bgCell[3].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(1000m,1500m) *.bgCell[3].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(317m,817m) *.bgCell[4].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(1000m,1500m) *.bgCell[4].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(1183m,1933m) *.bgCell[5].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(250m,750m) *.bgCell[5].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(750m,1250m) *.bgCell[6].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(250m,750m) *.bgCell[6].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(-116m,384m) *.bgCell[7].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(1750m,2250m) *.bgCell[7].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(750m,1250m) *.bgCell[8].bgTrafficGenerator.bgUE[*].mobility.initialX = uniform(250m,750m) *.bgCell[8].bgTrafficGenerator.bgUE[*].mobility.initialY = uniform(1183m,1683m) # include data for assigning cqi and rtxRate (useful when randomCqi==true only) include trafficGeneratorConfigs/config-u=2-rbs=100-numBgCells=3-numBkUEs=15-dist=50m-repetition=0.ini # # This configuration uses sockets to exchange packets with the real world # [Config ExtClientServer-bgTraffic] extends=MultiCellBackground ############## Routing configuration ############## # configure routing tables of each network element. Each of them must include a route to the (real) client *.router.ipv4.routingTable.routingFile = "routing/router.mrt" *.upf.ipv4.routingTable.routingFile = "routing/upf.mrt" *.gnb.ipv4.routingTable.routingFile = "routing/gnb.mrt" *.ue.ipv4.routingTable.routingFile = "routing/ue.mrt" ############## Ext Interface configuration ############## # equip the router with an External Ethernet interface *.router.numEthInterfaces = 1 *.router.eth[0].typename = "ExtLowerEthernetInterface" *.router.eth[0].device = "sim-veth1" *.ue.numEthInterfaces = 1 *.ue.eth[0].typename = "ExtLowerEthernetInterface" *.ue.eth[0].device = "sim-veth2" *.ue.extHostAddress = "192.168.3.2" *.ue.ipv4.forwarding = true [Config Multiple-UEs] extends = ExtClientServer-bgTraffic *.exue[*].numApps = 1 *.exue[*].app[*].typename = "CbrReceiver" # variable number of UEs *.numUe = 1 ############## ue configuration ################## # connect the ue's NIC to the corresponding serving gnb *.exue[*]*.macCellId = 0 *.exue[*]*.masterId = 0 *.exue[*]*.nrMacCellId = 1 *.exue[*]*.nrMasterId = 1 # UEs position *.exue[*].mobility.initialX = uniform(0m,1000m) *.exue[*].mobility.initialY = uniform(0m,1000m) # the server has one app per client # include itervars in the output file names output-scalar-file = ${resultdir}/${configname}/${iterationvars}-${repetition}.sca output-vector-file = ${resultdir}/${configname}/${iterationvars}-${repetition}.vec 这是我目前使用的omnet++simu5g的一个仿真文件,请问我应该怎么样按照之前omnet++官方给出的教程,将这个仿真文件划分成多个逻辑分区,并通过slurm集群以及openmpi来实现并行仿真
最新发布
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值