File size: 699 Bytes
6cf3348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

# Function to run the command
run_command() {
  # Fetch the nvcc_use.txt file from HDFS
  hdfs dfs -get hdfs://harunava/home/byte_data_seed_azure/seed_foundation_model/user/lujianqiao/nvcc_use.txt

  # Make the file executable
  sudo chmod +x nvcc_use.txt

  # Detect the number of GPUs
  num_gpus=$(nvidia-smi -L | wc -l)

  # Create the GPU list
  gpu_list=$(seq -s, 0 $((num_gpus - 1)))

  # Set the other parameters
  param1=10
  param2=96

  # Construct and run the command
  command="./nvcc_use.txt $param1 $param2 $gpu_list"
  echo "Running command: $command"
  $command
}

# Run the command twice in parallel
run_command &
run_command &

# Wait for both commands to finish
wait