Differences between revisions 8 and 9
Revision 8 as of 2020-09-22 15:58:48
Size: 2108
Editor: khellman
Comment:
Revision 9 as of 2020-09-22 16:07:11
Size: 2625
Editor: khellman
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:

<<Anchor(sshXhopping)>>
= Grrr, I can't see the PDFs generated by grader.sh =
Use a PDF viewer installed on the alamode images. Some examples include `gv`, `xpdf`, and `evince`.
{{{
$ gv output-1010.pdf
}}}

If you are `ssh(1)`ing into alamode, use the `-X` option.
{{{
remote-with-vpn$ ssh -X bb136-13.mines.edu
bb136-13$ xpdf output-1010.pdf
}}}

This even works if you bunny hop through `jumpbox`
{{{
remote$ ssh -J jumpbox.mines.edu -X bb136-17.mines.edu
bb136-17$ evince output-1010.pdf
}}}

Grrr, I can't see the PDFs generated by grader.sh

Use a PDF viewer installed on the alamode images. Some examples include gv, xpdf, and evince.

$ gv output-1010.pdf

If you are ssh(1)ing into alamode, use the -X option.

remote-with-vpn$ ssh -X bb136-13.mines.edu
bb136-13$ xpdf output-1010.pdf

This even works if you bunny hop through jumpbox

remote$ ssh -J jumpbox.mines.edu -X bb136-17.mines.edu
bb136-17$ evince output-1010.pdf

Trace File Arguments Are Not Always Files

In practically all programming assignments, at least one command line argument is a file from which SIM should read random values from (in lieu of using a library specific pRNG). The TraceFiles page has sample files for use in development.

Beware that grader.sh scripts don't usually provide a static regular file as these arguments! Instead they use input redirection to connect a program generating a possibly infinite sequence of values to your SIM. This means that if you attempt to read all random values into an array or list, your SIM is going to "hang" --- it will dutifully read in an infinite collection of doubles until you exhaust machine memory.

An easy way to manage this is to create a TraceFile object that accepts a filename as a constructor parameter and provides a single getRandom() member function that returns a floating point value. Of simply write a getRandom( tracefile ) global function that accepts an open file descriptor (object, pointer, handle, the terminology depends on the language) and returns the next double from the file.

Why are things so complicated you ask?

By using redirection as the source for your SIM random numbers, grader.sh can be written with tests to be sure the random numbers are being used properly,1 it is easy to incorporate pRNG streams into the mix without worrying about which language a student is using, and by providing fake sequence of random values...

$ ./SIM <(yes 0.5)

certain types of consistency checks can be automated without micro-managing how student programs are written.

Beware the VSCode IDE installed on alamode (Fall 2018)

The integrated terminal in the VSCode has been shown to be whacky when running Python code. If you choose to use this IDE, you are strongly advised to use a separate terminal window to test your SIM.

  1. Depending on the system being modeled (1)

Assignments/AlamodeAccessCaveatsAndWarnings (last edited 2023-10-25 19:50:19 by khellman)