Autolab
Details on Autolab, which will be used for all homework submissions in CSE 331.
The main link
We will be using the UB CSE extension to Autolab for submission and (auto)grading of CSE 331 homeworks. You can access Autolab via https://autolab.cse.buffalo.edu/ .
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 . If you do not already have an account, a new account will automatically be created for you (and you might have to fill in some details)..
- I believe Autolab should now be using your preferred name instead of your official UB first and last name. If this is not the case, 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 in time).
- After you have done the above steps, you wait.
What happens next
Here are the steps that we need to take on 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 your UB login credentials 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 one week 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 (s24)
. - Once you go to the course web page for CSE 331, you will see a list of pending homeworks. To begin with, you
should see one box for
Quiz
and one link forSyllabus Quiz
. As you move along in the semester, you will also see completed assignments/homeworks. - There will be five submissions/questions for each homework (except Homework 0, which is optional).
- The interface is reasonably intuitive but make sure to explore and get yourself comfortable with the interface - you will be spending quality time with it this semester!
- For the autograded questions, you will need to click on any one of your scores to see the feedback.
Autolab Walkthrough
Thanks to Caleb Levine for the walkthrough video on how to submit your HW solutions to 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 a standardized C++
compiler across all platforms: i.e. two different C++
compilers can behave completely differently on the same code (e.g. in one case it won't compile but in the other it will compile and run without any issues). This 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 means 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
If you do not follow one of our recommended C++ setups, you are on your own
We have one recommended option (see below). You are of course welcome to use your own system but if you do so, we will not be able to provide ANY help.
We present two additional options for you to code in C++ that have worked reasonably well in the past years but unfortunately, we will not be able to provide support for these options either-- sorry!.
In previous years students have reported that our C++ template code (as is) would not run on their own C++ setup (typically an IDE). If this happens we cannot help you figure out how to modify the template code on your machine.
A Clarification
Students in the past offerings of CSE 331 have done fine using C++ for their submissions. And we are more than happy to look at your C++ code in your favorite IDE in case it is not working there and help debug algorithmic issues with your code!
The issue is we won't be able to give support if
- Your C++ code works perfectly fine in your own setup but say fails to even compile on Autolab. This can happen (as mentioned above) since C++ compilers in different environments unfortunately tend to work pretty differently and since this is not a programming course we want to give preference to help with algorithmic issues.
- The template code does not compile in your C++ setup. Again, here we won't be able to help you modify the template so that it can load/compile in your C++ setup. In previous years some students have been able to modify the template code a little bit (sometimes as simple as moving some lines of code around) to make it work. Of course you are more than welcome to figure this out on your own (and if you are able to do so, feel free to share your hacks on piazza).
Finally, any extra work that you have to do with C++ you should only have to do once-- if you are able to say submit HW 0 in C++ using your setup you should be OK with the rest of the assignments (though this has tended to happen in most cases we cannot guarantee this for everyone, again, because different C++ compilers tend to work differently).
We recommend the following to go about coding in C++ for CSE 331:
- We recommend that you use a departmental server by
ssh
ing into it:Use a departmental server
Login to one of the departmental servers accessible by students and then run your code in there. Pick one of the servers that are described as
General compute server for short, interactive timeshare jobs
.timberlake.cse.buffalo.edu
is one commonly used by students.Unlike the VM options, you will need Internet to access the servers. Also unlike our first recommended option, the environment on departmental servers will not match the one on Autolab exactly but we do not expect this is to an issue.
If you still prefer to use your own system, we would recommend that you still test your code on a departmental server above before submitting to Autolab.
Use the VM options at your own risk!
Again, a reminder that we unfortunately cannot provide support for the VM options below. We are mentioning these just in case you already have used Linux VMs on your machine.
Here are couple of options that used to work in the past. As mentioned earlier, we unfortunately cannot provide support for these options but in case you are already familiar with either of these options, then you can try your luck!
- This option is the best option until Fall 2021 since the Virtual Machine (VM) image matched the system being run on Autolab:
Use the VM image used in CSE 220
We recommend that you use the Fall 2021 VM image used in CSE 220 that was maintained by Ethan Blanton .
If you have questions on Ethan's setup, as mentioned earlier, we cannot provide help. Please do NOT contact Ethan either: since he no longer maintains the VM.
One big drawback is that virtual machines might not work well on the latest Apple machines. If this is true for you, please use the next option.
Using VM image on Windows
If plan to run the VM on Windows then we recommend that you run it using Virtual Box (and not VMWare). Here is a walkthrough video by Nick Minor on installing the VM on Windows using VirtualBox:
Using VM image on MacOS
Unfortunately, it looks like VirtualBox does not work that well on MacOS.
In the meantime, using VMWare on MacOS might be the only option. If you already have a VMWare license that lasts until the semester ends, then you should be all set. Otherwise, you will have to pay for the license yourself if you want to use VMWare. Unfortunately the department cannot provide you a VMWare license.
.Some comments on the VMWare option
The comments below are based on testing in Fall 21 on a Mac machine (Big Sur OS), though most of the comments below should be OK for installation on a Windows machine as well:
- The
ova
that you need to download is big and depending on your Internet speed might take time. Also the initial setup of the VM takes time -- this is because you are basically setting up a new Linux machine on your machine! Be prepared for the overall process to take a couple of hours. (It's mostly idle time waiting for things to happen, so you can safely multiplex the deployment with other work.) -
Do not try to share folders
If possible, use the VM as if it were an independent machine: i.e. download the coding templates using the browser in the virtual machine, create and test your code in the VM and then submit to Autolab using the browser in the VM.
If for some reason you really want to share folders/files between your machine and your VM, it might mean extra work. Here are some starting points (again based on testing on mac):
- You need to enable sharing folders:
- For
Windows
machines, use these instructions . - For
MacOS
machines, use these instructions .
- For
- At least in our testing on Mac, the shared folder did not show up in
/mnt/hgfs
. To fix this, use these instructions .
- You need to enable sharing folders:
- The
- Until Fall 19, this was our main recommended option but this has not been updated for a while. We think it should be OK to use this option but your mileage might vary.
Use a VM with g++ installed for Ubuntu
You should 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: emailcse-331-staff@buffalo.edu
instead.If you still prefer to use your own system, we would recommend that you still 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 about the files in the
/vagrant
directory: in the VM, the/vagrant
directory will have exactly the same contents as the directory where you clone thegit
repo.
Running HW C++ template code on Linux
Running C++ HW template code on Linux
Here is a walkthrough video by Nick Minor on on running HW 0 C++ template code on Linux:
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, setup instructions for IntelliJ IDEA (from Fall 19) are given below. 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 and 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 one or more non-ASCII characters 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.- If the above does not work check to make sure that the text that you are entering in the textfields
Sources
andMaxInputs
during submission do not have any non-ASCII characters either (since that also results in a similarUnicodeDecodeError
).
- If the above does not work check to make sure that the text that you are entering in the textfields
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 at most 40 times slower than our optimal solution. These threshold factors tend to be used for pretty much all the programming questions, although 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 3, you can click on any of the scores for a submission (usually available within a few minutes). For questions 1 and 2, the grades and feedback will be released manually and you'll be notified through 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 run and print 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 may be 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).