Getting started with LAM

本文介绍LAM环境的基础操作,包括启动、编译和运行MPI程序的方法,并演示如何监控MPI应用及清理环境。通过实例展示了从启动集群到运行简单MPI程序的全过程。

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

转自:http://www.lam-mpi.org/tutorials/one-step/lam.php

LAM is a simple yet powerful environment for running and monitoring MPI applications on clusters. The few essential steps in LAM operations are covered below.

Booting LAM

The user creates a file listing the participating machines in the cluster.

shell$ cat lamhosts
# a 2-node LAM
node1.cluster.example.com
node2.cluster.example.com

Each machine will be given a node identifier (nodeid) starting with 0 for the first listed machine, 1 for the second, etc.

 

The recon tool verifies that the cluster is bootable:

shell$ recon -v lamhosts
recon: -- testing n0 (node1.cluster.example.com)
recon: -- testing n1 (node2.cluster.example.com)

The lamboot tool actually starts LAM on the specified cluster.

% lamboot -v lamhosts

LAM 7.1.4 - Indiana University

Executing hboot on n0 (node1.cluster.example.com - 1 CPU)...
Executing hboot on n1 (node2.cluster.example.com - 1 CPU)...

lamboot returns to the UNIX shell prompt. LAM does not force a canned environment or a "LAM shell". The tping command builds user confidence that the cluster and LAM are running.

shell$ tping -c1 N
  1 byte from 1 remote node and 1 local node: 0.008 secs

1 message, 1 byte (0.001K), 0.008 secs (0.246K/sec)
roundtrip min/avg/max: 0.008/0.008/0.008

Compiling MPI Programs

Refer to MPI: It's Easy to Get Started to see a simple MPI program. mpicc (and mpiCC and mpif77) is a wrapper for the C (C++, and F77) compiler that includes all the necessary command line switches to the underlying compiler to find the LAM include files, the relevant LAM libraries, etc.

shell$ mpicc -o foo foo.c
shell$ mpif77 -o foo foo.f

Executing MPI Programs

A MPI application is started by one invocation of the mpirun command. A SPMD application can be started on the mpirun command line.

shell$ mpirun -v -np 2 foo
2445 foo running on n0 (o)
361 foo running on n1

An application with multiple programs must be described in an application schema, a file that lists each program and its target node(s).

shell$ cat appfile
# 1 master, 2 slaves
n0 master 
n0-1 slave 

shell$ mpirun -v appfile
3292 master running on n0 (o)
3296 slave running on n0 (o)
412 slave running on n1

Monitoring MPI Applications

The full MPI synchronization status of all processes and messages can be displayed at any time. This includes the source and destination ranks, the message tag, count and datatype, the communicator, and the function invoked.

shell$ mpitask
TASK (G/L)    FUNCTION      PEER|ROOT  TAG    COMM   COUNT   DATATYPE
0/0 master    Recv          ANY        ANY    WORLD  1       INT
1 slave       <running>
2 slave       <running>

Process rank 0 is blocked receiving a message consisting of a single integer from any source rank and any message tag, using the MPI_COMM_WORLD communicator. The other processes are running.

shell$ mpimsg
SRC (G/L)   DEST (G/L)   TAG   COMM    COUNT   DATATYPE    MSG
0/0         1/1          7     WORLD   4       INT         n0,#0

Later, we see that a message sent by process rank 0 to process rank 1 is buffered and waiting to be received. It was sent with tag 7 using the MPI_COMM_WORLD communicator and contains 4 integers.

Cleaning LAM

All user processes and messages can be removed, without rebooting.

shell$ lamclean -v
killing processes, done      
sweeping messages, done      
closing files, done      
sweeping traces, done

It is typical for users to mpirun a program, lamclean when it finishes, and then mpirun another program. It is not necessary to lamboot to run each user MPI program.

Terminating LAM

The lamhalt tool removes all traces of the LAM session on the network. This is only performed when LAM/MPI is no longer needed (i.e., no more mpirun/lamclean commands will be issued).

shell$ lamhalt

In the case of a catastrophic failure (e.g., one or more LAM nodes crash), the lamhalt utility will hang. In this case, the wipe tool is necessary. The same boot schema that was used with lamboot is necessary to list each node where the LAM run-time environment is running:

