Advertisement
Guest User

Untitled

a guest
Apr 1st, 2018
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.96 KB | None | 0 0
  1. Submissions for COMP10002 Assignment 1
  2. Instructions for submitting programming projects using the submit and verify systems.
  3. Note, you will need to install the University's VPN software in order to connect to dimefox from outside the University network (that is, from home).
  4.  
  5. Everyone Read This First!
  6. There are two machines involved:
  7. The machine your file is on (might be the shared drive accessible from the lab computers, might be your own PC, might be your own Mac machine); and
  8. The server that you run submit on, and that we compile and test your programs on.
  9. So there are two steps that need to be performed:
  10. The COPY step: Copy your file over to the submit machine; and then
  11. The SUBMIT step: Login (in a terminal shell) to the server and run the submit command.
  12. How you do these two steps depends on what kind of machine you are on. But everyone has to do the two steps.
  13. There are system-dependent differences between the gcc on the lab computers and the gcc on the server. In particular, the server is very unforgiving of uninitialized variables. If your program fails on the server, look carefully for this kind of bug.
  14.  
  15. Don't forget the -lm on the end of the compilation line if you have used functions from the math library. There might also be some small differences in the availability of functions like strncmp() and etc for string handling. You are strongly advised to compile your program on the server and test it as a routine part of your development. Only then will you have the confidence that it will work correctly when we test it. Use a normal gcc command (with -lm at the end if you need the math library) while you are connected, and then execute the compiled program on that machine with some suitable data.
  16.  
  17. After you submit, wait for a few minutes, and then, before you disconnect from the server, verify your submission, to make sure that your program compiled smoothly and has executed on the first set of simple test data. (We will re-run all of the programs again after the due date, using further test data; you will not be able to access that test data in advance.)
  18.  
  19. A complete transcript of a session from a Mac appears below, there are only minor differences between this and what you would see on a PC, and the commands that are typed to the dimefox: prompt are completely independent of which machine you started at.
  20.  
  21. It is assumed throughout that your source program is in a file assmt1.c. In the submit and verify commands, the first argument must be comp10002 and is case-sensitive; and the second argument must be a1, the name that is being used for this particular project. The third argument to submit is the name of your program, and must be the C source file (not the executable).
  22.  
  23. You can submit as often as you like. Indeed, the more frequently you lodge a submission, the better off you will be if you have a disaster and would like to recover a previous version of your program. Submitting once a day is not at all unreasonable. And the sad truth is, most of the people who stuff things up at the last moment do so because they are floundering around trying to understand what they are supposed to be doing. Practice in advance...
  24.  
  25. From a PC, including the Lab machines
  26. 0. Install the PuTTY and pscp programs from here. They are already installed on the lab computers, find them in the menus or use Explorer to locate them.
  27. 1a. From your home PC or your own laptop: do the COPY step using pscp, by starting up a cmd shell (like you did to compile the program), cd'ing to the directory that has your assmt1.c file in it, and typing
  28.  
  29. pscp assmt1.c my-username@dimefox.eng.unimelb.edu.au:
  30. (don't miss the final colon, it is required). You might get asked to accept an encryption key (type "yes"), and will need to type your University password. The file will then copy over to your home directory on the server. Note that if you have downloaded pscp and PuTTY, they are probably just sitting on your Desktop. They need to be moved to a place where they can be executed, either a folder that is in your path, or into (perhaps via a shortcut) the directory where you have your C programs.
  31. 1b. On a lab machine: your files are on the shared drive, and are already accessible from dimefox. All you have to do when you login to dimefox is navigate to the right place using cd commands.
  32. 2. The SUBMIT step is done by using PuTTY to remote login to one of the student servers. Use "All programs > Network Apps > PuTTY > PuTTY" on the lab machines, or the location that you placed it on you home computer (perhaps the Desktop), to start PuTTY running. On your home computer, it may be necessary for you to "accept to execute a program that has been downloaded from the internet" first, and note again, this will not work at home if you haven't installed and started the University VPN, instructions here.
  33.  
  34. A dialog box will open, type dimefox.eng.unimelb.edu.au as the "destination you want to connect to", and check that the "Port" is set to 22. Then click the "Open" button, and wait for a connection to be established; click "Yes" to accept the server's host key if you get asked. If dimefox is unavailable, try nutmeg, they are equivalent and all share the same file systems. (You can always use either of these machines, dimefox is used here as the example for consistency only.)
  35.  
  36. You will then be issued with a login prompt; type your University username and University password to connect to the Unix server.
  37.  
  38. Once you have logged in, check that your file is indeed sitting there waiting to be submitted (use the command ls), check that it compiles and executes cleanly on the server (use gcc and etc), and then type the submit command:
  39.  
  40. submit comp10002 a1 assmt1.c
  41. Wait for a few minutes, and then carry out the verify and check steps:
  42. verify comp10002 a1 > receipt-a1.txt
  43. more receipt-a1.txt
  44. Look through receipt-a1.txt carefully to make sure that (a) your program compiled; (b) it executed on the single initial test file; and (c) that the listing that is shown is the right version of your program.
  45. You have to have a network connection to make all of this work, of course!
  46.  
  47. Then, logout from the server using logout, and exit PuTTY if it doesn't close by itself.
  48. From a Mac (and Linux)
  49. It's only a little different. Remember, this will not work outside the University's network if you haven't installed and started the University VPN, instructions here.
  50. Linux users should look here for guidance on installing the VPN.
  51.  
  52. 1. To do the COPY step, start a terminal window ("Terminal" on a mac), then navigate to the directory that contains your file, then execute a scp command (already installed on a Mac as a standard tool):
  53.  
  54. scp assmt1.c my-username@dimefox.eng.unimelb.edu.au:
  55. (don't miss the final colon, and don't forget that you need to cd to the right directory first). Type your University password when prompted for it.
  56. 2. Then to do the SUBMIT step, you stay in the terminal window, and use ssh to create a network terminal connection through to the server:
  57.  
  58. ssh my-username@dimefox.eng.unimelb.edu.au
  59. (without a final colon) and then once you have typed your University password (and typed "yes" if it asks you to accept the encryption key) everything you type in that window is being executed on the server. So now you can check that your file is there by using ls, compile it using gcc, and presuming that it is all ok, run the submit command:
  60. submit comp10002 a1 assmt1.c (Note: '1' in "a1" here is digit 1, not letter l)
  61. followed a few minutes later by the verify and check steps:
  62. verify comp10002 a1 > receipt-a1.txt
  63. more receipt-a1.txt
  64. Then, logout from the server using logout; you can then close the local terminal window that you were using.
  65.  
  66. From A Home Computer
  67. It is exactly the same, except that before you can use ssh or scp, you need to have installed the University's VPN (virtual private network) software, see the instructions linked from here.
  68. Complete Transcript
  69. With a few liberties shown, here is a complete transcript for a person whose login name is uname, showing the steps to be followed on a mac, assuming that they have installed the VPN (or are on a lab computer). From a PC, pscp will have been used to do the COPY step rather than scp. Note that this careful user is checking that their program compiles and executes on the server before doing the submission. Submissions that don't compile will be heavily penalised.
  70. You can also see a similar submission sequence as part of one of the lecture recordings.
  71.  
  72. mac: cd comp10002/a1
  73. mac: ls
  74. assmt1.c
  75. assmt1
  76. test0.txt
  77.  
  78. mac: scp assmt1.c uname@dimefox.eng.unimelb.edu.au:
  79. uname@dimefox.eng.unimelb.edu.au's password: XXXXXXX
  80.  
  81. mac: scp test0.txt uname@dimefox.eng.unimelb.edu.au:
  82. uname@dimefox.eng.unimelb.edu.au's password: XXXXXXX
  83.  
  84. mac: ssh uname@dimefox.eng.unimelb.edu.au
  85. Do you wish to accept security key: yes
  86. uname@dimefox.eng.unimelb.edu.au's password: XXXXXX
  87.  
  88. dimefox: ls
  89. assmt1.c
  90. test0.txt
  91.  
  92. dimefox: gcc -Wall -o assmt1 assmt1.c -lm
  93.  
  94. # Note: need the -lm at the end
  95.  
  96. dimefox: ./assmt1 < test0.txt
  97.  
  98. # Should see the same output that you got on your own computer
  99. # if not, you have a bug, look first for uninitialized variables
  100.  
  101. dimefox: submit comp10002 a1 assmt1.c
  102. This is part of the legacy submit system.
  103. Connecting to dimefox.eng.unimelb.edu.au ... OK
  104. Monday 26 March 2018 09:10:57
  105. Your submission is continuing in the background.
  106. Don't forget to VERIFY later.
  107.  
  108. # wait for a few minutes
  109.  
  110. dimefox: verify comp10002 a1 > receipt-a1.txt
  111. This is part of the legacy submit system.
  112. Connecting to dimefox.eng.unimelb.edu.au ... OK
  113. dimefox: ls
  114. assmt1
  115. assmt1.c
  116. test0.txt
  117. receipt-a1.txt
  118.  
  119. dimefox: more receipt-a1.txt
  120.  
  121. # look carefully at this file to check that:
  122. # (a) you submitted the right program;
  123. # (b) that the program compiled properly, and
  124. # (c) it then executed correctly on the simple test data that was used
  125.  
  126. dimefox: logout
  127. Connection to dimefox.eng.unimelb.edu.au closed.
  128.  
  129. mac:
  130. Drafted by Alistair Moffat.
  131. Last updated on 26 March 2018 by Jianzhong Qi, jianzhong.qi@unimelb.edu.au
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement