#!/bin/bash# Check for minimum number of required argumentsif[$#-lt4];thenecho"Usage: $0 docker_image head_node_address --head|--worker path_to_hf_home [additional_args...]"exit1fi# Assign the first three arguments and shift them awayDOCKER_IMAGE="$1"HEAD_NODE_ADDRESS="$2"NODE_TYPE="$3"# Should be --head or --workerPATH_TO_HF_HOME="$4"shift4# Additional arguments are passed directly to the Docker commandADDITIONAL_ARGS=("$@")# Validate node typeif["${NODE_TYPE}"!="--head"]&&["${NODE_TYPE}"!="--worker"];thenecho"Error: Node type must be --head or --worker"exit1fi# Define a function to cleanup on EXIT signalcleanup(){docker stop nodedockerrmnode}trap cleanup EXIT# Command setup for head or worker nodeRAY_START_CMD="ray start --block"if["${NODE_TYPE}"=="--head"];thenRAY_START_CMD+=" --head --port=6379"elseRAY_START_CMD+=" --address=${HEAD_NODE_ADDRESS}:6379"fi# Run the docker command with the user specified parameters and additional argumentsdocker run \--entrypoint /bin/bash \--networkhost\--namenode\--shm-size 10.24g \--gpus all \-v"${PATH_TO_HF_HOME}:/root/.cache/huggingface"\"${ADDITIONAL_ARGS[@]}"\"${DOCKER_IMAGE}"-c"${RAY_START_CMD}"
相交链表
160. 相交链表 - 力扣(LeetCode)
思路就是遍历两个链表,有相同的部分就可以视为相交。
但是长度不一样,比如两个会相交的链表,headA 的长度为 a c,headB 的长度为 b c,其中 c 是公…