shell$ wipe -v lamhosts
Executing tkill on n0 (node1.cluster.example.com)...
Executing tkill on n1 (node2.cluster.example.com)...
<think>好的,我现在需要处理用户关于SC、LAM以及SC与ASC组合在IT上下文中的解释请求。首先,我需要明确这些缩写的全称和常见含义,尤其是在IT领域。 首先,SC可能有多个含义,比如Source Control(版本控制)、Service Component(服务组件)、Secure Communication(安全通信)或者Smart Card(智能卡)。在IT上下文中,最常见的可能是Source Control,即版本控制系统,如Git、SVN等。用户提到的是IT领域,所以需要确认这一点。 接下来是LAMLAM常见的解释包括Linux, Apache, MySQL(LAMP堆栈的变体),但用户这里写的是LAM,不是LAMP。另外,LAM可能指Local Area Network Manager(局域网管理器)或者Lambda Authorizer Middleware(AWS中的授权中间件)。也有可能是指其他专业术语,需要进一步考虑。 然后是SC_with_ASC。ASC可能代表Amazon Simple Storage Service (S3) 的访问控制(Access Control),或者Application Security Context(应用安全上下文)。结合SC,比如Source Control与ASC的组合,可能涉及权限管理或安全控制方面的整合。 为了确保准确性,我需要逐一验证这些可能的解释,并找到最合理的组合。例如,SC作为Source Control,LAM可能与Lambda有关,而ASC可能与AWS的服务相关,如AWS Security Composer或其他安全组件。或者,在某些上下文中,SC可能指Service Chaining,LAM指Load Balancer或某种中间件,ASC指自动化安全配置。 可能需要查阅一些IT架构文档或常见缩写列表。例如,在云计算中,特别是AWS,LAM可能指Lambda Authorizer,用于API Gateway的权限验证。SC_with_ASC可能指将Source Control与自动化安全配置结合,比如在CI/CD流程中使用版本控制触发安全扫描(ASC)。 另外,需要检查是否有拼写错误,比如用户是否指的是SCIM(System for Cross-domain Identity Management)或LAMBDA函数,但用户明确写了LAM,所以应保持原样。 总结可能的解释: - SC: Source Control 或 Service Chaining - LAM: Lambda Authorizer Middleware 或 Local Area Manager - ASC: Automated Security Configuration 或 Access Security Control 组合使用时,可能是在云原生架构中,使用版本控制(SC)与自动化安全(ASC)结合,通过LAM处理授权。例如,在微服务架构中,服务链(SC)与访问控制(ASC)通过Lambda中间件(LAM)管理权限。 需要组织这些信息,确保每个术语有清晰定义,并解释组合使用的场景和优势。可能还需要引用相关技术文档或最佳实践来支持解释,比如AWS的架构指南或DevOps中的安全集成模式。 最后,生成相关问题,帮助用户深入理解,比如询问具体应用案例、技术实现细节或与其他技术的对比。</think>在IT上下文中,$SC$、$LAM$ 及 $SC\_with\_ASC$ 的组合通常涉及系统架构、安全控制或服务管理领域。以下是具体解释: --- ### **1. SC(Source Control / Service Chaining)** - **Source Control(版本控制)** 用于管理代码变更的工具(如Git、SVN),支持团队协作和版本回溯。例如: $$ git commit -m "Update security policy" $$ - **Service Chaining(服务链)** 在网络或微服务架构中,将多个服务按顺序组合以实现复杂功能。例如,API网关调用认证服务后再转发请求[^1]。 --- ### **2. LAMLambda Authorizer Middleware / Local Area Manager)** - **Lambda Authorizer Middleware** 在无服务器架构(如AWS API Gateway)中,通过Lambda函数验证请求权限,实现动态访问控制。例如: ```python def lambda_handler(event, context): token = event['headers'].get('Authorization') return {"isAuthorized": token is not None} ``` - **Local Area Manager** 用于监控和管理局域网设备,优化网络流量分配。 --- ### **3. SC_with_ASC(Source Control with Automated Security Configuration)** - **组合应用场景** 在CI/CD流水线中,版本控制系统(SC)触发代码提交后,自动化安全工具(ASC)执行扫描(如SAST、DAST),确保代码合规性[^1]。例如: ```bash git push origin main # 触发自动化安全扫描 ``` --- ### **典型架构示例** $$ \begin{aligned} &\text{开发者提交代码} \rightarrow \text{SC系统} \rightarrow \text{ASC扫描} \\ &\downarrow \\ &\text{LAM授权} \rightarrow \text{部署到生产环境} \end{aligned} $$ ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值