Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Practical Introduction to Computational Science: Homework 2, Assignments of Chemistry

Instructions for running a job on a hpc environment using the gaussian03 software package, and modifying the input file and job submission script for parallel processing. It also includes an exercise for compiling and modifying the molecular dynamics program.

Typology: Assignments

Pre 2010

Uploaded on 09/02/2009

koofers-user-p1f
koofers-user-p1f 🇺🇸

5

(1)

10 documents

1 / 6

Toggle sidebar

Related documents


Partial preview of the text

Download Practical Introduction to Computational Science: Homework 2 and more Assignments Chemistry in PDF only on Docsity! chem 3902 & engr 2400 “Practical introduction to Computational Science” Homework 2 due date: 13th February at 18:00 February 7, 2009 1 Running a job on markov.cmms.pitt.edu This exercise involves preparing a calculation to run in a HPC environment, extract- ing output and modifying the input to rerun the job. It is designed to make you more comfortable using commands on the command prompt and editing files. 1.1 Running a job and extracting some simple output Create a directory called hw2 in your home directory on markov, and copy the file /tmp/chem3902/hw2/hw2 q1.tar.gz into this newly created directory. Unpacking hw2 q1.tar.gz creates a directory called q1 with an input file called water1.inp. water1.inp is an example of an input file for the software package Gaussian03. We will not be concerned with the science behind the algorithms in Gaussian03 ; this program is only being used as a test program for running a calculation in a HPC environment. In a HPC cluster, the hardware resources have to be shared amongst many users. This sharing of resources is managed by a queue program. Jobs are submitted through the queue program interface and it directs the job to run on an available resource. 1 The first step to submitting a job is to prepare a job submission script. This job submission script is then submitted to the queue program. For Gaussian03 jobs, this is carried out using the command G03pbs. Prepare the job submission script with the following command: $ G03pbs water1.inp small_io test1 This should prepare a job submission script called test1.batch. Submit this job to the queue with the following command: $ qsub test1.batch Your job will take a few minutes to start, but then a job output file, called water1.inp.log should appear in the directory. You can monitor the progress of your job using the command $ tail -f water1.inp.log (hit Control-C to exit this command) and view your job in the queue with the command $ pbstop -u me (hit the key q to exit this command). You will know that your job has finished successfully when a line beginning with the following text: Normal termination of Gaussian 03 at is printed at the very bottom of water1.inp.log. The job should take less than five minutes to complete after it begins. Extract the energy resulting from the calculation by using the grep command on the output file with the text pattern Done. Refer to the man page for grep for more information on how to use this command. Redirect the output from the grep command to a file called q1 output in your hw2/q1 directory. The line of water1.inp.log with the energy should begin with the text SCF Done, and the energy will be about -458 A.U.. Record the exact energy in q1 output. Search through the output file water1.inp.log to find out the number of α and β electrons used in the calculation. Use either the grep command, or the search facility within pico (control-W). Write out the number of α and β electrons in the second line of q1 output. Examine the job submission script test1.batch and record the absolute path location of the Gaussian03 executable g03 in the file q1 output. 2 further information: Compiling with the -c flag compiles the individual subprograms (subroutines, modules and functions), but does not link these subpro- grams up to form the executable. The compilation has to be carried out again, with all source code files included on the command line. NB a shortcut to typing this all out was mentioned in class. This second compilation links all the subprograms units together to form the executable program. The -o flag renames the executable. Having successfully compiled the program (i.e., the file MD should now exist in src, run the program by changing into the run directory, i.e., $ cd ../run (from src) and submit the job to the queue program by using the job submission script md.batch in run. NB this job will only run correctly if you have successfully compiled the exe- cutable in src. The job should take less than 5 minutes to complete. Upon completion, there should be several files in the directory beginning with fort., and a file called output. View the contents of the output file, and search for two output properties: (i) the pressure of the system, and (ii) the final total energy of the system. Record both values in a file called q2 output in your hw2/q2 directory. 2.2 Modifying the job input The file called fort.15 was used to hold the input data for the simulation. The contents of this file were read into the program when it started up. A couple of parameters, or settings, in this file are to be modified and the job resubmitted. Change the temperature of the simulation from 0.728 to 0.85, and the maximum time limit of the simulation from 5. to 100.. Before resubmitting the calculation, you will have to modify the job submission script, md.batch so that the old output file (output) is not overwritten. Change the name of the output file (i.e., the one to the right of the redirection operator, >) to output 2. Submit the calculation and, when it is finished, view the output file output 2 and record the new values for the pressure and the final total energy in q2 output. 2.3 Modifying the source code A slight modification is now going to be made to one of the source code files. The code will then have to be recompiled for the change to be implemented, and the program rerun to show the new output. 5 The source code modification is very simple. The value of two variables is to be printed to output. To make the modification, enter following line in near the bottom of the source code file md.f90: PRINT *, " nstep10, nstep ", nstep10, nstep This line should appear after the statement: CALL STORE(21) and before 99001 FORMAT Recompile the code in src following the directions given in Section 2.1. Now rerun the code, first modifying the job submission script so that the output is redirected to a file called output 3. Run the calculation by submitting the job to the queue. When the job is finished, inspect output 3, and copy the values for printed nstep10 and nstep into the file q2 output. These are the final values for these variables, as this is the end of the program. 2.4 Summary After carrying out this exercise, you should have a file called q2 output in a directory called hw2/q2 in your home directory. This file should contain 5 lines with the following answers: 1. The pressure from the simulation carried out with the initial settings in fort.15 (with temp set to 0.728 and tmax set to 5.. 2. The energy from the simulation carried out with the initial settings in fort.15 (with temp set to 0.728 and tmax set to 5.. 3. The pressure from the simulation carried out with the modified settings in fort.15 of temp set to 0.85 and tmax set to 100. 4. The energy from the simulation carried out with the modified settings in fort.15 of temp set to 0.85 and tmax set to 100. 5. The final values of the variables nstep10 and nstep at the end of the program. 6
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved