• No results found

Communicating with KillDevil: Transferring Files, Starting

In document Crizer_unc_0153D_16697.pdf (Page 148-152)

CHAPTER 5: A PROGRAM TO CALCULATE THEORETICAL

5.3.4 Communicating with KillDevil: Transferring Files, Starting

The first step in getting the Gaussian calculations ready to run is to transfer the input files to the KillDevil supercomputer. To accomplish this, the first task is to place all the

Gaussian input files in an archive file (tarball) (Figure 5.11). This section of code is again a Unix command line input and functions just like the other command line inputs previously discussed.

Figure 5.11. Creating a tarball (archive of files, similarly to a zipped folder of files)

Next another Perl module, Net::OpenSSH, is used to transfer files securely from our local computer to the KillDevil supercomputer using the section of code in Figure 5.12. The first line of this code (line 136) assigns a variable to the supercomputer host ($host). The username of the user ($user), and the password for the user’s account ($password) are taken from user input via the graphical user interface. The next two lines (137-138) assigns variables for the location on our computer where the archived file is currently located ($local_path) and the location of where to place the archived file on the supercomputer ($host_path). Line 139 of the code initializes the Net::OpenSSH module and gives the modules information about the host, the username, and the password for that username. The next to last line of code (line 140) tells the Net::OpenSSH module to securely copy the archived file from the local path (user’s computer) to the remote path (KillDevil

supercomputer). The final line of code (line 141) in this section just tells the program to print an error message to the screen if the transfer of files does not happen correctly.

Figure5.12. Secure copy of files from user’s computer to the KillDevil supercomputer

Now that the archived file of Gaussian input files has been moved to the KillDevil supercomputer the files then have to be unarchived to be able to use them. To communicate

with the KillDevil supercomputer another Perl module, Net::SSH::Perl is used. Figure 5.13 contains the section of code needed to unarchive the Gaussian input files and to move them to a new location to start Gaussian calculations. All lines of code in this section submits a command to run on the KillDevil supercomputer command line. Line 148 makes a new directory to place the Gaussian input files in. The second line (149) moves into the new directory and then unarchives the Gaussian input files. With the third line of code (line 150) these unarchived input files are moved into the directory where the Gaussian calculations will be run. Finally, the last line of code (line 151) moves the specific Gaussian input files to use to the appropriate directory. This last line of code is necessary due to the way in which the Gaussian input files were created. This was done by creating multiple text files that end in “.com”; however, calculations only need to be run on a subset of files that end in “.com”.

Figure 5.13. Commands to move Gaussian input files to appropriate directory on KillDevil

The next step is to submit all of the Gaussian input files to begin calculations. To do this a shell script, courtesy of Dr. Shubin Liu, is used that finds all the possible Gaussian input files and then executes a command on the KillDevil supercomputer command line to start each of these calculations (Figure 5.14). The first line of this code (line 3) lists all the files in the current directory and then copies all of the file names that end in “.com” to a file list. The rest of the code (lines 6-11) is a loop that goes through this list and then submits a command to the KillDevil supercomputer command line that starts a calculation for each input file.

Figure 5.14. Shell script to start Gaussian jobs on KillDevil

The final step in communicating with the KillDevil supercomputer is to monitor the progress of the calculation submitted to run and keep the program from moving forward until all calculations are finished (Figure 5.15). This is done via communicating with the KillDevil supercomputer using the Net::SSH::Perl module. The first line of code (line 165) submits a command to the KillDevil supercomputer command line that lists all the jobs currently running and prints it to file (output2.txt). The next section of the code is a loop that

continuously runs. Line 167 makes the loop hold for five minutes which is necessary so that the program isn’t constantly accessing the KillDevil server. The loop first deletes the file output2.txt (line 169) and then submits the command to list all the jobs currently running while printing to that output2.txt file (line 170). This file is then securely copied from the KillDevil supercomputer to the local computer where it is read (lines 171-175). This loop of code keeps running until that file of list of jobs currently running (output2.txt) is read to be empty which is what the “-Z” command in the last line of code does (line 176). At that point all calculations have finished running and the program can move on to the next step.

Figure 5.15. Communicating with KillDevil to determine when the calculations have finished running

Now the first series of Gaussian calculations has finished running. The next step is to extract the optimized geometries from the output files (.log) to set up next series of calculations to run at the next level of theory.

In document Crizer_unc_0153D_16697.pdf (Page 148-152)