0% found this document useful (0 votes)
9 views2 pages

CPU and GPU Job Submission Scripts

This document contains scripts for running molecular dynamics simulations using NAMD on both CPU-only and CPU+GPU nodes on a Cray supercomputer. The scripts specify the queue to submit to, load required modules, echo environment variables, create output directories, copy input files, and run NAMD linking to the correct executable using aprun to distribute across nodes.

Uploaded by

Arupjyoti Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

CPU and GPU Job Submission Scripts

This document contains scripts for running molecular dynamics simulations using NAMD on both CPU-only and CPU+GPU nodes on a Cray supercomputer. The scripts specify the queue to submit to, load required modules, echo environment variables, create output directories, copy input files, and run NAMD linking to the correct executable using aprun to distribute across nodes.

Uploaded by

Arupjyoti Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scripts for running on CPU nodes

## Queue it will run in


#PBS -N test
#PBS -q regular
#PBS -l select=2:ncpus=40:vntype=cray_compute
#PBS -l walltime=00:10:00
#PBS -l place=scatter
#PBS -j oe
##PBS -o namd_cpu.batch-log
##PBS -V

. /opt/modules/default/init/sh

cd $PBS_O_WORKDIR

module load namd/2.12/intel-18.0.1

echo ------------------------------------------------------
echo -n 'Job is running on node '; cat $PBS_NODEFILE
echo ------------------------------------------------------
echo PBS: qsub is running on $PBS_O_HOST
echo PBS: originating queue is $PBS_O_QUEUE
echo PBS: executing queue is $PBS_QUEUE
echo PBS: working directory is $PBS_O_WORKDIR
echo PBS: execution mode is $PBS_ENVIRONMENT
echo PBS: job identifier is $PBS_JOBID
echo PBS: job name is $PBS_JOBNAME
echo PBS: node file is $PBS_NODEFILE
echo PBS: current home directory is $PBS_O_HOME
echo PBS: PATH = $PBS_O_PATH
echo ------------------------------------------------------

EXEC=/home/apps/namd/2.12/intel/18.0.1/CRAY-XC-intel/namd2
RUN_DIR=$PBS_O_WORKDIR/cpu_out/run.${PBS_JOBID}

mkdir -p ${RUN_DIR}
cp cpu_input/* ${RUN_DIR}

cd ${RUN_DIR}
ln -s ${EXEC} .

time aprun -n 80 -N 40 ${RUN_DIR}/namd2 [Link] > $


{RUN_DIR}/[Link]
Scripts for running on CPU+GPU nodes

## Queue it will run in

#PBS -N ngc_2_1_1
#PBS -q gpuq
##PBS -q gpu_nodes
#PBS -l select=2:ncpus=1:accelerator=True:vntype=cray_compute
#PBS -l place=scatter
#PBS -o ngc_2_1_1.batch-log
#PBS -V

. /opt/modules/default/init/sh

cd $PBS_O_WORKDIR

module load namd/2.12/gpu-8.0

echo ------------------------------------------------------
echo -n 'Job is running on node '; cat $PBS_NODEFILE
echo ------------------------------------------------------
echo PBS: qsub is running on $PBS_O_HOST
echo PBS: originating queue is $PBS_O_QUEUE
echo PBS: executing queue is $PBS_QUEUE
echo PBS: working directory is $PBS_O_WORKDIR
echo PBS: execution mode is $PBS_ENVIRONMENT
echo PBS: job identifier is $PBS_JOBID
echo PBS: job name is $PBS_JOBNAME
echo PBS: node file is $PBS_NODEFILE
echo PBS: current home directory is $PBS_O_HOME
echo PBS: PATH = $PBS_O_PATH
echo ------------------------------------------------------

EXEC=/home/apps/namd/2.12/gpu/8.0/[Link]/namd2

RUN_DIR=$PBS_O_WORKDIR/gpu_out/run.${PBS_JOBID}

mkdir -p ${RUN_DIR}
cp gpu_input/* ${RUN_DIR}

cd ${RUN_DIR}
ln -s ${EXEC} .

time aprun -n 80 -N 40 ${RUN_DIR}/namd2 [Link] > $


{RUN_DIR}/[Link]

Common questions

Powered by AI

The 'aprun' command is used to launch the application across multiple compute nodes, specifying how many tasks to run (`-n 80`) and how many tasks per node (`-N 40`). Its significance lies in its ability to efficiently distribute computational work, essential for parallel processing in high-performance computing environments .

The 'qsub' command submits jobs to the PBS queue. It is responsible for setting up the job according to specified resources, queue priorities, and environment configurations, ensuring proper execution in PBS-managed clusters .

The 'scatter' place directive in the PBS script is used to distribute the job's tasks across different compute nodes to optimize resource usage and minimize contention. This ensures each task runs on a separate node, leveraging distributed computing efficiently .

In the PBS script for CPU nodes, the resource allocation directive is specified as `#PBS -l select=2:ncpus=40:vntype=cray_compute`, indicating the job will use 2 compute nodes each with 40 CPUs. In contrast, for CPU+GPU nodes, the directive is specified as `#PBS -l select=2:ncpus=1:accelerator=True:vntype=cray_compute`, which suggests that the job will use 2 nodes with 1 CPU per node and GPU accelerators enabled .

For CPU nodes, the NAMD job uses the executable located at `/home/apps/namd/2.12/intel/18.0.1/CRAY-XC-intel/namd2` with all tasks running on CPUs specified with `-n 80 -N 40`. In contrast, the CPU+GPU nodes use a GPU-capable executable at `/home/apps/namd/2.12/gpu/8.0/CRAY-XC.cuda.arch/namd2`, indicating it leverages GPU resources for computation .

The different environment modules loaded (`namd/2.12/intel-18.0.1` for CPU and `namd/2.12/gpu-8.0` for CPU+GPU) suggest that the underlying software optimizations differ based on the computational resources available. The CPU version is likely optimized for Intel's architecture, while the GPU version is adapted to utilize CUDA cores, thereby exploiting GPU parallelism .

The PBS script uses the directive `#PBS -V` to import the user's current environment variables into the job's runtime environment. This maintains consistency across compute nodes, ensuring that all necessary variables are correctly set .

Running NAMD simulations on CPU+GPU nodes can significantly enhance performance due to the GPUs' ability to handle parallel tasks concurrently, which is especially beneficial for molecular dynamics. CPUs, while versatile, cannot match the parallel processing power of modern GPUs, potentially resulting in slower overall execution times .

Logging information, such as job execution details and environment variables (e.g., `PBS_JOBID`, `PBS_O_WORKDIR`), helps track job performance and monitor resources. This can be crucial for debugging and optimizing job submissions over distributed computing environments .

Creating a symlink for the NAMD executable in the run directory (using `ln -s`) simplifies the invocation of the executable, allowing for easier management of the file structure and portability across different run environments. This approach avoids multiple copies of the large executable across directories .

You might also like