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://autograder.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):

  1. Go to this page and click on the Sign in with MyUB link . A new account will automatically be created for you.
  2. 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.
  3. 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).
  4. After you have done the above steps, you wait.

What happens next

Here are the steps that we need to take on our end:

  1. 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.
  2. If you successfully completed your syllabus quiz, you will be added to the Y section. Otherwise you will be added to the N section.
  3. 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.
  4. 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:

  1. 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 (f22).
  2. 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 for Syllabus Quiz. As you move along in the semester, you will also see completed assignments/homeworks.
  3. There will be five submissions/questions for each homework.
  4. 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!
  5. For the autograded questions, you will need to click on any one of your scores to see the feedback.

Autolab Walkthrough

An Old walkthrough video

This walkthrough video is from Fall 2017 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 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 present three options for you to code in C++. You are of course welcome to use your own system but if you do so, we will not be able to provide ANY help.

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.

We recommend three ways to go about coding in C++ for CSE 331, sorted in what we recommend most to least (though the second and the third options should work OK):

  1. This option is the best one since the Virtual Machine (VM) image matches the system being run on Autolab:

    Use the VM image used in CSE 220

    We recommend that you use the VM image used in CSE 220 that is maintained by Ethan Blanton .

    If you have questions on Ethan's setup, please do NOT contact him: email cse-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.

    The only potential 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 Fall 2022 onwards, we recommend that you rub 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. We're looking into fixes.

    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. If you need a license please email Atri ASAP.

    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):

      1. You need to enable sharing folders:
      2. At least in our testing on Mac, the shared folder did not show up in /mnt/hgfs. To fix this, use these instructions .

  2. In case the above VM option does not work for you, then we recommend that you use a departmental server by sshing 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.

  3. 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: email cse-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 the git 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)

  1. Select Add Configuration.

  2. Press the tiny + on the top left to add a new configuration. Select Application from the dropdown.

  3. Select the Project SDK in Project Structure and make sure it is version 12.

  4. Select the output path, ideally the same as your root source directory.

  5. In Modules, mark your working directory as a source.

  6. Select the ... in the Choose Main Class field, and double click on the presumably auto-detected main Driver class.

  7. Don't forget to add the testcases/inputx.txt in the program arguments field.

  8. Happy coding!

Dealing with Errors

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

Java Specific