Autolab
Details on Autolab, which will be used for all homework submissions in CSE 331.
The main link
You can access Autolab via https://autograder.cse.buffalo.edu/ . We will be using Autolab for submission and (auto)grading of CSE 331 homeworks.
Signing up
Follow these steps to setup an account on Autolab (unless you already have one in which case you'll use your existing account):
- Go to this page and click on the Sign in with MyUB link . A new account will automatically be created for you.
- By default, AutoLab will use your official UB first and last name. If you have a different preferred name, please let us know ASAP.
- We will have leader boards for all the programming assignments. For anonymity, all students are identified by their chosen nicknames. So please make sure you pick an appropriate one (you can change your nickname at any point of time).
- After you have done the above steps, you wait.
What happens next
Here are the steps that we need to take at our end:
- We will upload a list of UB emails of students registered in the course (students cannot register themselves in a course). After that, you can just login into AutoLab using MyUB and you should see the CSE 331 course.
- If you successfully completed your syllabus quiz, you will be added to the
Y
section. Otherwise you will be added to theN
section. - Once you have successfully completed your syllabus quiz, you should be moved to the
Y
section: if this does not happen within two days of you completing the syllabus quiz, you should send us a reminder. - We will only release the grades for section
Y
.
In the steady state
Here are the various things to keep in mind once you are successfully added to the course on Autolab:
- Once you log in to the system (after creating your account), you will see all the courses for which you have
been registered. CSE 331 should appear with the description
CSE331: Algorithms and Complexity (s20)
. - Once you go to the course web page for CSE 331, you will see a list of pending homeworks. To begin with you should one box for Homework 0 and one link each for Question 1 part (a), another for Question 1 part(b) and another for Question 3. (You will need to click on each Question and submit your solution on the corresponding page.) As you move along in the semester, you will also see completed assignments/homeworks.
- For each homework, there will be five submissions/questions for each homework.
- The interface is reasonably intuitive but make sure you explore and make yourself comfortable with the interface- you will be spending quality time with it this semester!
- For the autograded question, to see the feedback you will need to click on any of your scores.
Autolab Walkthrough
An Old walkthrough video
The walkthrough video is from last year and has some comments (e.g. C++
submission only becoming available from HW 1 onwards) that would not be valid for you this year. However, the rest is still fine and it should be enough to get you started with submitting on Autolab.
Version of programming languages on Autolab
Java
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
Python
Python 3.6.5
C++
g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
If you plan to use C++
Use Java or Python if you are just as comfortable
We recommend that you use Java
or Python
if you are as comfortable with any of those languages as C++
. We are not passing any judgment on the merits or demerits of any of the languages here but our recommendation is based on the fact that the compilers/interpreters of Java
and Python
are standardized across various platforms. In particular, if your Java
or Python
code runs fine on your machine, then it should work fine on Autolab as well as long as the version on your machine is compatible with the versions used on Autolab (see above). Unfortunately, there is no such guarantee with C++
.
If on the other hand, you have a strong preference for C++
, then read on!
What is the issue with C++ compilers?
The main issue as alluded to above is that there is no notion of standardized C++
compiler across all platforms: i.e. two different C++
compiler can behave completely differently on the same code (e.g. in one case it won't compile and in other it would complie and it would run without any issues). The issue is compounded by the fact that even if one is using g++
, which is what we recommend, you might not get what you want. E.g. if you run g++
on mac, it will actually run clang
, which is a different compiler.
What this mean unfortunately is that we cannot really provide support for C++ across all compilers. You can use your own C++
compiler but then you have to deal with making sure your code runs fine on Autolab too.
Our recommendation
Use a VM with g++ installed for Ubuntu
We recommend that you install a VM that runs g++
on Ubuntu. In particular, we recommend that you use Jaric Zola's VM system that he created for his CSE 250 course . If you have questions on Jaric's setup, please do NOT contact him: email cse-331-staff@buffalo.edu
instead.
If you still prefer using your own system, we would still recommend that you test your code in the VM system above before submitting to Autolab.
Some comments on the instructions in Jaric's setup
Below are some comments that are hopefully helpful:
- He is not kidding about the time it takes for the initial deployment. Make sure you have a good hour or two dedicated for this. (It's mostly idle time waiting for things to happen, so you can safely multiplex the deployment with other work.)
- A clarification where the files in the
/vagrant
directory. In the VM, the/vagrant
directory will have exactly the same contents as that in the directory where you clone thegit
repo.
If you plan to use Java
Use the terminal
We recommend you use the instructions for compiling and running your program in the terminal. If you would like to use an IDE, attached below are setup instructions for IntelliJ IDEA. In addition, there is some information about Eclipse in the FAQs.
Instructions for setting up your project for IntelliJ: (If you are on a mobile device you may have to scroll right, down, or both on the images)
- Select Add Configuration.
- Press the tiny + on the top left to add a new configuration. Select Application from the dropdown.
- Select the Project SDK in Project Structure, make sure it is version 12.
- Select the output path, ideally the same as your root source directory.
- In Modules, mark your working directory as a source.
- Select the ... in the choose main class field, and double click on the presumably auto-detected main Driver class.
- Don't forget to add the testcases/inputx.txt in the program arguments field.
- Happy coding!
Dealing with Errors
Unexpected token error
: This usually happens when your code exceeds the global 180 second time limit for all testcases. Look forAutodriver: Job timed out after 180 seconds
in the feedback. If you don't see this as part of the feedback please contact the course staff.UnicodeDecodeError
: This is most likely because you have a non-ASCII character (or more) in your code. First double check that you submitted a source file and not a binary. If the error persists, run this Python script on your Solution file by executingpython3 validate_ascii.py <filename>
. This will print the line numbers with non-ASCII characters in your code, which you should then remove.
Description of Thresholds
Your solution times out if it crosses a certain threshold as noted in the Autolab feedback. The way it works is as follows: we run our code and multiply our time with the corresponding threshold factor for the input to get the final threshold. Thus your solution will be within the threshold if it is slower relative to the optimal solution by at most the corresponding factor. For example, a threshold factor of 40 for input 1 means your code can be atmost 40 times slower than our optimal solution. These threshold factors tend to be used for pretty much all the programming questions, though sometimes, we end up changing them depending on the problem etc.
Frequently Asked Questions
- How often can I submit my answer for any question on Autolab? +
-
You can submit as many times as you want before the deadline. Autolab will take your latest score for Q3, and we'll grade your latest submission for Q1 and Q2.
- How can I look at the feedback I receive on Autolab? +
-
For question 1, you can click on any of the scores for a submission (usually available within a few minutes). For question 2, the grades and feedback will be released manually and you'll be notified by a Piazza post. Once the grades are released, you'll be able to open your submitted file and look at the grader's feedback.
- Why can't I see my printouts in the Autolab feedback? +
-
Print statements are disabled on Autolab for security reasons. However, You can print and run your code locally before submitting to Autolab.
- How can I tell if my code is timing out on Autolab? +
-
Autolab feedback will let you know if your code exceeds a threshold time for a testcase. However, if your code exceeds the global 180 second time limit (for all testcases), then the feedback maybe cut off. In that case, it is recommended that you submit your code to run on fewer testcases to figure out the bottleneck.
- What do the textfields
MaxInputs
,Sources
, andCollaborators
mean? + -MaxInputs
is only relevant to the third (programming) question, where you can specify the number of testcases you want the Grader to test your code on (for partial credit). This is especially useful if your code times out if you run it on all 10 inputs.Sources
andCollaborators
applies to all assignments and their use is outlined on the Homework Policy page.
Java Specific
- How do I import my project to Eclipse? +
-
Select
File > Open Projects from File System...
then select the directory you wish to open. - How do I run my project with arguments in Eclipse? +
-
Right click the Class you wish to run (in 331's case it will be Driver) and select
Run As > Run Configurations
and the Run Configurations window will open. Make sure that in the left column of the window the desired class is selected underJava Applications
. Select theArguments
tab, then write any arguments in theProgram Arguments
box you would like to include, then clickApply
(arguments should be separated by spaces).