<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://fluid.colorado.edu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kjansen</id>
		<title>PHASTA Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://fluid.colorado.edu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kjansen"/>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php/Special:Contributions/Kjansen"/>
		<updated>2026-04-26T06:49:28Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=2106</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=2106"/>
				<updated>2025-03-29T17:12:56Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Alternative to Using MATLAB for Reformatting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
== Laminar, Incompressible, Semi-structured Mesh ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
# A CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
# A special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. &lt;br /&gt;
#* Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
# The interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
# The interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. &lt;br /&gt;
#*This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
#* Make sure the csv is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
#* This can be done by only loading the pressure and velocity fields into Paraview (either by editing the &amp;lt;code&amp;gt;.phts&amp;lt;/code&amp;gt; or in the data load menu in Paraview).&lt;br /&gt;
# Replace the commas with spaces&lt;br /&gt;
#* Can use &amp;lt;code&amp;gt;vim&amp;lt;/code&amp;gt; or run &amp;lt;code&amp;gt;sed -i 's/,/\ /g' test.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces&lt;br /&gt;
# Remove the first line of the csv file&lt;br /&gt;
#* Done in vi or sed (&amp;lt;code&amp;gt;sed -i 1,1d test.csv&amp;lt;/code&amp;gt;) or tail (&amp;lt;code&amp;gt;tail -n +2 test.csv &amp;gt; trimmedLine1.csv&amp;lt;/code&amp;gt;) &lt;br /&gt;
#* Needed for the next program&lt;br /&gt;
#* Better yet, we should change the next code to read past that header line and then delete this line when that is complete. We should also consider the solution in [https://stackoverflow.com/a/46451049/7564988 this StackOverflow answer] as it shows how to make a data structure that could read the csv lines directly in the next program and avoid ALL this file manipulation with modern fortran (see HighPerformanceMark's answer).&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the source mesh's ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may come from the files used to create the mesh (ie. for [[Tutorial_Video_Overviews#MatLabMeshAndConvert.mov|matchedNodeElementReader]])&lt;br /&gt;
#* ''(Untested)''This may also be created using the coordinates from the solution file&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo source.sln.{1..[MPIRanks]}| xargs cat &amp;gt; source.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat source.sln.{1..[MPIRanks]} &amp;gt; source.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate.../[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory in the target's Chef directory and move to that directory&lt;br /&gt;
# Symlink the target's POSIX &amp;lt;code&amp;gt;geombc.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory&lt;br /&gt;
#* The &amp;lt;code&amp;gt;geombc.[target nprocs]&amp;lt;/code&amp;gt; files should be copied in the exact fashion that they are in the Chef created &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory, including if they're &amp;quot;fanned out&amp;quot;&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run &amp;lt;code&amp;gt;phInterp&amp;lt;/code&amp;gt; via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
The file format for &amp;lt;code&amp;gt;solInterp.N&amp;lt;/code&amp;gt; is quite simple. Each line corresponds to the node number in the partition and the file itself has 7 columns:&lt;br /&gt;
&lt;br /&gt;
 coord_x coord_y coord_z pressure velocity_x velocity_y velocity_z&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 /path/to/phInterp 16 799 281 213 0.452&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz] [z Length]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;br /&gt;
&lt;br /&gt;
== Turbulent, Compressible, Unstructured Mesh ==&lt;br /&gt;
&lt;br /&gt;
Currently, the only version of PHASTA that is set up to handle this type of solution transfer is the &amp;lt;code&amp;gt;conrad54418/connor_primitive&amp;lt;/code&amp;gt; branch (as of 6/22/22). Creating the &amp;lt;code&amp;gt;solInterp.1&amp;lt;/code&amp;gt; file can be automated via a script or done manually (see below).&lt;br /&gt;
&lt;br /&gt;
=== Process Overview (scripted) ===&lt;br /&gt;
&lt;br /&gt;
Scripts have been made for use with the compressible, but not turbulent, version of the code. An example folder with the scripts included can be found at &amp;lt;code&amp;gt;/project/tutorials/ParaviewSolutionTransfer&amp;lt;/code&amp;gt;. The three scripts needed are called interpolateSol.py, pvCSV2customSLN_Nproc_prim.m, and parRunAll.sh. The only script of those three you need to run is parRunAll.sh, which can be found in &amp;lt;code&amp;gt;targetFolder/solutionInterp&amp;lt;/code&amp;gt;. You then need to run PHASTA via the runPhasta.sh script, which will produce a restart.1.1 file that contains the transferred solution on the new mesh. The manual section below provides insight about what the scripts are doing.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview (manual) ===&lt;br /&gt;
&lt;br /&gt;
# Load existing solution into ParaView. Use the 'MergeBlocks' filter to convert to serial case.&lt;br /&gt;
# Load the target case .pht file into ParaView&lt;br /&gt;
# Use the 'Resample from dataset' filter and select the source (new mesh file) and target (MergeBlocks) blocks accordingly&lt;br /&gt;
# Save the output as a .csv file. Write a single time step and select scientific notation to 12 decimals. NOTE: sometimes ParaView will make an error and write zeros where it can't quite find the closest point when doing the solution transfer. In this case, the .csv file needs to be manually edited to replace the zeros for pressure and temperature with realistic values.&lt;br /&gt;
# The .csv file can now be reformatted and renamed with MATLAB to match the expected form of solInterp.1.&lt;br /&gt;
# Advance PHASTA one step in serial, then convert to desired number of processors using Chef.&lt;br /&gt;
&lt;br /&gt;
==== Alternative to Using MATLAB for Reformatting ====&lt;br /&gt;
&lt;br /&gt;
For those wanting to skip the MATLAB step, &amp;lt;code&amp;gt;awk&amp;lt;/code&amp;gt; can also do the necessary column manipulation.&lt;br /&gt;
&lt;br /&gt;
Copy your file (in case you goof up):&lt;br /&gt;
 cp PVinterp0.csv test.dat&lt;br /&gt;
Remove the header line:&lt;br /&gt;
 sed -i 1,1d test.dat&lt;br /&gt;
Replace the commas with spaces:&lt;br /&gt;
 sed -i 's/,/\ /g' test.dat&lt;br /&gt;
Rearrange the columns  to be what solInterp.1 wants.  It is probably a good idea to do a &amp;lt;code&amp;gt;head -1 PVinterp0.csv&amp;lt;/code&amp;gt; to be sure as you might have more or less fields than I did but use that header to find the column numbers (starting from 1, not 0) to write x, y, z, p, u, v, w, T, sclr. NOTE: Even with the same data files, different versions of PV will produce different ordering so '''CHECK'''.&lt;br /&gt;
&lt;br /&gt;
For primitive code turbulent:&lt;br /&gt;
 awk '{print $9,$10,$11,$3,$5,$6,$7,$4,$2}' test.dat &amp;gt; solInterp.1&lt;br /&gt;
for entropy code laminar:&lt;br /&gt;
 awk '{print $12,$13,$14,$1,$2,$3,$4,$5,$8,$9,$10,$7,$6}' test.dat &amp;gt; solInterp.1&lt;br /&gt;
for entropy code with eddy viscosity:&lt;br /&gt;
 awk '{print $13,$14,$15,$2,$3,$4,$5,$6,$9,$10,$11,$8,$7,$1}' test.dat &amp;gt; solInterp.1&lt;br /&gt;
and don’t forget to put this into a directory called solnTarget (which is inside 1-procs_case) and also to turn on the flag in solver.inp &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; for the 1 step that Joe mentioned. Finally, if you are worried about that one step messing up your solution recent versions of the code can take&lt;br /&gt;
      iexec : 0&lt;br /&gt;
or&lt;br /&gt;
     Number of Timesteps: 0&lt;br /&gt;
to not take any  actual steps.  Note however that only very recent version of the code have the iexec conditional moved AFTER the loading of the interpolated solution but it should be pretty easy to figure out where to move that  conditional.   Alternatively, the second option also  skips over the time stepping and writes the solution  AFTER applying the boundary conditions which can be useful to see as well to confirm you have the intended BC’s set (iexec :0 won’t detect this)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=The_On_Ramp&amp;diff=1178</id>
		<title>The On Ramp</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=The_On_Ramp&amp;diff=1178"/>
				<updated>2020-09-17T20:53:20Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''PHASTA On Ramp'''! This page is meant to organize information for getting up to speed with the overall PHASTA workflow, as well as help you up your game as a PHASTA developer.&lt;br /&gt;
&lt;br /&gt;
== Level 0 ==&lt;br /&gt;
Ready to get your feet wet? Maybe you need to brush up on some fundamental skills. Level 0 provides tutorials and information on basic developer skills you will need to work with PHASTA.&lt;br /&gt;
* [[PHASTA_Group_Machines|Logging in]]&lt;br /&gt;
* [[VNC|Setting up your VNC]]&lt;br /&gt;
* [[UNIX|Getting started with Linux]]&lt;br /&gt;
* [[Git | Getting Git]]&lt;br /&gt;
* [[Vim|Getting comfortable with Vim]]&lt;br /&gt;
* Getting started with CMake&lt;br /&gt;
* New to Fortran?&lt;br /&gt;
* Working with C++.&lt;br /&gt;
* [[Making A New Wiki | Editing this Wiki]]&lt;br /&gt;
&lt;br /&gt;
== Level 1 ==&lt;br /&gt;
&lt;br /&gt;
[[File:Picture5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So you think you know how to &amp;lt;code&amp;gt;grep&amp;lt;/code&amp;gt; for keywords and &amp;lt;code&amp;gt;mkdir&amp;lt;/code&amp;gt; some folders? Now you're probably ready to jump into PHASTA. &lt;br /&gt;
* [[Level 1 Model/Mesh| Model/Mesh Workflow]]&lt;br /&gt;
* [[Level 1 Partition| Partition Workflow]]&lt;br /&gt;
* [[Level 1 Solve| Solve Workflow]]&lt;br /&gt;
* [[Level 1 Post-Process| Post-Process Workflow]]&lt;br /&gt;
&lt;br /&gt;
== Level 2 ==&lt;br /&gt;
Now that you've plotted some &amp;quot;Colorful Fluid Dynamics&amp;quot; (CFD) you're probably interested in digging into the guts of PHASTA, and getting it running on some more interesting hardware.&lt;br /&gt;
* [[Compiling PHASTA With CMake|Building PHASTA from scratch]] (this page is out of date)&lt;br /&gt;
* Available linear algebra packages in PHASTA&lt;br /&gt;
* [https://github.com/SCOREC/core/wiki/General-Build-instructions#Manual_Install Building Chef and other SCOREC core tools]&lt;br /&gt;
&lt;br /&gt;
== Level 3 ==&lt;br /&gt;
ParaView isn't cutting it for your research? Now its time to start writing your own analysis code. How to do custom pre and post processing is described here, along with more complex ways of using PHASTA for interesting CFD simulations&lt;br /&gt;
* phastaIO, the structure of geombc and restart files&lt;br /&gt;
* MATLAB-based Analysis&lt;br /&gt;
* STG&lt;br /&gt;
* [[VTKpytools| Python + VTK using vtkpytools]]&lt;br /&gt;
&lt;br /&gt;
== Level 4 ==&lt;br /&gt;
You're probably close to defending at this point, so before you go get that sweet industry job, you should drop some of your lofty knowledge here!&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=937</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=937"/>
				<updated>2020-09-08T14:54:49Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code. Note this request for a verification code will not start occurring until after you setup 2fa as noted below.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([https://fluid.colorado.edu/wiki/index.php/Janus_Cheat_Sheet Summit],[[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([Summit],[[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=936</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=936"/>
				<updated>2020-09-08T14:54:05Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code. Note this request for a verification code will not start occurring until after you setup 2fa as noted below.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([Summit][https://fluid.colorado.edu/wiki/index.php/Janus_Cheat_Sheet Summit],[[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([Summit],[[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=935</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=935"/>
				<updated>2020-09-08T14:48:52Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code. Note this request for a verification code will not start occurring until after you setup 2fa as noted below.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[Summit]],[[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([Summit],[[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=934</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=934"/>
				<updated>2020-09-08T14:42:35Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code. Note this request for a verification code will not start occurring until after you setup 2fa as noted below.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[Summit]],[[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[Summit]],[[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=933</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=933"/>
				<updated>2020-09-08T14:04:09Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code. Note this request for a verification code will not start occurring until after you setup 2fa as noted below.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=932</id>
		<title>PHASTA Group Machines</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA_Group_Machines&amp;diff=932"/>
				<updated>2020-09-08T14:02:39Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the local machines owned by the group, logging in, and two factor authentication.&lt;br /&gt;
&lt;br /&gt;
== Logging In ==&lt;br /&gt;
&lt;br /&gt;
The entry point for the group machines is &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, which is access publicly via &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;. To access the system via command line, simply run &amp;lt;code&amp;gt;ssh USERNAME@jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; if running Linux or Mac, or use PuTTY for Windows. &lt;br /&gt;
&lt;br /&gt;
For Linux or Mac terminals, the login process will look like the following:&lt;br /&gt;
&lt;br /&gt;
 ➜ ssh USERNAME@jumpgate-phasta.colorado.edu &lt;br /&gt;
 Password: &lt;br /&gt;
 Verification code:&lt;br /&gt;
&lt;br /&gt;
where the &amp;lt;code&amp;gt;Password:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Verification code:&amp;lt;/code&amp;gt; are prompts for you to enter in your password and 2FA pass code.&lt;br /&gt;
&lt;br /&gt;
Very little can/should be done on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.  The most common use is to establish a tunnel for a VNC session. The second usage that must be done to set that up is connecting to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. This is done via &amp;lt;code&amp;gt;ssh portal1&amp;lt;/code&amp;gt; while on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Two-Factor Authentication ===&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication (2FA). Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough)) or using PuTTY. All commands to be run are in &amp;lt;code&amp;gt;''italics''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 ''ssh USERNAME@jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
Before moving forward, it is recommended that you start a second terminal connection to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; by repeating the ssh command above. If at any point you want/need to reset, simply run &amp;lt;code&amp;gt;''rm -rf ~/.google_authenticator''&amp;lt;/code&amp;gt; in that second ssh session.&lt;br /&gt;
&lt;br /&gt;
In your &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
 ''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all).&lt;br /&gt;
&lt;br /&gt;
Now open another terminal and log on to &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; with ssh just as we did before. Now, in addition to prompting for your ''password'', it will also prompt for a &amp;quot;Verification code:&amp;quot;. In your authenticator app, find the auto-generated 6 digit code and enter it. If you've logged on successfully, then you are done. Otherwise, attempt to troubleshoot or reset the process with the fore mentioned &amp;lt;code&amp;gt;rm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== VNC ===&lt;br /&gt;
Most members of the group interact with these machines via a VNC, which provides an GUI interface. Setting up the VNC server is documented on the [[VNC]] page.&lt;br /&gt;
&lt;br /&gt;
== Machines ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is the machine that allows you to &amp;quot;jump&amp;quot; to the other machines in the local network via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. It is simply the public-facing machine and should only be used as such.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most of the non-computationally intensive tasks are done, such as text editing, moving files, etc. Effectively, if it takes longer than 5 seconds to run, you should probably think about running it on one of the &amp;lt;code&amp;gt;viz*&amp;lt;/code&amp;gt; nodes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[NAS]], [[ALCF]], etc.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This is where most computationally intensive tasks are done. However, they should only be run for debugging or post-processing. Production runs should be run on servers outside of the group's local machines ([[NAS]], [[ALCF]], etc.)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=927</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=927"/>
				<updated>2020-09-08T00:20:55Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Logging in'''&lt;br /&gt;
&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication. Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough) or using Putty (see below for installing and setting up putty-- stuff you need to type will be in ''italic''):&lt;br /&gt;
&lt;br /&gt;
''ssh jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''username'' and ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
If you want to be safe, start a second terminal connection to jumpgate by repeating the above. In the first (or only) jumpgate terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all). If you goof this step in any way and want to start over, just go to that second window I mentioned and type ''rm -rf ~/.google_authenticator'' and start over but, more than likely, what you did is fine.&lt;br /&gt;
&lt;br /&gt;
The next time you log into jumpgate, it will request a verification code which your phone application will provide. Enter that codes in the terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Network Computing (VNC)''' is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The VNC password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session type the following with a return after each line:&lt;br /&gt;
&lt;br /&gt;
  ''ssh jumpgate-phasta.colorado.edu''&lt;br /&gt;
  ''ssh portal1''&lt;br /&gt;
  ''source /etc/profile''&lt;br /&gt;
  ''start_vnc.sh''&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt;. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It is common practice to leave your VNC session running on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's VNC port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  ''source /etc/profile''&lt;br /&gt;
  ''stop_vnc.sh''     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;viz001&amp;lt;/code&amp;gt; is probably never coming back to life). &lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt;.  You can test that you have it setup right&lt;br /&gt;
with the toy-app &amp;lt;code&amp;gt;glxgears&amp;lt;/code&amp;gt; as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; crashing with a message about &amp;lt;code&amp;gt;Thread::Start()&amp;lt;/code&amp;gt; make sure you haven't set your stack size too large (remove any &amp;lt;code&amp;gt;ulimit -s&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ulimit -n&amp;lt;/code&amp;gt; calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; uses TurboVNC from the VirtualGL project, available from [http://www.virtualgl.org/Downloads/TurboVNC their website]&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as [https://www.tightvnc.com/download.php TightVNC] and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
 ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; will be different for each user. That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; in place of the suggested 05 (which just an arbitrary local port on your laptop). So if when I created a session the last for numbers were &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; for me is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
 ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it [http://www.chiark.greenend.org.uk/~sgtatham/putty/ here].&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; in the &amp;quot;Host Name&amp;quot; box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the &amp;quot;Tunnels&amp;quot; page. The &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt; script should tell you to run &amp;lt;code&amp;gt;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for &amp;lt;code&amp;gt;xy&amp;lt;/code&amp;gt; (it always suggests 05 currently) and instead use &amp;lt;code&amp;gt;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; varies for each new session created.  If you get &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; that just means there were &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; sessions created before you created this one (but the plan is for you to keep using 23 until the machine gets rebooted). Enter &amp;lt;code&amp;gt;59zw&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box. Enter &amp;lt;code&amp;gt;portal1:59zw&amp;lt;/code&amp;gt; in the &amp;quot;Destination&amp;quot; box (starting and ''click the add button''). Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect. ''BEFORE'' you click the &amp;quot;Open&amp;quot; button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
&amp;lt;code&amp;gt;ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;&lt;br /&gt;
your &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; from the instructions above is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt;&lt;br /&gt;
enter &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box&lt;br /&gt;
enter &amp;lt;code&amp;gt;portal1:5923&amp;lt;/code&amp;gt; in the destination box.&lt;br /&gt;
&lt;br /&gt;
===Connecting to your VNC with PuTTY===&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
#* To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
#* To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;USERNAME@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;USERNAME&amp;lt;/code&amp;gt; is your username on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. &lt;br /&gt;
#* We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;) that can be reached from the remote machine (&amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and tunneling &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt; via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:##&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. DON'T FORGET-- no meshing, solving, post-processing, EVEN MATLAB on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type &amp;lt;code&amp;gt;vglconnect -s viz00x&amp;lt;/code&amp;gt;  where, at this time &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; session on the screen of your laptop. There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal. &lt;br /&gt;
&lt;br /&gt;
The most basic input is that they provide a box that says VNC server. You will want to type &amp;lt;code&amp;gt;localhost:zw&amp;lt;/code&amp;gt; in that box and then apply start (or whatever the particular applications action button is).  The &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; here will need to be whatever you used after the &amp;lt;code&amp;gt;59zw:portal1&amp;lt;/code&amp;gt;..... part of the tunnel. What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for. Note it is possible to have several different simultaneous sessions. Each needs its own tunnel (established by repeating the process above with a unique &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt;) and then a corresponding &amp;quot;new&amp;quot; VNC viewer. In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;lt;code&amp;gt;xrandr&amp;lt;/code&amp;gt; tool to change the resolution of a running VNC session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs).&lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=926</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=926"/>
				<updated>2020-09-08T00:19:11Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Logging in'''&lt;br /&gt;
&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication. Existing users will have one week to switch over to this process.  New users are expected to do this within 24 hours.  This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough) or using Putty (see below for installing and setting up putty-- stuff you need to type will be in ''italic''):&lt;br /&gt;
&lt;br /&gt;
''ssh jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''username'' and ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
If you want to be safe, start a second terminal connection to jumpgate by repeating the above. In the first (or only) jumpgate terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all). If you goof this step in any way and want to start over, just go to that second window I mentioned and type ''rm -rf ~/.google_authenticator'' and start over but, more than likely, what you did is fine.&lt;br /&gt;
&lt;br /&gt;
The next time you log into jumpgate, it will request a verification code which your phone application will provide. Enter that codes in the terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Network Computing (VNC)''' is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The VNC password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt;. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It is common practice to leave your VNC session running on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's VNC port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;viz001&amp;lt;/code&amp;gt; is probably never coming back to life). &lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt;.  You can test that you have it setup right&lt;br /&gt;
with the toy-app &amp;lt;code&amp;gt;glxgears&amp;lt;/code&amp;gt; as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; crashing with a message about &amp;lt;code&amp;gt;Thread::Start()&amp;lt;/code&amp;gt; make sure you haven't set your stack size too large (remove any &amp;lt;code&amp;gt;ulimit -s&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ulimit -n&amp;lt;/code&amp;gt; calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; uses TurboVNC from the VirtualGL project, available from [http://www.virtualgl.org/Downloads/TurboVNC their website]&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as [https://www.tightvnc.com/download.php TightVNC] and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
 ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; will be different for each user. That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; in place of the suggested 05 (which just an arbitrary local port on your laptop). So if when I created a session the last for numbers were &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; for me is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
 ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it [http://www.chiark.greenend.org.uk/~sgtatham/putty/ here].&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; in the &amp;quot;Host Name&amp;quot; box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the &amp;quot;Tunnels&amp;quot; page. The &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt; script should tell you to run &amp;lt;code&amp;gt;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for &amp;lt;code&amp;gt;xy&amp;lt;/code&amp;gt; (it always suggests 05 currently) and instead use &amp;lt;code&amp;gt;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; varies for each new session created.  If you get &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; that just means there were &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; sessions created before you created this one (but the plan is for you to keep using 23 until the machine gets rebooted). Enter &amp;lt;code&amp;gt;59zw&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box. Enter &amp;lt;code&amp;gt;portal1:59zw&amp;lt;/code&amp;gt; in the &amp;quot;Destination&amp;quot; box (starting and ''click the add button''). Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect. ''BEFORE'' you click the &amp;quot;Open&amp;quot; button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
&amp;lt;code&amp;gt;ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;&lt;br /&gt;
your &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; from the instructions above is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt;&lt;br /&gt;
enter &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box&lt;br /&gt;
enter &amp;lt;code&amp;gt;portal1:5923&amp;lt;/code&amp;gt; in the destination box.&lt;br /&gt;
&lt;br /&gt;
===Connecting to your VNC with PuTTY===&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
#* To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
#* To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;USERNAME@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;USERNAME&amp;lt;/code&amp;gt; is your username on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. &lt;br /&gt;
#* We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;) that can be reached from the remote machine (&amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and tunneling &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt; via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:##&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. DON'T FORGET-- no meshing, solving, post-processing, EVEN MATLAB on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type &amp;lt;code&amp;gt;vglconnect -s viz00x&amp;lt;/code&amp;gt;  where, at this time &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; session on the screen of your laptop. There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal. &lt;br /&gt;
&lt;br /&gt;
The most basic input is that they provide a box that says VNC server. You will want to type &amp;lt;code&amp;gt;localhost:zw&amp;lt;/code&amp;gt; in that box and then apply start (or whatever the particular applications action button is).  The &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; here will need to be whatever you used after the &amp;lt;code&amp;gt;59zw:portal1&amp;lt;/code&amp;gt;..... part of the tunnel. What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for. Note it is possible to have several different simultaneous sessions. Each needs its own tunnel (established by repeating the process above with a unique &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt;) and then a corresponding &amp;quot;new&amp;quot; VNC viewer. In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;lt;code&amp;gt;xrandr&amp;lt;/code&amp;gt; tool to change the resolution of a running VNC session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs).&lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=925</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=925"/>
				<updated>2020-09-08T00:17:43Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Logging in'''&lt;br /&gt;
&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication. This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough) or using Putty (see below for installing and setting up putty-- stuff you need to type will be in ''italic''):&lt;br /&gt;
&lt;br /&gt;
''ssh jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''username'' and ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
If you want to be safe, start a second terminal connection to jumpgate by repeating the above. In the first (or only) jumpgate terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all). If you goof this step in any way and want to start over, just go to that second window I mentioned and type ''rm -rf ~/.google_authenticator'' and start over but, more than likely, what you did is fine.&lt;br /&gt;
&lt;br /&gt;
The next time you log into jumpgate, it will request a verification code which your phone application will provide. Enter that codes in the terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Network Computing (VNC)''' is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The VNC password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt;. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It is common practice to leave your VNC session running on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's VNC port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;viz001&amp;lt;/code&amp;gt; is probably never coming back to life). &lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt;.  You can test that you have it setup right&lt;br /&gt;
with the toy-app &amp;lt;code&amp;gt;glxgears&amp;lt;/code&amp;gt; as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; crashing with a message about &amp;lt;code&amp;gt;Thread::Start()&amp;lt;/code&amp;gt; make sure you haven't set your stack size too large (remove any &amp;lt;code&amp;gt;ulimit -s&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ulimit -n&amp;lt;/code&amp;gt; calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; uses TurboVNC from the VirtualGL project, available from [http://www.virtualgl.org/Downloads/TurboVNC their website]&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as [https://www.tightvnc.com/download.php TightVNC] and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
 ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; will be different for each user. That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; in place of the suggested 05 (which just an arbitrary local port on your laptop). So if when I created a session the last for numbers were &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; for me is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
 ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it [http://www.chiark.greenend.org.uk/~sgtatham/putty/ here].&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; in the &amp;quot;Host Name&amp;quot; box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the &amp;quot;Tunnels&amp;quot; page. The &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt; script should tell you to run &amp;lt;code&amp;gt;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for &amp;lt;code&amp;gt;xy&amp;lt;/code&amp;gt; (it always suggests 05 currently) and instead use &amp;lt;code&amp;gt;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; varies for each new session created.  If you get &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; that just means there were &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; sessions created before you created this one (but the plan is for you to keep using 23 until the machine gets rebooted). Enter &amp;lt;code&amp;gt;59zw&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box. Enter &amp;lt;code&amp;gt;portal1:59zw&amp;lt;/code&amp;gt; in the &amp;quot;Destination&amp;quot; box (starting and ''click the add button''). Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect. ''BEFORE'' you click the &amp;quot;Open&amp;quot; button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
&amp;lt;code&amp;gt;ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;&lt;br /&gt;
your &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; from the instructions above is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt;&lt;br /&gt;
enter &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box&lt;br /&gt;
enter &amp;lt;code&amp;gt;portal1:5923&amp;lt;/code&amp;gt; in the destination box.&lt;br /&gt;
&lt;br /&gt;
===Connecting to your VNC with PuTTY===&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
#* To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
#* To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;USERNAME@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;USERNAME&amp;lt;/code&amp;gt; is your username on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. &lt;br /&gt;
#* We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;) that can be reached from the remote machine (&amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and tunneling &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt; via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:##&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. DON'T FORGET-- no meshing, solving, post-processing, EVEN MATLAB on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type &amp;lt;code&amp;gt;vglconnect -s viz00x&amp;lt;/code&amp;gt;  where, at this time &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; session on the screen of your laptop. There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal. &lt;br /&gt;
&lt;br /&gt;
The most basic input is that they provide a box that says VNC server. You will want to type &amp;lt;code&amp;gt;localhost:zw&amp;lt;/code&amp;gt; in that box and then apply start (or whatever the particular applications action button is).  The &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; here will need to be whatever you used after the &amp;lt;code&amp;gt;59zw:portal1&amp;lt;/code&amp;gt;..... part of the tunnel. What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for. Note it is possible to have several different simultaneous sessions. Each needs its own tunnel (established by repeating the process above with a unique &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt;) and then a corresponding &amp;quot;new&amp;quot; VNC viewer. In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;lt;code&amp;gt;xrandr&amp;lt;/code&amp;gt; tool to change the resolution of a running VNC session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs).&lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=924</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=924"/>
				<updated>2020-09-08T00:17:28Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Logging in'''&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication. This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough) or using Putty (see below for installing and setting up putty-- stuff you need to type will be in ''italic''):&lt;br /&gt;
&lt;br /&gt;
''ssh jumpgate-phasta.colorado.edu''&lt;br /&gt;
&lt;br /&gt;
This will prompt for your ''username'' and ''password'' (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
&lt;br /&gt;
Next you need to download and install an authenticator application either for your computer or phone. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone or computer. In whatever mode it uses to create a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access).&lt;br /&gt;
&lt;br /&gt;
If you want to be safe, start a second terminal connection to jumpgate by repeating the above. In the first (or only) jumpgate terminal on your laptop type:&lt;br /&gt;
&lt;br /&gt;
''google-authenticator''&lt;br /&gt;
&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all). If you goof this step in any way and want to start over, just go to that second window I mentioned and type ''rm -rf ~/.google_authenticator'' and start over but, more than likely, what you did is fine.&lt;br /&gt;
&lt;br /&gt;
The next time you log into jumpgate, it will request a verification code which your phone application will provide. Enter that codes in the terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Network Computing (VNC)''' is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The VNC password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt;. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It is common practice to leave your VNC session running on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's VNC port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;viz001&amp;lt;/code&amp;gt; is probably never coming back to life). &lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt;.  You can test that you have it setup right&lt;br /&gt;
with the toy-app &amp;lt;code&amp;gt;glxgears&amp;lt;/code&amp;gt; as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; crashing with a message about &amp;lt;code&amp;gt;Thread::Start()&amp;lt;/code&amp;gt; make sure you haven't set your stack size too large (remove any &amp;lt;code&amp;gt;ulimit -s&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ulimit -n&amp;lt;/code&amp;gt; calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; uses TurboVNC from the VirtualGL project, available from [http://www.virtualgl.org/Downloads/TurboVNC their website]&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as [https://www.tightvnc.com/download.php TightVNC] and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
 ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; will be different for each user. That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; in place of the suggested 05 (which just an arbitrary local port on your laptop). So if when I created a session the last for numbers were &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; for me is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
 ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it [http://www.chiark.greenend.org.uk/~sgtatham/putty/ here].&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; in the &amp;quot;Host Name&amp;quot; box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the &amp;quot;Tunnels&amp;quot; page. The &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt; script should tell you to run &amp;lt;code&amp;gt;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for &amp;lt;code&amp;gt;xy&amp;lt;/code&amp;gt; (it always suggests 05 currently) and instead use &amp;lt;code&amp;gt;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; varies for each new session created.  If you get &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; that just means there were &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; sessions created before you created this one (but the plan is for you to keep using 23 until the machine gets rebooted). Enter &amp;lt;code&amp;gt;59zw&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box. Enter &amp;lt;code&amp;gt;portal1:59zw&amp;lt;/code&amp;gt; in the &amp;quot;Destination&amp;quot; box (starting and ''click the add button''). Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect. ''BEFORE'' you click the &amp;quot;Open&amp;quot; button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
&amp;lt;code&amp;gt;ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;&lt;br /&gt;
your &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; from the instructions above is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt;&lt;br /&gt;
enter &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box&lt;br /&gt;
enter &amp;lt;code&amp;gt;portal1:5923&amp;lt;/code&amp;gt; in the destination box.&lt;br /&gt;
&lt;br /&gt;
===Connecting to your VNC with PuTTY===&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
#* To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
#* To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;USERNAME@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;USERNAME&amp;lt;/code&amp;gt; is your username on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. &lt;br /&gt;
#* We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;) that can be reached from the remote machine (&amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and tunneling &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt; via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:##&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. DON'T FORGET-- no meshing, solving, post-processing, EVEN MATLAB on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type &amp;lt;code&amp;gt;vglconnect -s viz00x&amp;lt;/code&amp;gt;  where, at this time &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; session on the screen of your laptop. There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal. &lt;br /&gt;
&lt;br /&gt;
The most basic input is that they provide a box that says VNC server. You will want to type &amp;lt;code&amp;gt;localhost:zw&amp;lt;/code&amp;gt; in that box and then apply start (or whatever the particular applications action button is).  The &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; here will need to be whatever you used after the &amp;lt;code&amp;gt;59zw:portal1&amp;lt;/code&amp;gt;..... part of the tunnel. What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for. Note it is possible to have several different simultaneous sessions. Each needs its own tunnel (established by repeating the process above with a unique &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt;) and then a corresponding &amp;quot;new&amp;quot; VNC viewer. In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;lt;code&amp;gt;xrandr&amp;lt;/code&amp;gt; tool to change the resolution of a running VNC session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs).&lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=923</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=923"/>
				<updated>2020-09-08T00:14:10Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Logging in&lt;br /&gt;
Due to recent brute force ssh attacks we are moving to using two factor authentication. This is pretty easy to setup as follows (from a terminal in your mac or linux laptop (and Windows if new enough) or using Putty (see below for installing and setting up putty-- stuff you need to type will be in italic):&lt;br /&gt;
ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
This will prompt for your username and password (the private password you set or, if this is your first login the one in the account creation email).&lt;br /&gt;
Next you need to download and install an authenticator application. There are several from Google, Microsoft, Twilio, etc. Launch that application on your phone. In whatever mode it uses to start a new token generator, do that (often it opens with a QR code scanner enabled as it knows that is the easiest way to link the phone application to the QR scan created on the machine you are trying to access). If you want to be safe, start a second terminal connection to jumpgate by repeating the above. In the first (or only) jumpgate terminal on your laptop type:&lt;br /&gt;
google-authenticator&lt;br /&gt;
If your terminal is big enough, it should display a QR code that you can scan with your phone. At this point it will ask you some questions about options (I answered yes to all). If you goof this step in any way and want to start over, just go to that second window I mentioned and type rm -rf ~/.google_authenticator but, more than likely, what you did is fine.&lt;br /&gt;
The next time you log into jumpgate, it will request a verification code which your phone application will provide. Enter that codes in the terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Network Computing (VNC)''' is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The VNC password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt;. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It is common practice to leave your VNC session running on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's VNC port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are &amp;lt;code&amp;gt;viz002&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;viz001&amp;lt;/code&amp;gt; is probably never coming back to life). &lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt;.  You can test that you have it setup right&lt;br /&gt;
with the toy-app &amp;lt;code&amp;gt;glxgears&amp;lt;/code&amp;gt; as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with &amp;lt;code&amp;gt;vglrun&amp;lt;/code&amp;gt; crashing with a message about &amp;lt;code&amp;gt;Thread::Start()&amp;lt;/code&amp;gt; make sure you haven't set your stack size too large (remove any &amp;lt;code&amp;gt;ulimit -s&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ulimit -n&amp;lt;/code&amp;gt; calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for &amp;lt;code&amp;gt;viz003&amp;lt;/code&amp;gt; is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; uses TurboVNC from the VirtualGL project, available from [http://www.virtualgl.org/Downloads/TurboVNC their website]&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as [https://www.tightvnc.com/download.php TightVNC] and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
 ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; will be different for each user. That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; in place of the suggested 05 (which just an arbitrary local port on your laptop). So if when I created a session the last for numbers were &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; for me is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
 ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it [http://www.chiark.greenend.org.uk/~sgtatham/putty/ here].&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter &amp;lt;code&amp;gt;jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; in the &amp;quot;Host Name&amp;quot; box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the &amp;quot;Tunnels&amp;quot; page. The &amp;lt;code&amp;gt;start_vnc.sh&amp;lt;/code&amp;gt; script should tell you to run &amp;lt;code&amp;gt;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for &amp;lt;code&amp;gt;xy&amp;lt;/code&amp;gt; (it always suggests 05 currently) and instead use &amp;lt;code&amp;gt;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; varies for each new session created.  If you get &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt; that just means there were &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; sessions created before you created this one (but the plan is for you to keep using 23 until the machine gets rebooted). Enter &amp;lt;code&amp;gt;59zw&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box. Enter &amp;lt;code&amp;gt;portal1:59zw&amp;lt;/code&amp;gt; in the &amp;quot;Destination&amp;quot; box (starting and ''click the add button''). Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect. ''BEFORE'' you click the &amp;quot;Open&amp;quot; button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
&amp;lt;code&amp;gt;ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&amp;lt;/code&amp;gt;&lt;br /&gt;
your &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; from the instructions above is &amp;lt;code&amp;gt;23&amp;lt;/code&amp;gt;&lt;br /&gt;
enter &amp;lt;code&amp;gt;5923&amp;lt;/code&amp;gt; in the &amp;quot;Source Port&amp;quot; box&lt;br /&gt;
enter &amp;lt;code&amp;gt;portal1:5923&amp;lt;/code&amp;gt; in the destination box.&lt;br /&gt;
&lt;br /&gt;
===Connecting to your VNC with PuTTY===&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
#* To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
#* To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;USERNAME@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;USERNAME&amp;lt;/code&amp;gt; is your username on &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. &lt;br /&gt;
#* We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (&amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;) that can be reached from the remote machine (&amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jumpgate&amp;lt;/code&amp;gt;, and tunneling &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;portal1:59##&amp;lt;/code&amp;gt; via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:##&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59##&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59##&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. DON'T FORGET-- no meshing, solving, post-processing, EVEN MATLAB on &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type &amp;lt;code&amp;gt;vglconnect -s viz00x&amp;lt;/code&amp;gt;  where, at this time &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt;. The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your &amp;lt;code&amp;gt;portal1&amp;lt;/code&amp;gt; session on the screen of your laptop. There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal. &lt;br /&gt;
&lt;br /&gt;
The most basic input is that they provide a box that says VNC server. You will want to type &amp;lt;code&amp;gt;localhost:zw&amp;lt;/code&amp;gt; in that box and then apply start (or whatever the particular applications action button is).  The &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt; here will need to be whatever you used after the &amp;lt;code&amp;gt;59zw:portal1&amp;lt;/code&amp;gt;..... part of the tunnel. What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for. Note it is possible to have several different simultaneous sessions. Each needs its own tunnel (established by repeating the process above with a unique &amp;lt;code&amp;gt;zw&amp;lt;/code&amp;gt;) and then a corresponding &amp;quot;new&amp;quot; VNC viewer. In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;lt;code&amp;gt;xrandr&amp;lt;/code&amp;gt; tool to change the resolution of a running VNC session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs).&lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=870</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=870"/>
				<updated>2020-09-04T13:25:51Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on portal1 are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where zw will be different for each user (actually each session created but we are hoping for only one per user please :&amp;gt; ).  That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use zw in pl place of the suggested 05 (the 05 is just the local port on your laptop so it can be anything but its easier to remember which port is which if you always give them the same number and there is no chance of giving two VNC's the same number accidentally with this practice).  So if when I created a session  the last for numbers were 5923 then zw for me is 23 and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for xy (it always suggests 05 currently) and instead use &amp;quot;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where zw varies for each new session created.  If you get 23 that just means there were 22 sessions created before you created this one but the plan is for you to keep using 23 for a long time (usually until the machine gets rebooted which can be a year or more in some cases). Enter 59zw in the &amp;quot;Source port&amp;quot; box. Enter portal1:59zw  in the Destination box (starting and '''click the add button'''. Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect.  BEFORE you click the Open button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
your &amp;quot;zw&amp;quot; from the instructions above is 23&lt;br /&gt;
enter 5923 in the Source port box&lt;br /&gt;
enter portal1:5923 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1. DON'T FORGET-- no meshing, solving, postprocessing, EVEN MATLAB on portal1.  To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type vglconnect -s viz00x  where, at this time x =2, or 3.&lt;br /&gt;
&lt;br /&gt;
== Starting a VNC viewer ==&lt;br /&gt;
&lt;br /&gt;
Whether you followed the Mac or Linux or Windows instructions above, successful completion will have established a tunnel from your laptop to portal1.  The last step is to start a VNC viewer (graphical windowing program) that uses this tunnel to display your portal1 session on the screen of your laptop.  There are a variety of choices for each platform and they evolve but their operation seems, thankfully, pretty universal.  The most basic input is that they provide a box that says VNC server.  You will want to type localhost:zw   in that box and then apply start or whatever the particular applications action button is.  Note that the zw here will need to be whatever you used after the 59zw:portal..... part of the tunnel. This is why we suggest using the same number twice so that you  only have one number to remember.  What the number is actually doing is telling this VNC viewer which port you have established a tunnel on for the session you are starting the VNC viewer for.  Note it is possible to have several different simultaneous sessions.  Each needs its own tunnel (established by repeating the process above with a unique zw) and then a corresponding &amp;quot;new&amp;quot; VNC viewer.  In this way we might continue to work in our own session but then take a break to look at a collaborator's session without having to close out the tunnel and viewer pair.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=869</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=869"/>
				<updated>2020-09-04T13:13:37Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac or Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on portal1 are OK but it always tells you to start a session (in a terminal on your mac or linux machine command line)&lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where zw will be different for each user (actually each session created but we are hoping for only one per user please :&amp;gt; ).  That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use zw in pl place of the suggested 05 (the 05 is just the local port on your laptop so it can be anything but its easier to remember which port is which if you always give them the same number and there is no chance of giving two VNC's the same number accidentally with this practice).  So if when I created a session  the last for numbers were 5923 then zw for me is 23 and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for xy (it always suggests 05 currently) and instead use &amp;quot;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where zw varies for each new session created.  If you get 23 that just means there were 22 sessions created before you created this one but the plan is for you to keep using 23 for a long time (usually until the machine gets rebooted which can be a year or more in some cases). Enter 59zw in the &amp;quot;Source port&amp;quot; box. Enter portal1:59zw  in the Destination box (starting and '''click the add button'''. Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect.  BEFORE you click the Open button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
your &amp;quot;zw&amp;quot; from the instructions above is 23&lt;br /&gt;
enter 5923 in the Source port box&lt;br /&gt;
enter portal1:5923 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1. DON'T FORGET-- no meshing, solving, postprocessing, EVEN MATLAB on portal1.  To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type vglconnect -s viz00x  where, at this time x =2, or 3.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=868</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=868"/>
				<updated>2020-09-04T13:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Mac of Linux ==&lt;br /&gt;
&lt;br /&gt;
The instructions given when you started the session on portal1 are OK but it always tells you &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:59zw jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
where zw will be different for each user (actually each session created but we are hoping for only one per user please :&amp;gt; ).  That suggestion is OK if you never plan to connect to anyone else's session but since we often collaborate but sharing VNC sessions, the better practice we adopt is to use zw in pl place of the suggested 05 (the 05 is just the local port on your laptop so it can be anything but its easier to remember which port is which if you always give them the same number and there is no chance of giving two VNC's the same number accidentally with this practice).  So if when I created a session  the last for numbers were 5923 then zw for me is 23 and the best practice is to ignore the script suggestion in favor of&lt;br /&gt;
&lt;br /&gt;
ssh -L5923:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for xy (it always suggests 05 currently) and instead use &amp;quot;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where zw varies for each new session created.  If you get 23 that just means there were 22 sessions created before you created this one but the plan is for you to keep using 23 for a long time (usually until the machine gets rebooted which can be a year or more in some cases). Enter 59zw in the &amp;quot;Source port&amp;quot; box. Enter portal1:59zw  in the Destination box (starting and '''click the add button'''. Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect.  BEFORE you click the Open button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
your &amp;quot;zw&amp;quot; from the instructions above is 23&lt;br /&gt;
enter 5923 in the Source port box&lt;br /&gt;
enter portal1:5923 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1. DON'T FORGET-- no meshing, solving, postprocessing, EVEN MATLAB on portal1.  To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type vglconnect -s viz00x  where, at this time x =2, or 3.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=867</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=867"/>
				<updated>2020-09-04T12:52:30Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L59xy:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; on your machine. Those instructions are OK but a better practice is to ignore what that script suggested for xy (it always suggests 05 currently) and instead use &amp;quot;ssh -L59zw:portal1:59zw jumpgate-phasta.colorado.edu&amp;quot; where zw varies for each new session created.  If you get 23 that just means there were 22 sessions created before you created this one but the plan is for you to keep using 23 for a long time (usually until the machine gets rebooted which can be a year or more in some cases). Enter 59zw in the &amp;quot;Source port&amp;quot; box. Enter portal1:59zw  in the Destination box (starting and '''click the add button'''. Putty is a little strange about saving the session which you want to do to avoid having to do all the above every time you re-connect.  BEFORE you click the Open button, you want to name your session (your choice) and click save.  Then in the future when you start putty you should be able to just click that saved session name and click load. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5923 jumpgate-phasta.colorado.edu&lt;br /&gt;
your &amp;quot;zw&amp;quot; from the instructions above is 23&lt;br /&gt;
enter 5923 in the Source port box&lt;br /&gt;
enter portal1:5923 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59zw.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1. DON'T FORGET-- no meshing, solving, postprocessing, EVEN MATLAB on portal1.  To run memory and/or processor and/or graphics intensive jobs you need to create a terminal and type vglconnect -s viz00x  where, at this time x =2, or 3.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=866</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=866"/>
				<updated>2020-09-04T12:37:51Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop. Most users will never need to do this as the idea is to create one session and continue to use that one for all future usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu as in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L????:portal1:???? jumpgate-phasta.colorado.edu&amp;quot; on your machine. Enter the number between the -L and the first colon in the &amp;quot;Source port&amp;quot; box. Enter the rest in the Destination box (starting with portal1) and '''click the add button'''. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5900 jumpgate-phasta.colorado.edu&lt;br /&gt;
enter 5905 in the Source port box&lt;br /&gt;
enter portal1:5900 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59xx.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Tutorial_Video_Overviews&amp;diff=851</id>
		<title>Tutorial Video Overviews</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Tutorial_Video_Overviews&amp;diff=851"/>
				<updated>2020-09-03T20:51:37Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Learning to use PHASTA involves a lot of non-trivial steps, each that have a significant learning curve.  Videos are a natural way to learn but we have accumulated a lot of them and this makes it daunting to start.  The purpose of this page is to organize and index that knowledge and make it more enabling to self-paced learning.&lt;br /&gt;
&lt;br /&gt;
Here are notes going over the contents of the [https://fluid.colorado.edu/tutorials/ different tutorial videos] with the goal of helping others find tutorial videos of use to them.&lt;br /&gt;
&lt;br /&gt;
See [[#Meta|Meta]] for details on adding new entries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video Table ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Video Name&lt;br /&gt;
! Date&lt;br /&gt;
! Software Used&lt;br /&gt;
! Description&lt;br /&gt;
! More Notes&lt;br /&gt;
! Misc. Tags&lt;br /&gt;
|-&lt;br /&gt;
| [https://fluid.colorado.edu/tutorials/RajDemo.mov Raj_demo.mov]&lt;br /&gt;
| 2019-05-12&lt;br /&gt;
| SimModeler, vglconnect&lt;br /&gt;
|&lt;br /&gt;
* Overview of using portal1/viznodes, how/when to use vglconnect etc (first ~10 minutes)&lt;br /&gt;
* Use of SimModeler for creating unstructured mesh of a windtunnel&lt;br /&gt;
| N/A&lt;br /&gt;
| viznode, meshing&lt;br /&gt;
|-&lt;br /&gt;
| [https://fluid.colorado.edu/tutorials/MatLabMeshAndConvert.mov MatLabMeshAndConvert.mov]&lt;br /&gt;
| 2019-09-09&lt;br /&gt;
| Matlab, StructMesh_Channel.m, runMatchedNodeElmReader.sh&lt;br /&gt;
| &lt;br /&gt;
* Using Riccardo's Matlab script (StructMesh_Channel.m) to create structured mesh for LES_DNS simulation&lt;br /&gt;
* Converting that mesh for use with Chef using runMatchedNodeElmReader.sh&lt;br /&gt;
| [[#MatLabMeshAndConvert.mov|Jump to Notes Below]]&lt;br /&gt;
| Channel, Bump, meshing&lt;br /&gt;
|-&lt;br /&gt;
| [https://fluid.colorado.edu/tutorials/SpanWiseAveragingPostProcessing.mov SpanWiseAveragingPostProcessing.mov]&lt;br /&gt;
| 2020-02-11&lt;br /&gt;
| Matlab, Spanwise averaging Matlab scripts, PHASTA&lt;br /&gt;
| &lt;br /&gt;
* Viewing required settings for PHASTA to create spanwise averaged statistic files&lt;br /&gt;
* Using Riccardo's Matlab script to take those files and plot them&lt;br /&gt;
| N/A&lt;br /&gt;
| post-processing &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video Notes ==&lt;br /&gt;
&lt;br /&gt;
=== MatLabMeshAndConvert.mov ===&lt;br /&gt;
&lt;br /&gt;
==== Time Stamps ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Time&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0:00&lt;br /&gt;
| Begin reviewing code of the Matlab scripts&lt;br /&gt;
|-&lt;br /&gt;
| 10:30&lt;br /&gt;
| Run Example Script&lt;br /&gt;
|- &lt;br /&gt;
| 12:45&lt;br /&gt;
| Observing the files generated by Matlab&lt;br /&gt;
|- &lt;br /&gt;
| 13:40&lt;br /&gt;
| Discussion of using &amp;lt;code&amp;gt;matchedNodeElmReader&amp;lt;/code&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| 14:50&lt;br /&gt;
| Running of &amp;lt;code&amp;gt;runMatchedNodeElmReader.sh&amp;lt;/code&amp;gt; script&lt;br /&gt;
|- &lt;br /&gt;
| 16:10&lt;br /&gt;
| Viewing mesh in Paraview&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
Create structured meshes using Matlab script created by Riccardo and other tools. &lt;br /&gt;
Matlab script defines the &amp;quot;values&amp;quot; of the mesh to be generated, while &amp;lt;code&amp;gt;matchedNodeElmReader&amp;lt;/code&amp;gt; actually generates the mesh files themselves.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;matchedNodeElmReader&amp;lt;/code&amp;gt; may also be referred to/named as &amp;lt;code&amp;gt;streamMds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Result of Matlab script is 5 different files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;*.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
| Coordinates of each vertex&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;*.class&amp;lt;/code&amp;gt;&lt;br /&gt;
| Classification with respect to the geometrical model (a box in this case)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;*.cnn&amp;lt;/code&amp;gt;&lt;br /&gt;
| Connectivity of each element&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;*.fathers2D&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2D grid of the fathers, Used in spanwise averaging&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;*.match&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;quot;vertex matching flag&amp;quot; for periodic boundary conditions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;matchedNodeElmReader&amp;lt;/code&amp;gt; then takes these files as input and generates two directories: &amp;lt;code&amp;gt;outMesh&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rendered&amp;lt;/code&amp;gt;.&lt;br /&gt;
The &amp;lt;code&amp;gt;rendered&amp;lt;/code&amp;gt; is a way to view the mesh in Paraview.&lt;br /&gt;
&lt;br /&gt;
The code is run with:&lt;br /&gt;
 mpirun -np 1 matchedNodeElmReader *.cnn *.crd *.match *.class *.fathers2D output_model.dmg outputMeshDir/&lt;br /&gt;
&lt;br /&gt;
where in the tutorial &amp;lt;code&amp;gt;matchedNodeElmReader&amp;lt;/code&amp;gt; is located at &amp;lt;code&amp;gt;/users/rbalin/matchedReader/build-addNfathDebug/test/matchedNodeElnReader&amp;lt;/code&amp;gt;.&lt;br /&gt;
The mesh files (SCOREC Mesh, &amp;lt;code&amp;gt;*.smb&amp;lt;/code&amp;gt;) are then placed inside the output mesh directory.&lt;br /&gt;
A usage message can be shown by running the executable without any arguments.&lt;br /&gt;
&lt;br /&gt;
This command can also be run with multiple MPI processes. Note that this process does &amp;quot;preliminary&amp;quot; partitioning, so the number of mpi processes used is the number of &amp;lt;code&amp;gt;*.smd&amp;lt;/code&amp;gt;. The nodes are stored in z, y, x major order (which is generally spanwise, wall-normal, streamwise order), so Riccardo recommends that the number of mpi processes be evenly divisible by the number of streamwise nodes such that these partitions are not divided unevenly.&lt;br /&gt;
&lt;br /&gt;
Once this is done, the &amp;lt;code&amp;gt;*.smb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*.dmg&amp;lt;/code&amp;gt; files are fed to Chef for further partitioning and processing.&lt;br /&gt;
&lt;br /&gt;
== Meta ==&lt;br /&gt;
&lt;br /&gt;
==== Editing the Wiki Page ====&lt;br /&gt;
Just login to the wiki (click the login button at the top right of the page) and click the edit tab at the top of the page. Login information will be the same as your ''original'' login for jumpgate (the wiki password is not updated with your jumpgate password if you changed it)&lt;br /&gt;
&lt;br /&gt;
==== Filling in New Entries ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Video Name&lt;br /&gt;
! Date&lt;br /&gt;
! Software Used&lt;br /&gt;
! Description&lt;br /&gt;
! Misc. Tags&lt;br /&gt;
|-&lt;br /&gt;
| Should be the exact name of the video file and should have a link to the actual video.&lt;br /&gt;
| ISO format (YYYY-MM-DD)&lt;br /&gt;
| List of software used, including relevant scripts&lt;br /&gt;
| Short description of what was done in the video&lt;br /&gt;
| Place for random key words that don't fit in other categories (ie. used for using the browsers search function)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=787</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=787"/>
				<updated>2020-07-26T14:11:46Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 1. Create CSV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
# Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces so edit them out with vi or sed -i 's/,/\ /g' test.csv&lt;br /&gt;
# Note you also need to delete the first line of this file for the next program. Again, could be done in vi or sed ( sed -i 1,1d test.csv) or tail (tail -n +2 test.csv &amp;gt; trimmedLine1.csv) or, better yet, we should change the next code to read past that header line and then delete this line when that is complete. We should also consider the top answer here https://stackoverflow.com/questions/46444414/how-to-read-my-csv-file-in-fortran as it shows how to make a data structure that could read the csv lines directly in the next program and avoid ALL this file manipulation with modern fortran (see HighPerformanceMark's answer).&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo source.sln.{1..[MPIRanks]}| xargs cat &amp;gt; source.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat source.sln.{1..[MPIRanks]} &amp;gt; source.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=786</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=786"/>
				<updated>2020-07-26T13:56:43Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 1. Create CSV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
# Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces so edit them out with vi or sed -i 's/,/\ /g' test.csv&lt;br /&gt;
# Note you also need to delete the first line of this file for the next program. Again, could be done in vi or sed ( sed -i 1,1d test.csv) or tail (tail -n +2 test.csv &amp;gt; trimmedLine1.csv) or, better yet, we should change the next code to read past that header line and then delete this line when that is complete.&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo source.sln.{1..[MPIRanks]}| xargs cat &amp;gt; source.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat source.sln.{1..[MPIRanks]} &amp;gt; source.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=785</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=785"/>
				<updated>2020-07-26T13:51:52Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 1. Create CSV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
# Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces so edit them out with vi or sed -i 's/,/\ /g' test.csv&lt;br /&gt;
# Note you also need to delete the first line of this file for the next program. Again, could be done in vi or sed ( sed -i 1,1d test.csv) or tail (tail -n +1 test.csv) or, better yet, we should change the next code to read past that header line and then delete this line when that is complete.&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo source.sln.{1..[MPIRanks]}| xargs cat &amp;gt; source.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat source.sln.{1..[MPIRanks]} &amp;gt; source.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=784</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=784"/>
				<updated>2020-07-24T17:55:29Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 2. Create Structured Solution File */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
# Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces so edit them out with vi or sed -i 's/,/\ /g' test.csv&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo source.sln.{1..[MPIRanks]}| xargs cat &amp;gt; source.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat source.sln.{1..[MPIRanks]} &amp;gt; source.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=783</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=783"/>
				<updated>2020-07-24T14:23:03Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 1. Create CSV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
# Though the next step looks for a .csv extension, it is a fortran formatted read and actually needs those commas replaced by spaces so edit them out with vi or sed -i 's/,/\ /g' test.csv&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;solution.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo solution.sln.{1..[MPIRanks]}| xargs cat &amp;gt; solution.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat solution.sln.{1..[MPIRanks]} &amp;gt; solution.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[target parts per MPIProc] [source nx] [source ny] [source nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[target parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=684</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=684"/>
				<updated>2020-06-27T18:41:19Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* 4. Interpolate the solution in PHASTA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;solution.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo solution.sln.{1..[MPIRanks]}| xargs cat &amp;gt; solution.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat solution.sln.{1..[MPIRanks]} &amp;gt; solution.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[parts per MPIProc] [nx] [ny] [nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for a few timesteps and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=683</id>
		<title>Interpolate Solution from Different Mesh</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Interpolate_Solution_from_Different_Mesh&amp;diff=683"/>
				<updated>2020-06-27T18:39:56Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a general page for how to interpolate solutions from different meshes onto a new mesh. &lt;br /&gt;
Those meshes are assumed to be of the same domain. &lt;br /&gt;
&lt;br /&gt;
The generic terms for the two meshes are &amp;quot;source&amp;quot; and &amp;quot;target&amp;quot;, where source has the desired solution data and target is the mesh that will be receiving. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Structured&amp;quot; Mesh Methodology ==&lt;br /&gt;
This section will assume that the source mesh is in a structured ijk form. In the future, this may be expanded to meshes created by MGEN.&lt;br /&gt;
&lt;br /&gt;
=== Process Overview ===&lt;br /&gt;
&lt;br /&gt;
First, a CSV of the solution must be created. This must be done on a serial running version of ParaView '''and''' must be done after a MergeBlocks filter is done.&lt;br /&gt;
&lt;br /&gt;
Second, a special solution file is created via &amp;lt;code&amp;gt;Sort2StructuredGrid&amp;lt;/code&amp;gt;, which will take in the csv from step 1 and the ordered coordinates of the source file from Matlab. Effectively, it creates a single solution file in the same ordering as the Matlab points. The importance of this is significant as the executable used in the next step depends on some expected ordering. If the ordering is different, a new executable will need to be used/created. &lt;br /&gt;
&lt;br /&gt;
Third, the interpolation is performed onto the new grid via &amp;lt;code&amp;gt;par3DInterp3&amp;lt;/code&amp;gt;, which creates &amp;lt;code&amp;gt;solInterp.&amp;lt;1-nparts&amp;gt;&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Fourth, the interpolation is then used by PHASTA by setting &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;. This should only be done for 1 timestep, as it will continue to reset the IC for all proceeding timesteps. The &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory needs to be symlinked into the &amp;lt;code&amp;gt;-procs_case&amp;lt;/code&amp;gt; directory for this to work.&lt;br /&gt;
&lt;br /&gt;
==== 1. Create CSV ====&lt;br /&gt;
&lt;br /&gt;
* Created using ParaView&lt;br /&gt;
* PV must be running in Serial mode&lt;br /&gt;
** Otherwise the CSV will not be in the correct order and possibly have duplicated points&lt;br /&gt;
# Load in source dataset&lt;br /&gt;
# Apply Mergeblocks filter&lt;br /&gt;
# Save dataset as a csv with 12 digits of precision in scientific notation&lt;br /&gt;
# Take csv make sure it is in &amp;quot;pressure, u0, u1, u2, x0, x1, x2&amp;quot; format&lt;br /&gt;
&lt;br /&gt;
==== 2. Create Structured Solution File ====&lt;br /&gt;
'''Note:''' These instructions will be for the &amp;lt;code&amp;gt;parallelSortDNSzBinJames&amp;lt;/code&amp;gt; executable, which has some highly specific requirements and command inputs. &lt;br /&gt;
&lt;br /&gt;
This step will take the data from the source solution file and put it in an format/order that will make the interpolation process work much faster.&lt;br /&gt;
&lt;br /&gt;
# Symlink the sources ordered coordinate file as &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename/symlink csv to be the correct file name (in my specific case, it was &amp;lt;code&amp;gt;dnsSolution1procLongFort.csv&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Create an interactive job on whatever machine you're needing to run on (ALCF Cooley in this case)&lt;br /&gt;
# Load approriate MPI environment variables (&amp;lt;code&amp;gt;soft add +mvapich2&amp;lt;/code&amp;gt; for Cooley)&lt;br /&gt;
# Run the executable via &amp;lt;code&amp;gt;mpirun -np [nprocs] [executable path] [executable inputs]&amp;lt;/code&amp;gt; &lt;br /&gt;
#* This will produce &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Concatenate &amp;lt;code&amp;gt;source.sln.{1..nprocs}&amp;lt;/code&amp;gt; files '''in order''' into single &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; file&lt;br /&gt;
#* The individual &amp;lt;code&amp;gt;solution.sln.{1..nprocs}&amp;lt;/code&amp;gt; files need to be concatenated into a single &amp;lt;code&amp;gt;solution.sln&amp;lt;/code&amp;gt; file, which can be done (in zsh at least) via  &amp;lt;code&amp;gt;echo solution.sln.{1..[MPIRanks]}| xargs cat &amp;gt; solution.sln&amp;lt;/code&amp;gt;  (or probably equivalent &amp;lt;code&amp;gt;cat solution.sln.{1..[MPIRanks]} &amp;gt; solution.sln&amp;lt;/code&amp;gt;). Note these files '''must''' be concatenated in order of rank, otherwise it will be out of sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 24 /lus/theta-fs0/projects/PHASTA_aesp/Utilities/Sort2StructuredGrid/parallelSortDNSzBinJames 47822547 47822547 212 0.0291&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[nlines of csv] [nlines of ordered.crd] [number of element in z] [z domain width]&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Note:''' These inputs are specfic to this executable. Changing executable will change which is used&lt;br /&gt;
* Also note that the &amp;lt;code&amp;gt;[number of elements in z]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;nsons&amp;lt;/code&amp;gt; - 1 or the number of nodes in z - 1.&lt;br /&gt;
&lt;br /&gt;
==== 3. Create Interpolated files ====&lt;br /&gt;
&lt;br /&gt;
This step will create the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files used by PHASTA to perform the interpolation.&lt;br /&gt;
&lt;br /&gt;
# Create &amp;lt;code&amp;gt;Interpolate...&amp;lt;/code&amp;gt; directory in the target's Chef directory&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;coords.[target nprocs]&amp;lt;/code&amp;gt; files (that were created by Chef) to the a directory called &amp;lt;code&amp;gt;coordsTarget&amp;lt;/code&amp;gt; &lt;br /&gt;
#* Note  that it's been common practice to put these files in a directory called &amp;lt;code&amp;gt;Coords&amp;lt;/code&amp;gt; within a Chef directory. In that case, just symlink the whole directory&lt;br /&gt;
# Create a directory called &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt;&lt;br /&gt;
#* This may be corrected in the future, but currently if &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; is not present the job will fail&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;source.sln&amp;lt;/code&amp;gt; to the directory and the &amp;lt;code&amp;gt;ordered.crd&amp;lt;/code&amp;gt; file as &amp;lt;code&amp;gt;source.crd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the interpolation executable via mpirun on an interactive job.&lt;br /&gt;
# This creates a series of &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files in the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
'''Example Command:''' &amp;lt;code&amp;gt;mpirun -np 64 $ph_aesp/Utilities/Intpolate/par3DInterp3 16 799 281 213&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The inputs for this command are &amp;lt;code&amp;gt;[parts per MPIProc] [nx] [ny] [nz]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Note that the number of processes given to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; times the &amp;lt;code&amp;gt;[parts per MPIProc]&amp;lt;/code&amp;gt; must be equal to the number of target partitions. In this case, the target partition was 1024, so 64*16 = 1024&lt;br /&gt;
* The way it works is that each of the 64 MPIProcs is given 16 partitions to interpolate.&lt;br /&gt;
&lt;br /&gt;
==== 4. Interpolate the solution in PHASTA ====&lt;br /&gt;
&lt;br /&gt;
This step will take the &amp;lt;code&amp;gt;solInterp.[target nprocs]&amp;lt;/code&amp;gt; files and load them as initial conditions.&lt;br /&gt;
&lt;br /&gt;
# Symlink the &amp;lt;code&amp;gt;solnTarget&amp;lt;/code&amp;gt; directory into the &amp;lt;code&amp;gt;[target nprocs]-procs_case&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
# Add/uncomment &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt; &lt;br /&gt;
# Run PHASTA for 1 timestep and write out &amp;lt;code&amp;gt;restart-dat.[target nprocs]&amp;lt;/code&amp;gt; files&lt;br /&gt;
# Remove/comment out the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; line from the &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;&lt;br /&gt;
# The new restart files have the interpolated solution&lt;br /&gt;
#* Note that if you forget to remove the &amp;lt;code&amp;gt;Load and set 3D IC: True&amp;lt;/code&amp;gt; statement from &amp;lt;code&amp;gt;solver.inp&amp;lt;/code&amp;gt;, PHASTA will overwrite the existing solution in the restart files&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=615</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=615"/>
				<updated>2017-05-19T23:20:18Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
Our lab has 2 VirtualGL servers you can connect to from portal1. You must connect to one of them for large memory and/or computationally intensive processes.&lt;br /&gt;
The names of the servers are viz002 and viz003 (viz001 is probably never coming back to life).&lt;br /&gt;
 portal1 doesn't have a particularly fast graphics processor and MUST NOT be used for large memory or computationally intensive process)&lt;br /&gt;
&lt;br /&gt;
  vglconnect -s  viz002&lt;br /&gt;
or&lt;br /&gt;
  vglconnect -s viz003&lt;br /&gt;
&lt;br /&gt;
from this connection you will want to run graphic applications (e.g., SimModeler or ParaView) prefaced by the command vglrun.  You can test that you have it setup right&lt;br /&gt;
with the toyapp glxgears as follows&lt;br /&gt;
&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts).&lt;br /&gt;
&lt;br /&gt;
NOTE ALSO:  The primary purpose for viz003 is for visualization and for debugging.  Production runs should be done elsewhere. &lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu as in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L????:portal1:???? jumpgate-phasta.colorado.edu&amp;quot; on your machine. Enter the number between the -L and the first colon in the &amp;quot;Source port&amp;quot; box. Enter the rest in the Destination box (starting with portal1) and '''click the add button'''. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5900 jumpgate-phasta.colorado.edu&lt;br /&gt;
enter 5905 in the Source port box&lt;br /&gt;
enter portal1:5900 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59xx.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=614</id>
		<title>VNC</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=VNC&amp;diff=614"/>
				<updated>2017-05-19T23:09:56Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly. &lt;br /&gt;
&lt;br /&gt;
'''Warning: The vnc password is transmitted in clear text over the network and should not be considered secure'''&lt;br /&gt;
&lt;br /&gt;
Portal1 is designated to host VNC sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a VNC session:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  ssh portal1&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  start_vnc.sh&lt;br /&gt;
&lt;br /&gt;
Then follow the directions from start_vnc.sh. Make sure to remember your password and port number (59**) so that you can reuse your session.&lt;br /&gt;
&lt;br /&gt;
It's okay to leave your VNC session running on portal1. Next time you want to access your desktop, just ssh into jumpgate with a tunnel between portal1's vnc port (59**) and some port on your machine. Then use a VNC client to connect to the port on your machine.&lt;br /&gt;
&lt;br /&gt;
If, for some reason, you want to end your session and kill your virtual desktop, run&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
  stop_vnc.sh     # ONLY run this if you want to kill your virtual desktop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenGL == &lt;br /&gt;
&lt;br /&gt;
Portal1 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)&lt;br /&gt;
&lt;br /&gt;
Simply wrap your OpenGL program with the &amp;quot;vglrun&amp;quot; command&lt;br /&gt;
  vlgrun glxgears&lt;br /&gt;
&lt;br /&gt;
If you have access to another VirtualGL server you can connect to it first (Portal1 doesn't have a particularly fast graphics processor)&lt;br /&gt;
  vglconnect server&lt;br /&gt;
  vglrun glxgears&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts)&lt;br /&gt;
&lt;br /&gt;
== Clients == &lt;br /&gt;
&lt;br /&gt;
Portal1 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC&lt;br /&gt;
&lt;br /&gt;
Other VNC viewers will also work, such as TightVNC and RealVNC&lt;br /&gt;
&lt;br /&gt;
== Changing the VNC Password ==&lt;br /&gt;
&lt;br /&gt;
  /opt/tigervnc/bin/vncpasswd&lt;br /&gt;
&lt;br /&gt;
== View Only Mode == &lt;br /&gt;
&lt;br /&gt;
To share your desktop with another user in view only mode set a view only password &lt;br /&gt;
by running&lt;br /&gt;
  vncpasswd&lt;br /&gt;
&lt;br /&gt;
Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:&lt;br /&gt;
  vncviewer -viewonly&lt;br /&gt;
&lt;br /&gt;
== Windows == &lt;br /&gt;
The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;br /&gt;
&lt;br /&gt;
When you open putty, enter jumpgate-phasta.colorado.edu as in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run &amp;quot;ssh -L????:portal1:???? jumpgate-phasta.colorado.edu&amp;quot; on your machine. Enter the number between the -L and the first colon in the &amp;quot;Source port&amp;quot; box. Enter the rest in the Destination box (starting with portal1) and '''click the add button'''. Then click &amp;quot;Open&amp;quot; and login as normal. You will then be able to use a vncviewer as instructed by the script.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
The script says:&lt;br /&gt;
ssh -L5905:portal1:5900 jumpgate-phasta.colorado.edu&lt;br /&gt;
enter 5905 in the Source port box&lt;br /&gt;
enter portal1:5900 in the destination box.&lt;br /&gt;
&lt;br /&gt;
Try using this viewer utility&lt;br /&gt;
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip&lt;br /&gt;
&lt;br /&gt;
'''Connecting to your VNC with PuTTY'''&lt;br /&gt;
&lt;br /&gt;
Once we SSH to jumpgate (on the default SSH port 22), our main desktop on portal1 can be accessed via a VNC session as follows.&lt;br /&gt;
&lt;br /&gt;
# The VNC server should already be running on portal1 using port 59xx.&lt;br /&gt;
## To check the port, on portal1 run &amp;lt;code&amp;gt;/opt/vnc_script/findsession.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
## To confirm the VNC server is running (and see port), run &amp;lt;code&amp;gt;ps aux | grep vnc&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open PuTTY on your local machine.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;, SSH to &amp;lt;code&amp;gt;x@jumpgate-phasta.colorado.edu:22&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is your username on jumpgate, and &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; is the standard SSH port.&lt;br /&gt;
# Under &amp;quot;Session&amp;quot;&amp;gt;&amp;quot;SSH&amp;quot;&amp;gt;&amp;quot;Tunnels&amp;quot;, select source port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt; and destination port &amp;lt;code&amp;gt;portal1:59xx&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is the two-digit number of your VNC session. Select destination &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and click &amp;quot;Add&amp;quot;. We select &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; because we have a service (VNC Server) running on a machine (portal1) that can be reached from the remote machine (jumpgate), and we want to access it directly from the &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; machine.&lt;br /&gt;
# Confirm the dialog by clicking &amp;quot;Open&amp;quot;, thus establishing an SSH connection between localhost and jumpgate, and tunneling localhost:59xx to portal1:59xx via this connection.&lt;br /&gt;
# Open RealVNC, and connect to &amp;lt;code&amp;gt;localhost:xx&amp;lt;/code&amp;gt;, which is shorthand for &amp;lt;code&amp;gt;localhost:59xx&amp;lt;/code&amp;gt;. VNC ports are enumerated starting with &amp;lt;code&amp;gt;5901&amp;lt;/code&amp;gt;, so any two digit port &amp;lt;code&amp;gt;xx&amp;lt;/code&amp;gt; is assumed to be port &amp;lt;code&amp;gt;59xx&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You should now have access to your desktop on portal1.&lt;br /&gt;
&lt;br /&gt;
== Web Based Viewer ==&lt;br /&gt;
&lt;br /&gt;
If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer&lt;br /&gt;
&lt;br /&gt;
Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to &lt;br /&gt;
&lt;br /&gt;
ssh -L5905:portal1:5902 jumpgate-phasta.colorado.edu you should&lt;br /&gt;
  ssh -L5902:portal1:5902 -L5802:portal1:5802 jumpgate-phasta.colorado.edu&lt;br /&gt;
Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)&lt;br /&gt;
&lt;br /&gt;
== Changing the Size (Resolution) of an Existing Session ==&lt;br /&gt;
&lt;br /&gt;
You can usually use the &amp;quot;xrandr&amp;quot; tool to change the resolution of a running vnc session. First you'll need to know your session's display number (this should be the last digit or two of the port number). For example, if your VNC session is running on port 5902, then your screen number should be :2. For this example, we'll use screen 2. &lt;br /&gt;
&lt;br /&gt;
Once you know your screen number, you can see the list of supported modes as follows:&lt;br /&gt;
  xrandr -display :2&lt;br /&gt;
&lt;br /&gt;
Once you pick the one you want (generally the same size or smaller than the native resolution of your client), you can choose it by running a command like&lt;br /&gt;
  xrandr -s 1400x1050 -display :2&lt;br /&gt;
&lt;br /&gt;
(this example will set the resolution to 1400 pixels by 1050 pixels)&lt;br /&gt;
&lt;br /&gt;
You'll probably be disconnected at this point, but when you reconnect your screen size should be changed (hopefully without crashing your running programs). &lt;br /&gt;
&lt;br /&gt;
== Finding an Existing Session ==&lt;br /&gt;
SSH to portal1 and then run:&lt;br /&gt;
  /opt/vnc_script/findsession.sh&lt;br /&gt;
&lt;br /&gt;
Which will return the shortened port number of each of your currently running sessions.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc&lt;br /&gt;
&lt;br /&gt;
stop_vnc.sh may display some errors; this is normal.&lt;br /&gt;
&lt;br /&gt;
If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu&lt;br /&gt;
&lt;br /&gt;
If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)&lt;br /&gt;
&lt;br /&gt;
VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later. &lt;br /&gt;
&lt;br /&gt;
If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.&lt;br /&gt;
&lt;br /&gt;
If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu&lt;br /&gt;
&lt;br /&gt;
If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this&lt;br /&gt;
  vncviewer -encodings tight -quality 6 -compresslevel 6&lt;br /&gt;
If you have trouble with text distortion try adding &lt;br /&gt;
  -nojpeg&lt;br /&gt;
&lt;br /&gt;
If you're running OSX and see an error about Zlib, try changing your compression settings (maximum quality usually works) or use a different client. RealVNC and certain versions of ChickenOfTheVNC both exhibit this issue. The latest build of TigerVNC should work reliably, as does the Java based TightVNC client.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=ParaViewOnTukey&amp;diff=600</id>
		<title>ParaViewOnTukey</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=ParaViewOnTukey&amp;diff=600"/>
				<updated>2016-06-30T23:23:11Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Video Tutorial about how to run a pvserver-syncio in parallel on the Tukey visualization nodes and connect the pvserver to a ParaView Gui running on portal0 at Colorado */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Video Tutorial about how to run a pvserver-syncio in parallel on the Tukey visualization nodes and connect the pvserver to a ParaView Gui running on portal0 at Colorado ==&lt;br /&gt;
  http://fluid.colorado.edu/~mrasquin/Documents_HIDE/Tukey/ParaviewOnTukeyFromPortal0/index.html&lt;br /&gt;
&lt;br /&gt;
This video can be copied from /users/mrasquin/public_html/Documents_HIDE/Tukey/ParaviewOnTukeyFromPortal0 on the viz nodes.&lt;br /&gt;
&lt;br /&gt;
== Video Tutorial about how to run a pvserver-syncio in parallel on the Tukey visualization nodes and connect the pvserver to a ParaView Gui running on the Tukey login node ==&lt;br /&gt;
  http://fluid.colorado.edu/~mrasquin/Tukey/ParaviewOnTukeyThroughVNC/index.html&lt;br /&gt;
 &lt;br /&gt;
This video can be copied from /users/mrasquin/public_html/Tukey/ParaviewOnTukeyThroughVNC on the viz nodes.&lt;br /&gt;
&lt;br /&gt;
Note that because vncserver on the Tukey head node does not support OpenGL, this method does not allow the export of png pictures from the ParaView Gui. Indeed, the result will be completely fuzzy. The first method is therefore strongly recommended.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=570</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=570"/>
				<updated>2015-07-13T02:35:48Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a wrapper layer approach&lt;br /&gt;
where the functions that the PHASTA workflow  directly uses to perform IO are:&lt;br /&gt;
&lt;br /&gt;
#            phio_openfileread (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            phio_openfilewrite (in addition to specializing filename string for particular library, this function can call initphmpiio in the case of syncio)&lt;br /&gt;
#            phio_readheader&lt;br /&gt;
#            phio_readdatablock&lt;br /&gt;
#            phio_writeheader&lt;br /&gt;
#            phio_writedatablock&lt;br /&gt;
#            phio_closefile&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those seven wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) push all init stuff  into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=569</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=569"/>
				<updated>2015-07-13T02:33:49Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a wrapper layer approach&lt;br /&gt;
where the functions that the PHASTA workflow  directly uses to perform IO are:&lt;br /&gt;
&lt;br /&gt;
#            phio_openfile (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
#            closefile_phio&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) push all init stuff  into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=568</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=568"/>
				<updated>2015-07-12T05:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a wrapper layer approach&lt;br /&gt;
where the functions that the PHASTA workflow  directly uses to perform IO are:&lt;br /&gt;
&lt;br /&gt;
#            openfile_phio (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
#            closefile_phio&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) push all init stuff  into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=567</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=567"/>
				<updated>2015-07-12T05:22:52Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a wrapper layer approach&lt;br /&gt;
where the functions that the PHASTA workflow  directly uses to perform IO are:&lt;br /&gt;
&lt;br /&gt;
#            openfile_phio (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
#            closefile_phio&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) make new function called init and it will basically return doing nothing for posix but for syncio it will call query if it is init for read and then just do what initphmpiio currently does&lt;br /&gt;
        iii) this should allow us to push all init stuff into a single function or potentially all the way into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=566</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=566"/>
				<updated>2015-07-12T05:20:11Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a three layer approach&lt;br /&gt;
Layer 1 Functions that PHASTA workflow function use directly to perform IO&lt;br /&gt;
&lt;br /&gt;
#            openfile_phio (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
#            closefile_phio&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) make new function called init and it will basically return doing nothing for posix but for syncio it will call query if it is init for read and then just do what initphmpiio currently does&lt;br /&gt;
        iii) this should allow us to push all init stuff into a single function or potentially all the way into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=565</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=565"/>
				<updated>2015-07-12T05:19:23Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a three layer approach&lt;br /&gt;
Layer 1 Functions that PHASTA workflow function use directly to perform IO&lt;br /&gt;
&lt;br /&gt;
#            openfile_phio (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
&lt;br /&gt;
         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) make new function called init and it will basically return doing nothing for posix but for syncio it will call query if it is init for read and then just do what initphmpiio currently does&lt;br /&gt;
        iii) this should allow us to push all init stuff into a single function or potentially all the way into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=564</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=564"/>
				<updated>2015-07-12T05:18:38Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
To make the interface more simple, I propose, we push init into open and finalize into close.  Furthermore I propose that we consider a three layer approach&lt;br /&gt;
##Layer 1 Functions that PHASTA workflow function use directly to perform IO&lt;br /&gt;
#            openfile_phio (in addition to specializing filename string for particular library, this function can call queryphmpiio and initphmpiio in the case of syncio)&lt;br /&gt;
#            readheader_phio&lt;br /&gt;
#            readdatablock_phio&lt;br /&gt;
#            writeheader_phio&lt;br /&gt;
#            writedatablock_phio&lt;br /&gt;
##         These functions will be called by readnblk (and a few others) for reading and Write_restart (and a few clones) for writing.  Principally, these 6 functions will be wrappers that take in partial strings and the usual arguments for their PhastaIO functions  and then perform the necessary string specializations for the particular flavor of PhastaIO being used (e.g,, syncio or posix) before then ultimately calling the PhastaIO function (that already has a branching based on the two flavors).  Cameron has proposed housing those six wrappers in phIO.c which seems fine to me.  Helper functions can go in the same file.&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.2' Move query and init into B)&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (DONE I THINK)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) make new function called init and it will basically return doing nothing for posix but for syncio it will call query if it is init for read and then just do what initphmpiio currently does&lt;br /&gt;
        iii) this should allow us to push all init stuff into a single function or potentially all the way into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=563</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=563"/>
				<updated>2015-07-11T19:41:09Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (hopefully complete to  15-July-11)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;br /&gt;
&lt;br /&gt;
     3) usr.c opens restart to read saved projection vectors.  Not a problem per se but might be better to read this while we have the restart already open so that the IO code is more compact.  This may involve moving more leslib stuff forward in the code&lt;br /&gt;
&lt;br /&gt;
    4) KEJ is still trying to sort out the roles of {query,init}phmpiio.  &lt;br /&gt;
         a) query is called before file is read the first time (same file read again can get by without it  e.g., readlesprojection reads restart a second time)&lt;br /&gt;
         b) init is called for both reads and writes of syncio files&lt;br /&gt;
&lt;br /&gt;
         preliminary design plan&lt;br /&gt;
         i) use setIOparam() to count syncio files.  If count=0 then assume posix.  use the count as a switch for file format everywhere (can be replaced later by agreed upon flag for file format...candidates: iotype= binary-posix, binary-mpiio instead of binary (not sure we want to preserve ascii unless it easy to do)&lt;br /&gt;
        ii) make new function called init and it will basically return doing nothing for posix but for syncio it will call query if it is init for read and then just do what initphmpiio currently does&lt;br /&gt;
        iii) this should allow us to push all init stuff into a single function or potentially all the way into openfile so that there are only 6 functions that any users sees in phastaIO for either syncio or posix&lt;br /&gt;
        openfile, closefile, {read,write}X{header,datablock}&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=562</id>
		<title>Work Plan In Memory Adapt</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Work_Plan_In_Memory_Adapt&amp;diff=562"/>
				<updated>2015-07-11T18:42:53Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: Created page with &amp;quot;SUMMARY of phases  phase0= clean syncio (almost there)  phase1=PHASTA can read AND write both  phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SUMMARY of phases&lt;br /&gt;
&lt;br /&gt;
phase0= clean syncio (almost there)&lt;br /&gt;
&lt;br /&gt;
phase1=PHASTA can read AND write both&lt;br /&gt;
&lt;br /&gt;
phase2=PHASTA runs after chef though an in-memory read of Chef's written in-memory data&lt;br /&gt;
&lt;br /&gt;
phase3=PHASTA writes its field back to chef and lets chef do a UR on its mesh and transfers fields &lt;br /&gt;
&lt;br /&gt;
phase4= bring that result back to phasta (so chef-&amp;gt;PHASTA-&amp;gt;chef-UR-&amp;gt;PHASTA-UR)&lt;br /&gt;
&lt;br /&gt;
phase5=replace UR with local adaptation&lt;br /&gt;
&lt;br /&gt;
phase6=loop and we are done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of discussion lets group phastaIO functions as follows&lt;br /&gt;
&lt;br /&gt;
A) init&lt;br /&gt;
&lt;br /&gt;
B) open-close&lt;br /&gt;
&lt;br /&gt;
C) read  (readheader, readdatablock)&lt;br /&gt;
&lt;br /&gt;
D) write  (writeheader, writedatablock)&lt;br /&gt;
&lt;br /&gt;
E) finalize&lt;br /&gt;
&lt;br /&gt;
DETAIL&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
  0.1 Move field string construction into C)-  status:  CWS has done this for  syncio (top of routines so not yet in a syncio conditional but this is not necessary until phase1)&lt;br /&gt;
&lt;br /&gt;
  0.2 Move file name  construction into B)-  status: not started but I think CWS indicated it was basically same work as 0.1 so leaving that with him. Note we don’t want this in init (at least for restarts) because we init only once but possibly write multiple times and the filename changes.&lt;br /&gt;
&lt;br /&gt;
  0.3 Migrating all of PHASTA to use 0.1 dev - status:  CWS did it for readnblk.f and this built and ran (YAY), KEJ is migrating it to the balance of PHASTA (hopefully complete to  15-July-11)&lt;br /&gt;
&lt;br /&gt;
  0.4  Repeat 0.1-0.3 for writing of files&lt;br /&gt;
&lt;br /&gt;
phase1&lt;br /&gt;
&lt;br /&gt;
   1.1  Migrate string constructors into  conditional for syncio&lt;br /&gt;
&lt;br /&gt;
   1.2  Create posix counterparts and put them in the posix branch of conditional&lt;br /&gt;
&lt;br /&gt;
   1.3 make init and finalize functions that have a universal call but, via conditionals (likely posix just returns but syncio has stuff to do but we want the PHASTA side to look the same regardless of IO chosen)&lt;br /&gt;
&lt;br /&gt;
   1.3  Debug to be sure that at least all tet meshes can be read with both posix/syncio&lt;br /&gt;
&lt;br /&gt;
   1.4  Debug to make sure that files written are correct (two successive runs)&lt;br /&gt;
&lt;br /&gt;
phase2&lt;br /&gt;
&lt;br /&gt;
   2.1 Create ability for Chef to write to memory location using posixIO pointed at a memory location instead of a file&lt;br /&gt;
&lt;br /&gt;
   2.2 Create ability to pass the descriptor of that memory location to PHASTA  (I think it is safe to assume that since we are one “file” per part in both Chef and PHASTA that this is just the starting location of where Chef started writing)&lt;br /&gt;
&lt;br /&gt;
   2.3 Create ability to have phasta initialize itself with posix-based PHASTAIO reads from this in-memory file/state that Chef wrote&lt;br /&gt;
&lt;br /&gt;
phase3&lt;br /&gt;
&lt;br /&gt;
   3.1 Create ability for PHASTA to write  adapt-fields (solution, d2wall, error, ybar) using posix-based PHASTAIO writes to a memory location&lt;br /&gt;
&lt;br /&gt;
   3.2  Create ability to pass the descriptor of that memory location back to Chef&lt;br /&gt;
&lt;br /&gt;
   3.3   Create ability for Chef to read adapt-fields when passed descriptor&lt;br /&gt;
&lt;br /&gt;
   3.4  Invoke a UR with solution transfer and write files to confirm phase3 success&lt;br /&gt;
&lt;br /&gt;
phase4&lt;br /&gt;
&lt;br /&gt;
  4.1  Should be trivial but have Chef write result of UR to a new memory location and pass descriptor to PHASTA to read and run again (comparing to file based version of the same which we are already doing at scale)&lt;br /&gt;
&lt;br /&gt;
phase5&lt;br /&gt;
&lt;br /&gt;
  5.1  Demonstrate that we can do file based local adaptive refinement with Chef  (I will let Dan and Cameron described the subtask developments here but am more than happy to help plan and assist in any way I can because we really need this capability…I am fine with ignoring/freezing boundary layers to get a working case going before taking on that much tougher nut).&lt;br /&gt;
&lt;br /&gt;
THORNY ISSUES&lt;br /&gt;
&lt;br /&gt;
phase0&lt;br /&gt;
&lt;br /&gt;
     1) extra write files.  Seems to me that there should be either&lt;br /&gt;
&lt;br /&gt;
        a) only 2  write_restart and write_field, or&lt;br /&gt;
&lt;br /&gt;
        b) an init function and then only write_field&lt;br /&gt;
&lt;br /&gt;
     2) dwall currently has two modes (in restart or in a separate file….do we really need to preserve this)&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=561</id>
		<title>Making A New Wiki</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=561"/>
				<updated>2015-07-11T18:36:00Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So you are ready to make make a brand new wiki page.  The process for doing this is:&lt;br /&gt;
&lt;br /&gt;
1) assuming you are reading this you are on the wiki page but be sure you login&lt;br /&gt;
&lt;br /&gt;
2) go to your browsers url and replace whatever is after index.php/ with whatever you want to name your page noting that underscores will map to spaces.  For example, this page was made by the following edit&lt;br /&gt;
http://fluid.colorado.edu/wiki/index.php/Making_A_New_Wiki&lt;br /&gt;
&lt;br /&gt;
3) assuming you chose a unique title this will take you to a new blank wiki page with a Create button near the top&lt;br /&gt;
&lt;br /&gt;
4) click that create button and then start composing your new wiki in the editing window&lt;br /&gt;
&lt;br /&gt;
5) when you are done with this draft (wikis are NEVER done) click the save page button (feel free to put something descriptive in the Summary window at the bottom.&lt;br /&gt;
&lt;br /&gt;
DONE&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=560</id>
		<title>Making A New Wiki</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=560"/>
				<updated>2015-07-11T18:35:38Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So you are ready to make make a brand new wiki page.  The process for doing this is:&lt;br /&gt;
&lt;br /&gt;
1) assuming you are reading this you are on the wiki page but be sure you login&lt;br /&gt;
&lt;br /&gt;
2) go to your browsers url and replace whatever is after index.php/ with whatever you want to name your page noting that underscores will map to spaces.  For example, this page was made by the following edit&lt;br /&gt;
http://fluid.colorado.edu/wiki/index.php/Making_A_New_Wiki&lt;br /&gt;
&lt;br /&gt;
3) assuming you chose a unique title this will take you to a new blank wiki page with a Create button near the top&lt;br /&gt;
&lt;br /&gt;
4) click that create button and then start composing your new wiki in the editing window&lt;br /&gt;
&lt;br /&gt;
5) when you are done with this draft (wikis are NEVER done) click the save page button (feel free to put something descriptive in the Summary window at the bottom.&lt;br /&gt;
DONE&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=559</id>
		<title>Making A New Wiki</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Making_A_New_Wiki&amp;diff=559"/>
				<updated>2015-07-11T18:34:51Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: Create a new wiki page in 5 easy steps.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So you are ready to make make a brand new wiki page.  The process for doing this is:&lt;br /&gt;
1) assuming you are reading this you are on the wiki page but be sure you login&lt;br /&gt;
2) go to your browsers url and replace whatever is after index.php/ with whatever you want to name your page noting that underscores will map to spaces.  For example, this page was made by the following edit&lt;br /&gt;
http://fluid.colorado.edu/wiki/index.php/Making_A_New_Wiki&lt;br /&gt;
3) assuming you chose a unique title this will take you to a new blank wiki page with a Create button near the top&lt;br /&gt;
4) click that create button and then start composing your new wiki in the editing window&lt;br /&gt;
5) when you are done with this draft (wikis are NEVER done) click the save page button (feel free to put something descriptive in the Summary window at the bottom.&lt;br /&gt;
DONE&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA/Reduce_Restart_and_Geombc_Files&amp;diff=558</id>
		<title>PHASTA/Reduce Restart and Geombc Files</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA/Reduce_Restart_and_Geombc_Files&amp;diff=558"/>
				<updated>2015-06-11T00:43:43Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel, phParAdapt-SCOREC or chef */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reduction from M parts to 1 part in serial for phasta files initially partitioned with NSpre_parallel ==&lt;br /&gt;
&lt;br /&gt;
*cd to the procs_case directory that contains the files you want to reduce&lt;br /&gt;
*Run the executable:&lt;br /&gt;
   ~mrasquin/develop/phasta/phPost/phPost/bin/x86_64_linux-icc/reduce-openmpi-O -sn&lt;br /&gt;
where sn is the time step number. For example, the restart files corresponding to time step 5 would be restart.5.* and geombc.dat.* . &lt;br /&gt;
*The reduce operation will generate restart.##.0 in the procs_case directory, where ## stands for the step number you have reduced.&lt;br /&gt;
*restart.##.0, combined with geombc.dat.1 (which contains the boundary conditions for all the parts - it is created when you run NSPre_Parasolid), are what you need to see the solution on 1 part.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel, phParAdapt-SCOREC or chef ==&lt;br /&gt;
&lt;br /&gt;
* Prerequisites:&lt;br /&gt;
The tool described in this section apply to phasta files initially partitioned with phParAdapt-SCOREC or chef. We consider here that M parts were generated from N parts with M&amp;gt;N (M is usually a multiple of N). A vertex mapping between the M parts and N parts needs to be generated by phParAdapt-SCOREC or chef through the variable &amp;quot;buildMapping 1&amp;quot; in adapt.inp.&lt;br /&gt;
&lt;br /&gt;
* Download the M2N and M2NFixBdn packages from&lt;br /&gt;
  cd your-develop-dir-cmake/phasta&lt;br /&gt;
  git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2N  &lt;br /&gt;
  git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
* Build both packages with cmake. For instance, on the viz nodes with gcc:&lt;br /&gt;
&lt;br /&gt;
  cd your-develop-dir-cmake&lt;br /&gt;
&lt;br /&gt;
  mkdir build-M2N&lt;br /&gt;
  cd build-M2N&lt;br /&gt;
  CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2N/src&lt;br /&gt;
  make -j 8 VERBOSE=1&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
  mkdir build-M2NFixBnd&lt;br /&gt;
  cd build-M2NFixBnd&lt;br /&gt;
  CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2NFixBnd/src&lt;br /&gt;
  make -j 8 VERBOSE=1&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
* Run M2N on M processes&lt;br /&gt;
&lt;br /&gt;
  mpirun -np M  your-develop-dir-cmake/build-M2N/M2N&lt;br /&gt;
&lt;br /&gt;
Input: M2N reads&lt;br /&gt;
  - The geombc files files under the SyncIO format (M parts);&lt;br /&gt;
  - The solution, dwal, error and ybar fields from a set of restart files under the SyncIO format (M parts) for adaptation or post-processing later;&lt;br /&gt;
  - The vertex mapping field from a set of restart files under the SyncIO format (M parts). &lt;br /&gt;
  - An input file named &amp;quot;M2N_input.dat&amp;quot; described below&lt;br /&gt;
Note that usually, the vertex mapping field is included in the restart files of the first time step of your computation, whereas the solution, dwal, error and dwal come from the last time step of the computation.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;M2N_input.dat&amp;quot; must include the following information:&lt;br /&gt;
  120  # time step of the restart files for solution, dwal, error and ybar.  It can be very useful when processing many files on queued systems to &lt;br /&gt;
          # replace this number (120)  by Step2Red and then use sed in the submit script to replace it with a number entered on the command line &lt;br /&gt;
          # e.g., Step2Red=$4&lt;br /&gt;
          #         sed &amp;quot;s/Step2Red/${Step2Red}/g&amp;quot; M2N_inputSed.dat &amp;gt; M2N_input.dat    &lt;br /&gt;
          # for easy replacement just ahead of execution and $4 is the 4th argument on the submit script passed to the run script with this insertion&lt;br /&gt;
  100  # time step of the restart files for partID and vtxID (mapping between M and N)&lt;br /&gt;
  0    # Reduce method: 0 = communicatoin based approach (recommended), 1 = file based approach. &lt;br /&gt;
  1    # (For reduce method = 1 only): 0 = ascii files, 1 = binary files&lt;br /&gt;
  1    # Print debug statement if = 1, none if = 0 (recommended at scale)&lt;br /&gt;
&lt;br /&gt;
Output: M2N produces&lt;br /&gt;
  - N restart files under the Posix format, which is what phParAdapt requires for now.&lt;br /&gt;
&lt;br /&gt;
* Run M2NFixBnd on N processes&lt;br /&gt;
&lt;br /&gt;
The value of the solution, dwal, errors and ybar fields still need to be updated on the part boundaries of the N parts, which is the purpose of M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
    mpirun -np N  your-develop-dir-cmake/build-M2NFixBnd/M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
Input: M2NFixBnd reads&lt;br /&gt;
  - The solution, dwal, errors and ybars field from the N restart files under the Posix format produced by M2N in the previous step;&lt;br /&gt;
  - The ilwork array from the N geombc files  under the Posix format that matches the restart files produced by M2N.&lt;br /&gt;
&lt;br /&gt;
Output: M2NFixBnd produces&lt;br /&gt;
  - N restart files under the posix format that overwrite the ones generated by M2N.&lt;br /&gt;
&lt;br /&gt;
* Example&lt;br /&gt;
&lt;br /&gt;
See &lt;br /&gt;
&lt;br /&gt;
  /users/mrasquin/Models/CrossFlowTest/1-A0-Mixed-9.0/SyncIO-phPA/Runs-pumi-Tet-ts100/ReduceM2N-16TetPumi-8MixedSim/runReduceM2N.sh&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=PHASTA/Reduce_Restart_and_Geombc_Files&amp;diff=557</id>
		<title>PHASTA/Reduce Restart and Geombc Files</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=PHASTA/Reduce_Restart_and_Geombc_Files&amp;diff=557"/>
				<updated>2015-06-11T00:42:01Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reduction from M parts to 1 part in serial for phasta files initially partitioned with NSpre_parallel ==&lt;br /&gt;
&lt;br /&gt;
*cd to the procs_case directory that contains the files you want to reduce&lt;br /&gt;
*Run the executable:&lt;br /&gt;
   ~mrasquin/develop/phasta/phPost/phPost/bin/x86_64_linux-icc/reduce-openmpi-O -sn&lt;br /&gt;
where sn is the time step number. For example, the restart files corresponding to time step 5 would be restart.5.* and geombc.dat.* . &lt;br /&gt;
*The reduce operation will generate restart.##.0 in the procs_case directory, where ## stands for the step number you have reduced.&lt;br /&gt;
*restart.##.0, combined with geombc.dat.1 (which contains the boundary conditions for all the parts - it is created when you run NSPre_Parasolid), are what you need to see the solution on 1 part.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel, phParAdapt-SCOREC or chef ==&lt;br /&gt;
&lt;br /&gt;
* Prerequisites:&lt;br /&gt;
The tool described in this section apply to phasta files initially partitioned with phParAdapt-SCOREC or chef. We consider here that M parts were generated from N parts with M&amp;gt;N (M is usually a multiple of N). A vertex mapping between the M parts and N parts needs to be generated by phParAdapt-SCOREC or chef through the variable &amp;quot;buildMapping 1&amp;quot; in adapt.inp.&lt;br /&gt;
&lt;br /&gt;
* Download the M2N and M2NFixBdn packages from&lt;br /&gt;
  cd your-develop-dir-cmake/phasta&lt;br /&gt;
  git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2N  &lt;br /&gt;
  git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
* Build both packages with cmake. For instance, on the viz nodes with gcc:&lt;br /&gt;
&lt;br /&gt;
  cd your-develop-dir-cmake&lt;br /&gt;
&lt;br /&gt;
  mkdir build-M2N&lt;br /&gt;
  cd build-M2N&lt;br /&gt;
  CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2N/src&lt;br /&gt;
  make -j 8 VERBOSE=1&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
  mkdir build-M2NFixBnd&lt;br /&gt;
  cd build-M2NFixBnd&lt;br /&gt;
  CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2NFixBnd/src&lt;br /&gt;
  make -j 8 VERBOSE=1&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
* Run M2N on M processes&lt;br /&gt;
&lt;br /&gt;
  mpirun -np M  your-develop-dir-cmake/build-M2N/M2N&lt;br /&gt;
&lt;br /&gt;
Input: M2N reads&lt;br /&gt;
  - The geombc files files under the SyncIO format (M parts);&lt;br /&gt;
  - The solution, dwal, error and ybar fields from a set of restart files under the SyncIO format (M parts) for adaptation or post-processing later;&lt;br /&gt;
  - The vertex mapping field from a set of restart files under the SyncIO format (M parts). &lt;br /&gt;
  - An input file named &amp;quot;M2N_input.dat&amp;quot; described below&lt;br /&gt;
Note that usually, the vertex mapping field is included in the restart files of the first time step of your computation, whereas the solution, dwal, error and dwal come from the last time step of the computation.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;M2N_input.dat&amp;quot; must include the following information:&lt;br /&gt;
  120  # time step of the restart files for solution, dwal, error and ybar.  It can be very useful when processing many files on queued systems to &lt;br /&gt;
          # replace this number by Step2Red and then use sed in the submit script to replace it with a number entered on the command line &lt;br /&gt;
          # e.g., Step2Red=$4&lt;br /&gt;
          #         sed &amp;quot;s/Step2Red/${Step2Red}/g&amp;quot; M2N_inputSed.dat &amp;gt; M2N_input.dat    &lt;br /&gt;
          # and replace th3 120 in this example by the string Step2Red for easy replacement just ahead of execution and $4 is the 4th argument on the submit script&lt;br /&gt;
  100  # time step of the restart files for partID and vtxID (mapping between M and N)&lt;br /&gt;
  0    # Reduce method: 0 = communicatoin based approach (recommended), 1 = file based approach. &lt;br /&gt;
  1    # (For reduce method = 1 only): 0 = ascii files, 1 = binary files&lt;br /&gt;
  1    # Print debug statement if = 1, none if = 0 (recommended at scale)&lt;br /&gt;
&lt;br /&gt;
Output: M2N produces&lt;br /&gt;
  - N restart files under the Posix format, which is what phParAdapt requires for now.&lt;br /&gt;
&lt;br /&gt;
* Run M2NFixBnd on N processes&lt;br /&gt;
&lt;br /&gt;
The value of the solution, dwal, errors and ybar fields still need to be updated on the part boundaries of the N parts, which is the purpose of M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
    mpirun -np N  your-develop-dir-cmake/build-M2NFixBnd/M2NFixBnd&lt;br /&gt;
&lt;br /&gt;
Input: M2NFixBnd reads&lt;br /&gt;
  - The solution, dwal, errors and ybars field from the N restart files under the Posix format produced by M2N in the previous step;&lt;br /&gt;
  - The ilwork array from the N geombc files  under the Posix format that matches the restart files produced by M2N.&lt;br /&gt;
&lt;br /&gt;
Output: M2NFixBnd produces&lt;br /&gt;
  - N restart files under the posix format that overwrite the ones generated by M2N.&lt;br /&gt;
&lt;br /&gt;
* Example&lt;br /&gt;
&lt;br /&gt;
See &lt;br /&gt;
&lt;br /&gt;
  /users/mrasquin/Models/CrossFlowTest/1-A0-Mixed-9.0/SyncIO-phPA/Runs-pumi-Tet-ts100/ReduceM2N-16TetPumi-8MixedSim/runReduceM2N.sh&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=NSPre&amp;diff=508</id>
		<title>NSPre</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=NSPre&amp;diff=508"/>
				<updated>2015-02-12T00:31:42Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are currently many versions of NSpre out there. It falls into the category of code that few people change but it gets out of date because it is built against libraries from Simmetrix that do change a few times a year.  If you find that the current recommended version fails for your case, send an email to Professor Jansen and he will redirect the email to the current maintainer.&lt;br /&gt;
&lt;br /&gt;
'''Current recommended version'''&lt;br /&gt;
&lt;br /&gt;
 /users/chitak/develop/phasta/phNSpre/phNSpre/bin/x86_64_linux-icc/NSpre-Parasolid_Serial-openmpi-O&lt;br /&gt;
&lt;br /&gt;
If this fails AND you are working with older meshes and models, you may have to work with on of the older versions listed below.&lt;br /&gt;
&lt;br /&gt;
The oldest version of NSpre which should work with any meshes created with Simmetrix versions prior to 7.2-120626, uses geom.spj file (old attribute file format, created with simappssdk). This vesion can also use version_2 meshes. You need to have geom.xmt_txt, geom.spj, geom.sms files in the directory where you run this. &lt;br /&gt;
To use this NSpre (if you still have geom.spj files), use&lt;br /&gt;
&lt;br /&gt;
 /users/kjansen/NSpre-Parasolid_Serial-mpich1-O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have created your mesh with a version later than 7.x libraries, most probably above version is going to fail. Also, if you have used SimModeler to create your attribute file (*.smd), above version is not going to work. There is another executable for this. You need to have geom.xmt_txt, geom.smd, geom.sms files in the directory where you run it. The path is: &lt;br /&gt;
&lt;br /&gt;
 /users/chitak/Executables/NSpre-Parasolid_Serial-openmpi-O&lt;br /&gt;
&lt;br /&gt;
This and newer versions require a geom.smd file as the attribute file, so if you still have a geom.spj file, you can convert it to smd format (check [[SimModeler]])&lt;br /&gt;
&lt;br /&gt;
There are counterparts for these executables which use discrete model (*-Discrete_*). You can use the same parallel NSpre executable from&lt;br /&gt;
&lt;br /&gt;
 /users/kjansen/NSpre_Parallel-mpich1-O&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=SimModeler&amp;diff=506</id>
		<title>SimModeler</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=SimModeler&amp;diff=506"/>
				<updated>2014-08-14T19:16:20Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Creating new files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software]]&lt;br /&gt;
&lt;br /&gt;
SimModeler is a model creation program from Simmetrix.  It takes the mesh and geometric model and creates the input files for PHASTA.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run SimModeler, first connect via VNC, then use vglconnect to connect to one of the compute machines:&lt;br /&gt;
&lt;br /&gt;
 vglconnect -s viz001&lt;br /&gt;
&lt;br /&gt;
Add the desired version of SimModeler to your environment (the below example will get the &amp;quot;default&amp;quot; version):&lt;br /&gt;
&lt;br /&gt;
 soft add +simmodeler&lt;br /&gt;
&lt;br /&gt;
and lunch the GUI:&lt;br /&gt;
&lt;br /&gt;
 vglrun simmodeler&lt;br /&gt;
&lt;br /&gt;
== Converting old files ==&lt;br /&gt;
This is a guide for converting old files (parasolid and .spj) to the new format (.smd).&lt;br /&gt;
&lt;br /&gt;
After connecting to one of the compute machines, add the suite of tools for SimModeler to your environment:&lt;br /&gt;
&lt;br /&gt;
 soft add +simmodsuite&lt;br /&gt;
&lt;br /&gt;
From your case, make a new directory and copy your parasolid (.x_t or .xmt_txt), and .spj file into it. Rename the parasolid file to geom.xmt_txt and the .spj file to geom.spj, if they aren't already named that way. Then from the directory just created (now holds geom.xmt_txt and geom.spj) run: &lt;br /&gt;
&lt;br /&gt;
 ~matthb2/simmodelerconvert/testConvert &lt;br /&gt;
&lt;br /&gt;
Your directory now contains two new files: model.smd and model.x_t&lt;br /&gt;
&lt;br /&gt;
== Creating new files ==&lt;br /&gt;
&lt;br /&gt;
Loading in geometry is about as intuitive as is possibly can be. Go to File -&amp;gt; Import Geometry, browse to the appropriate model, and select Open. Once open, it is possible to both mesh the model and to create boundary conditions for it. Because BLMesher is presently the primary meshing tool, it is only necessary to use SimModeler to create boundary conditions. Go to Analysis -&amp;gt; Select Solver, and select phasta. After selecting phasta, the Analysis Attributes option under Analysis becomes valid. Clicking it brings up the corresponding window. From this new window, it is possible to apply  boundary conditions and initial conditions by clicking the small button next to the drop down menu [add picture]. Note you must also double click on &amp;quot;problem definition&amp;quot; which will allow you to name the case.  Later post processing expects the name &amp;quot;geom&amp;quot; so always name it so.&lt;br /&gt;
&lt;br /&gt;
== Boundary conditions ==&lt;br /&gt;
&lt;br /&gt;
Commonly boundary conditions include:&lt;br /&gt;
&lt;br /&gt;
*comp3 - Specifies a 3D velocity vector&lt;br /&gt;
*comp1 - Specifies a 3D vector in which the velocity is constrained. Velocity normal to this vector is not directly affected. This is useful for creating slip walls and mimicking free stream regions. &lt;br /&gt;
*temperature - Sets the temperature of the wall. This is only needed for compressible cases. &lt;br /&gt;
*scalar_1 - Sets the scalar_1 / eddy viscosity to apply at a wall. For the Spalart Allmaras models, scalar_1 should be zero at physical walls where a boundary layer develops and 3 to 5 times the molecular viscosity at free stream boundaries (http://turbmodels.larc.nasa.gov/spalart.html)&lt;br /&gt;
*surf ID - Associates a number with one or more faces. This can then be read by Phasta and used to apply more complicated boundary conditions in software. &lt;br /&gt;
*natural pressure - Apply a mean pressure over a surface. The pressure at any particular point is still allowed to vary (someone verify). &lt;br /&gt;
*traction vector - ??. The zero vector is typically applied at outlet. &lt;br /&gt;
*heat flux - Specifies the rate at which heat is injected / removed (not sure which one) into / from the fluid domain. The value is almost always set to zero to create a perfectly insulated boundary. &lt;br /&gt;
*scalar_1 flux - set the flux of scalar_1 / eddy viscosity into / out of the domain (not sure which one). This is typically only used at outlets where high values of eddy viscosity have been convected downstream of turbulent walls. The value is almost always set to zero. &lt;br /&gt;
*turbulence wall - Indicates that a surface is to be included in the calculation of d2wall files (verify) which are then used by the Spalart Allmaras turbulence model to generate more physical turbulent kinetic energy production / dissipation budgets.&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=GridFTP&amp;diff=81</id>
		<title>GridFTP</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=GridFTP&amp;diff=81"/>
				<updated>2011-09-06T21:21:19Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* GSISSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
GridFTP is a high performance file transfer tool supported by many of the large super-compute sites. It uses parallelism to hide the effects of latency and TCP's congestion controls. &lt;br /&gt;
&lt;br /&gt;
GridFTP is part of the larger Globus Toolkit, which also includes (among other things) a custom PKI based authentication mechanism. This can be used to achieve password-less authentication with supported sites (most of TeraGrid for example).  &lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
GridFTP should already be in your path and configured by default on jumpgate-phasta.colorado.edu. If it is not (due to unusual shell configuration or other issues) you can usually get it by running&lt;br /&gt;
&lt;br /&gt;
  source /etc/profile&lt;br /&gt;
&lt;br /&gt;
To test if you have GridFTP in your path correctly you can run these command (each should give you some output)&lt;br /&gt;
&lt;br /&gt;
  which globus-url-copy&lt;br /&gt;
  which myproxy-logon&lt;br /&gt;
  echo $GLOBUS_LOCATION&lt;br /&gt;
  echo $LD_LIBRARY_PATH | grep gt5&lt;br /&gt;
&lt;br /&gt;
To use sshftp mode, you'll also want to have a SSH preshared key configured with your account, (either without a password, or with ssh-agent)&lt;br /&gt;
&lt;br /&gt;
==Authentication==&lt;br /&gt;
&lt;br /&gt;
Most sites support the use of &amp;quot;GSI&amp;quot; password-less authentication. If the site you want to connect to offers this option, you probably want to use it. &lt;br /&gt;
&lt;br /&gt;
The way GSI authentication is usually implemented uses a tool called &amp;quot;myproxy&amp;quot; which generates a key which you can use for a short time to authenticate without a password. &lt;br /&gt;
&lt;br /&gt;
The first step to using GSI authentication is to install the necessary certificates in your home directory. Most sites will allow you to do this automatically using the myproxy tool's &amp;quot;-T&amp;quot; option. You only need to use this option the first time you use myproxy. &lt;br /&gt;
&lt;br /&gt;
For example, to configure my account to connect to the GridFTP/myproxy server at ANL, I could use this command:&lt;br /&gt;
&lt;br /&gt;
  myproxy-logon -T -l matthb -t 300 -s gs1.intrepid.alcf.anl.gov&lt;br /&gt;
&lt;br /&gt;
This command can be disected as follows:&lt;br /&gt;
-T tells myproxy to fetch the trust roots (CA, etc). You should only need to do this the first time you connect to a particular server and when the server's CA is updated. &lt;br /&gt;
&lt;br /&gt;
-l matthb specifies my username (replace &amp;quot;matthb&amp;quot; with your username)&lt;br /&gt;
&lt;br /&gt;
-t 300 specifies that I want my session key to expire in 300 hours (the default is 24)&lt;br /&gt;
&lt;br /&gt;
-s gs1.intrepid.alcf.anl.gov specifies the myproxy server (*not* necessarily the gridftp server)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common myproxy Servers ==&lt;br /&gt;
Intrepid and Eureka (ALCF/ANL)&lt;br /&gt;
  gs1.intrepid.alcf.anl.gov&lt;br /&gt;
(authenticate with your CryptoCard and pin)&lt;br /&gt;
&lt;br /&gt;
Teragrid (Kraken, Ranger, etc)&lt;br /&gt;
  myproxy.teragrid.org&lt;br /&gt;
(authenticate with your Teragrid portal username/password)&lt;br /&gt;
&lt;br /&gt;
*-phasta.colorado.edu &lt;br /&gt;
  myproxy-phasta.colorado.edu&lt;br /&gt;
(authenticate with your normal UNIX/LDAP username/password)&lt;br /&gt;
(coming soon)&lt;br /&gt;
&lt;br /&gt;
==GSISSH==&lt;br /&gt;
Once you have a GSI key/ticket, many sites allow you to use it to gain shell access as well as do file transfers. For example, even if I don't have my SecureID for Kraken handy, I can still log-in using GSI and my TeraGrid credentials as follows:&lt;br /&gt;
&lt;br /&gt;
  ssh jumpgate-phasta.colorado.edu&lt;br /&gt;
  myproxy-logon -T -l myteragriduser -s myproxy.teragrid.org&lt;br /&gt;
  gsissh mykrakenuser@kraken-gsi.nics.utk.edu&lt;br /&gt;
&lt;br /&gt;
==GridFTP==&lt;br /&gt;
The primary tool for doing GridFTP transfers is called &amp;quot;globus-url-copy&amp;quot; To see it's complete usage you can run&lt;br /&gt;
  globus-url-copy -help&lt;br /&gt;
&lt;br /&gt;
In general, you should start with the following set of options:&lt;br /&gt;
&lt;br /&gt;
  globus-url-copy -r -cd -rst -rst-retries 0 -fast -vb -p 64 -g2 -stripe -tcp-bs 4M&lt;br /&gt;
&lt;br /&gt;
followed by your source and destination URLs. &lt;br /&gt;
&lt;br /&gt;
To transfer to/from jumpgate-phasta.colorado.edu your URL should look something like this&lt;br /&gt;
&lt;br /&gt;
sshftp://username@jumpgate-phasta.colorado.edu/users/username/file&lt;br /&gt;
&lt;br /&gt;
Please see the site specific documentation for other site's URLs. These URLs may be helpful to get you started:&lt;br /&gt;
https://wiki.alcf.anl.gov/index.php/Using_GridFTP&lt;br /&gt;
https://www.teragrid.org/web/user-support/transfer_location&lt;br /&gt;
http://www.olcf.ornl.gov/kb_articles/gridftp/&lt;br /&gt;
&lt;br /&gt;
Recent versions of globus-url-copy also support a mode which behaves somewhat like rsync, enabled by the &lt;br /&gt;
  -sync -sync-level 3&lt;br /&gt;
flags. &lt;br /&gt;
&lt;br /&gt;
A complete example to copy a directory from ALCF to jumpgate would be:&lt;br /&gt;
&lt;br /&gt;
  globus-url-copy -r -cd -rst -rst-retries 0 -fast -vb -p 64 -stripe -tcp-bs 4M -g2 -sync -sync-level 3 gsiftp://gridftp.intrepid.alcf.anl.gov/intrepid-fs0/users/matthb/scratch/ sshftp://matthb2@jumpgate-phasta.colorado.edu/scratch/matthb2/scratch_from_anl/&lt;br /&gt;
&lt;br /&gt;
==UberFTP==&lt;br /&gt;
A simpler (but less powerful) tool to do GridFTP transfers is UberFTP. First get a certificate from myproxy as before then run:&lt;br /&gt;
  uberftp hostname&lt;br /&gt;
&lt;br /&gt;
Set the number of streams with&lt;br /&gt;
  parallel 128&lt;br /&gt;
&lt;br /&gt;
then interact as you would with traditional ftp. The full list of commands is available by typing &amp;quot;help&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  UberFTP&amp;gt; help&lt;br /&gt;
  Usage &amp;quot;help [topic]&amp;quot; where topic is one of:&lt;br /&gt;
  !               ?               active          ascii             binary          &lt;br /&gt;
  blksize         bugs            bye             cat             cd              &lt;br /&gt;
  cdup            chgrp           chmod           cksum             close           &lt;br /&gt;
  dcau            debug           dir             family            get             &lt;br /&gt;
  glob            hash            help            keepalive          lcat            &lt;br /&gt;
  lcd             lcdup           lchgrp          lchmod            lclose          &lt;br /&gt;
  ldir            lls             lmkdir          lopen             lpwd            &lt;br /&gt;
  lquote          lrename         lrm             lrmdir          ls              &lt;br /&gt;
  lsize           lstage          mget            mkdir           mode            &lt;br /&gt;
  mput            open            order           parallel        passive         &lt;br /&gt;
  pbsz            pget            pput            prot            put             &lt;br /&gt;
  pwd             quit            quote           rename          resume          &lt;br /&gt;
  retry           rm              rmdir           runique           size            &lt;br /&gt;
  stage           sunique         tcpbuf          versions            wait            &lt;br /&gt;
&lt;br /&gt;
You probably will need at least the &amp;quot;ls&amp;quot;, &amp;quot;get&amp;quot;, &amp;quot;put&amp;quot;, and &amp;quot;mget&amp;quot;/&amp;quot;mput&amp;quot; commands&lt;br /&gt;
&lt;br /&gt;
==GridFTP Tuning==&lt;br /&gt;
Depending on the network conditions, you can see massive GridFTP can perform very well or very poorly. You can often improve things by changing a few parameters:&lt;br /&gt;
&lt;br /&gt;
  -p 64&lt;br /&gt;
Specifies that you want to use 64 streams. Because TCP needs to receive an acknowledgment before more data can be sent latency can drastically reduce performance over long distances. By adding more streams you can increase the amount of in-transit data and somewhat hide the effects of latency. If performance is poor try increasing this number until you stop seeing improvement. Using excessive numbers of streams won't help and will increase the load on the servers involved. You shouldn't need more than one or two more doublings of the value recommended here.  &lt;br /&gt;
&lt;br /&gt;
  -pp&lt;br /&gt;
Enable pipelining. This can help with large number of files (particularly relatively small ones), but can also be buggy. If your transfers hang, try disabling this. If you're transferring lots of files, try enabling it. &lt;br /&gt;
&lt;br /&gt;
  -cc 4&lt;br /&gt;
Split the transfer over several (4 in this case) concurrent GridFTP sessions. This can also help with large numbers of small files. Use sparingly, and disable if you experience stalled/crashed transfers. &lt;br /&gt;
&lt;br /&gt;
  -sync-level 3&lt;br /&gt;
If you're using &amp;quot;sync&amp;quot; mode (similar to rsync) this determines the algorithm used to decide which files need to be (re) transferred. Level 3 uses checksums and will be the most reliable, but slowest. Level 2 is probably fine for most uses. See the globus-url-copy documentation for all the options.&lt;br /&gt;
&lt;br /&gt;
==More Examples==&lt;br /&gt;
Kraken:&lt;br /&gt;
  myproxy-logon -T -l teragriduser -s myproxy.teragrid.org&lt;br /&gt;
  globus-url-copy -dbg -r -cd -rst -rst-retries 0 -pp -fast -vb -p 64 -stripe -tcp-bs 4M -g2 gsiftp://user@gridftp.kraken.nics.teragrid.org:2811/lustre/scratch/bmatth/test.img sshftp://user@jumpgate-phasta.colorado.edu/scratch/user/&lt;br /&gt;
&lt;br /&gt;
Script to transfer from Kraken to jumpgate-phasta and vice versa (easy to update for other destinations):&lt;br /&gt;
  [[media:Transfer.sh | transfer.sh]]&lt;br /&gt;
&lt;br /&gt;
  example: ./transfer.sh 1 kraken2ucb /lustre/scratch/mrasquin/Models/Boeing/Beta/Open6_B5_D20_U20/15-A0-12jets/Runs-12jets/Archive4992.3600-3780/ /users/mrasquin/Models/Boeing/Beta/Open6_B5_D20_U20/15-A0-12jets/Runs-12jets/Archive4992.3600-3780/ 1&lt;br /&gt;
&lt;br /&gt;
You have to connect to jumpgate-phasta to execute this script. Do not forget to replace &amp;quot;mrasquin&amp;quot; by your TeraGrid login name (for the &amp;quot;myproxy-logon&amp;quot; command) and jumpgate-phasta and kraken login name (for the &amp;quot;globus-url-copy&amp;quot; commands).&lt;br /&gt;
&lt;br /&gt;
Note that it is faster to transfer a tar file than a directory that contains many files. But to tar or untar an archive on Kraken or Intrepid can take much more time so that it is recommended (so far) not to tar any directory and transfer its content directly.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting== &lt;br /&gt;
&lt;br /&gt;
If you get a message from myproxy that looks like this, try adding the &amp;quot;-b&amp;quot; option as prompted the (you should only need this option the first time you connect)&lt;br /&gt;
&lt;br /&gt;
  Error authenticating: GSS Major Status: Authentication Failed&lt;br /&gt;
  GSS Minor Status Error Chain:&lt;br /&gt;
  globus_gss_assist: Error during context initialization&lt;br /&gt;
  OpenSSL Error: s3_clnt.c:985: in library: SSL routines, function SSL3_GET_SERVER_CERTIFICATE:   certificate verify failed  &lt;br /&gt;
  globus_gsi_callback_module: Could not verify credential&lt;br /&gt;
  globus_gsi_callback_module: Can't get the local trusted CA certificate: Untrusted self-signed   certificate in chain with hash 9b95bbf2&lt;br /&gt;
  &lt;br /&gt;
  The CA that signed the myproxy-server's certificate is untrusted.&lt;br /&gt;
  If you want to trust the CA, re-run with the -b option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You command would then look something like this&lt;br /&gt;
&lt;br /&gt;
  myproxy-logon -s myproxy.teragrid.org -l matthb2 -T -b&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=34</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=34"/>
				<updated>2011-08-20T13:19:05Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Debugging Strategies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
Debugging can be a very difficult skill to learn.  It requires patience, persistence and determination but it can certainly be aided by skills and tips gained from hard earned experience.  &lt;br /&gt;
&lt;br /&gt;
The goal of this wiki is to organize our groups experience with debugging in general and specific tips for debugging our software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''General''' ==&lt;br /&gt;
&lt;br /&gt;
There are broadly three types of bugs that we encounter: 1) wrong results,  2) segmentation fault,  and 3) trapped unexpected behavior.  These are ordered in decreasing difficulty as will be clear shortly.&lt;br /&gt;
&lt;br /&gt;
''Wrong results:''  A lack of convergence or slow divergence of a problems that is expected or known to work with the given inputs  is not uncommon for code development but it is far and away the hardest bug to find.  The most effective strategy here is usually to compare against a working code that does not exhibit this behavior and be sure that all of the &amp;quot;deviations&amp;quot; from the known working code are expected.&lt;br /&gt;
&lt;br /&gt;
''Segmentation fault:''  Here, there is typically a corruption of memory such as an array going out of bounds,  Many of the debuggers mentioned below will stop at the location of the segmentation fault but be aware that this is not necessarily the location of the bug.  In many cases, memory corruption occurred in a non-fatal way at some early stage of the code and the place the code reports the segmentation fault is were the &amp;quot;dead body&amp;quot; is found and you must look at the corrupted array and look backward to see where it was modified which may lead to other arrays that were incorrectly modified etc.  This is especially true with indirect addressing arrays and memory pointers.  You should expect the compiling in debug mode will &amp;quot;move&amp;quot; the problem to a different location and, sadly in some situations, completely hide the problem (e.g., runs through successfully).  This is because when a code is compiled in debug mode, extra &amp;quot;padding&amp;quot; is put into the code to track the variables and you may be corrupting only this padding and not vital code.  '''''Valgrind''''' (someone provide a link and a wiki tutorial on its use please) can be very effective in finding this type of bug.  This type of fault can also occur when you run out of memory for the machine you are running on.  Please use '''''top''''' while your job is running to check for this type of failure.&lt;br /&gt;
&lt;br /&gt;
''Trapped unexpected behavior:''  Here checks were placed in the code to stop or report some information when execution led to an unexpected result (e.g., a negative volume computation or a residual that is not a number).  In general we like to put these kind of things in our code to make debugging easier but their is always a tradeoff between the time it takes to instrument the code, the effect the checks have on performance, and the benefit to debugging.  One compromise that is often employed is to put these checks inside of a compiler flag so that they are compiled in ONLY when running in debug mode.  '''MAJOR TIP:  When a code crashes ALWAYS recompile it in debug mode and rerun it as you may then get more information about where the bug is (e.g., go from Seg Fault to Trapped unexpected behavior).'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Choice of Debugger''' ==&lt;br /&gt;
&lt;br /&gt;
The first choice is what tool to debug with.  Your weapons range from graphical debuggers like '''''totalview''''' and '''''idb''''', to command line debuggers like '''''gdb''''', to print statements.  Different bugs/codes are handled best by different tools.&lt;br /&gt;
Launching and effectively getting help and/or running graphical debuggers are covered in separate wikis linked to the names in the list.  Here we only give a general overview of some experience (grow it!!) with each.&lt;br /&gt;
&lt;br /&gt;
''Graphical debuggers'' are best for marching through the code.  They can really help a new user learn the flow of the code and see various arrays being changed.  Any code that you want to have mastery of is worth spending time marching through the code in this way. Graphical debuggers are also effective at determining the location of bugs.&lt;br /&gt;
&lt;br /&gt;
''Command line debuggers''  link to gdb....some comments on when they are effective&lt;br /&gt;
&lt;br /&gt;
''Print  statements''  When you don't have effective access to the two above, inserting print statements can be an effective way of finding a bug.  It is more effective the more you know about your bug (e.g., when you know pretty close to where in the code the problem is and what variable is going bad).  Included in this category is writing out entire fields in a format that our post-processors can read so that you can look at the whole field in something like '''''paraview''''' that may give you a clue as to where the problem of the category &amp;quot;Wrong results&amp;quot; might be occurring.&lt;br /&gt;
&lt;br /&gt;
== '''Debugging Strategies''' ==&lt;br /&gt;
&lt;br /&gt;
''Recursive bisection:''  When you know where the code fails (or is producing wrong results) but don't have much of a clue where and why, this can be a good strategy.  What you need is some measure of correctness of some variable you can watch. Your strategy here is to first define the location in the code where it is believed to be correct and a second location where it is believed to be wrong. Then you bisect the code and check the middle location and determine if it is correct or wrong and then replace either the first or second location based on your answer (replace correct or wrong).  Keep applying this recursively and eventually you have a small section of code to find your bug in (e.g., one line).  This works extremely well for some bugs but it does have a few difficult assumptions that don't always hold true:  1) you know what is correct and wrong,  2) you know how to bisect your code (this can be hard before you actually know the code you are working with pretty well),  3) you are able to track a single variable through a function stack (not always possible) and/or know the code well enough to switch targets (and adjust measure of correctness).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''March (and compare):'' Marching in a debugger is tedious and many think it is boring but if you get your mind in the right place you can learn a lot about the code while you are marching (tell yourself you are not wasting time finding a bug but using the debugger to better learn the code).  As above, this strategy is more effective the better you know how to differentiate a correct result from and incorrect result on each &amp;quot;line&amp;quot; of the code, something that experience improves. This is where &amp;quot;compare&amp;quot; is a powerful tool for beginners (and everyone else).  Your ideal scenario is that you have a version of the code saved that was working when you started your development.  Before you start, make that working source code directory not writable ( chmod u-w * ).  You then make two directories with your inputs and  launch two versions of the debugger in each of these directories, one with the correct executable and one with the broken executable.  You then march through the code looking for differences.  Of course if you meet the requirements of Recursive bisection you can apply it to both codes and combine these strategies but when you don't, marching line by line and comparing results can often be effective (and you will in the process learn the code well AND likely develop the understanding of correctness required to use recursive bisection).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Specific tips for SCOREC/Simmetrix Meshing and MeshAdapt software and associated databases:'' &lt;br /&gt;
Because the mesh database is very rich and complex it can often be non-transparent to debugging.  To address this issues, functions have been created to help users debug.  If your debugging has identified a location and you  have successfully trapped the offending vertex, face, or region (typically you are iterating over one of these when some unexpected result occurs and is trapped), then you can call a function to get lots of information about that entity with&lt;br /&gt;
&lt;br /&gt;
 V_info(ivert)    // gives information about the the vertex  ivert&lt;br /&gt;
 F_info(iface)    // gives information about the the face  iface&lt;br /&gt;
 R_info(iregion)    // gives information about the the region  iregion&lt;br /&gt;
&lt;br /&gt;
These functions can either be compiled into the code and printed from traps that catch the unexpected behavior (and thereby help you understand the geometric location of the problem) or, with many debuggers, they can be called from the current command line to give you more information while stepping through the code.&lt;br /&gt;
&lt;br /&gt;
Once you find the offending geometric location, it is often possible to load the mesh (in cases where the mesher completed but some other program downstream of it fails) in paraview and draw  spheres at the location of the vertices, zoom to the vertices, cut the mesh with'' extract cells by region'' filter centered on the bad location and then see what is wrong (perhaps using a few different normal planes to get a clear view).  Often refining the mesh near this surface will improve element quality and fix the problem.&lt;br /&gt;
&lt;br /&gt;
ADD TO ME&lt;br /&gt;
&lt;br /&gt;
''Specific tips for PHASTA:'' &lt;br /&gt;
ADD TO ME&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=33</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=33"/>
				<updated>2011-08-20T13:16:38Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: /* Debugging Strategies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
Debugging can be a very difficult skill to learn.  It requires patience, persistence and determination but it can certainly be aided by skills and tips gained from hard earned experience.  &lt;br /&gt;
&lt;br /&gt;
The goal of this wiki is to organize our groups experience with debugging in general and specific tips for debugging our software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''General''' ==&lt;br /&gt;
&lt;br /&gt;
There are broadly three types of bugs that we encounter: 1) wrong results,  2) segmentation fault,  and 3) trapped unexpected behavior.  These are ordered in decreasing difficulty as will be clear shortly.&lt;br /&gt;
&lt;br /&gt;
''Wrong results:''  A lack of convergence or slow divergence of a problems that is expected or known to work with the given inputs  is not uncommon for code development but it is far and away the hardest bug to find.  The most effective strategy here is usually to compare against a working code that does not exhibit this behavior and be sure that all of the &amp;quot;deviations&amp;quot; from the known working code are expected.&lt;br /&gt;
&lt;br /&gt;
''Segmentation fault:''  Here, there is typically a corruption of memory such as an array going out of bounds,  Many of the debuggers mentioned below will stop at the location of the segmentation fault but be aware that this is not necessarily the location of the bug.  In many cases, memory corruption occurred in a non-fatal way at some early stage of the code and the place the code reports the segmentation fault is were the &amp;quot;dead body&amp;quot; is found and you must look at the corrupted array and look backward to see where it was modified which may lead to other arrays that were incorrectly modified etc.  This is especially true with indirect addressing arrays and memory pointers.  You should expect the compiling in debug mode will &amp;quot;move&amp;quot; the problem to a different location and, sadly in some situations, completely hide the problem (e.g., runs through successfully).  This is because when a code is compiled in debug mode, extra &amp;quot;padding&amp;quot; is put into the code to track the variables and you may be corrupting only this padding and not vital code.  '''''Valgrind''''' (someone provide a link and a wiki tutorial on its use please) can be very effective in finding this type of bug.  This type of fault can also occur when you run out of memory for the machine you are running on.  Please use '''''top''''' while your job is running to check for this type of failure.&lt;br /&gt;
&lt;br /&gt;
''Trapped unexpected behavior:''  Here checks were placed in the code to stop or report some information when execution led to an unexpected result (e.g., a negative volume computation or a residual that is not a number).  In general we like to put these kind of things in our code to make debugging easier but their is always a tradeoff between the time it takes to instrument the code, the effect the checks have on performance, and the benefit to debugging.  One compromise that is often employed is to put these checks inside of a compiler flag so that they are compiled in ONLY when running in debug mode.  '''MAJOR TIP:  When a code crashes ALWAYS recompile it in debug mode and rerun it as you may then get more information about where the bug is (e.g., go from Seg Fault to Trapped unexpected behavior).'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Choice of Debugger''' ==&lt;br /&gt;
&lt;br /&gt;
The first choice is what tool to debug with.  Your weapons range from graphical debuggers like '''''totalview''''' and '''''idb''''', to command line debuggers like '''''gdb''''', to print statements.  Different bugs/codes are handled best by different tools.&lt;br /&gt;
Launching and effectively getting help and/or running graphical debuggers are covered in separate wikis linked to the names in the list.  Here we only give a general overview of some experience (grow it!!) with each.&lt;br /&gt;
&lt;br /&gt;
''Graphical debuggers'' are best for marching through the code.  They can really help a new user learn the flow of the code and see various arrays being changed.  Any code that you want to have mastery of is worth spending time marching through the code in this way. Graphical debuggers are also effective at determining the location of bugs.&lt;br /&gt;
&lt;br /&gt;
''Command line debuggers''  link to gdb....some comments on when they are effective&lt;br /&gt;
&lt;br /&gt;
''Print  statements''  When you don't have effective access to the two above, inserting print statements can be an effective way of finding a bug.  It is more effective the more you know about your bug (e.g., when you know pretty close to where in the code the problem is and what variable is going bad).  Included in this category is writing out entire fields in a format that our post-processors can read so that you can look at the whole field in something like '''''paraview''''' that may give you a clue as to where the problem of the category &amp;quot;Wrong results&amp;quot; might be occurring.&lt;br /&gt;
&lt;br /&gt;
== '''Debugging Strategies''' ==&lt;br /&gt;
&lt;br /&gt;
''Recursive bisection:''  When you know where the code fails (or is producing wrong results) but don't have much of a clue where and why, this can be a good strategy.  What you need is some measure of correctness of some variable you can watch. Your strategy here is to first define the location in the code where it is believed to be correct and a second location where it is believed to be wrong. Then you bisect the code and check the middle location and determine if it is correct or wrong and then replace either the first or second location based on your answer (replace correct or wrong).  Keep applying this recursively and eventually you have a small section of code to find your bug in (e.g., one line).  This works extremely well for some bugs but it does have a few difficult assumptions that don't always hold true:  1) you know what is correct and wrong,  2) you know how to bisect your code (this can be hard before you actually know the code you are working with pretty well),  3) you are able to track a single variable through a function stack (not always possible) and/or know the code well enough to switch targets (and adjust measure of correctness).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''March (and compare):'' Marching in a debugger is tedious and many think it is boring but if you get your mind in the right place you can learn a lot about the code while you are marching (tell yourself you are not wasting time finding a bug but using the debugger to better learn the code).  As above, this strategy is more effective the better you know how to differentiate a correct result from and incorrect result on each &amp;quot;line&amp;quot; of the code, something that experience improves. This is where &amp;quot;compare&amp;quot; is a powerful tool for beginners (and everyone else).  Your ideal scenario is that you have a version of the code saved that was working when you started your development.  Before you start, make that working source code directory not writable ( chmod u-w * ).  You then make two directories with your inputs and  launch two versions of the debugger in each of these directories, one with the correct executable and one with the broken executable.  You then march through the code looking for differences.  Of course if you meet the requirements of Recursive bisection you can apply it to both codes and combine these strategies but when you don't, marching line by line and comparing results can often be effective (and you will in the process learn the code well AND likely develop the understanding of correctness required to use recursive bisection).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Specific tips for SCOREC/Simmetrix Meshing and MeshAdapt software and associated databases:'' &lt;br /&gt;
Because the mesh database is very rich and complex it can often be non-transparent to debugging.  To address this issues, functions have been created to help users debug.  If your debugging has identified a location and you  have successfully trapped the offending vertex, face, or region (typically you are iterating over one of these when some unexpected result occurs and is trapped), then you can call a function to get lots of information about that entity with&lt;br /&gt;
&lt;br /&gt;
V_info(ivert)    // gives information about the the vertex  ivert&lt;br /&gt;
&lt;br /&gt;
F_info(iface)    // gives information about the the face  iface&lt;br /&gt;
&lt;br /&gt;
R_info(iregion)    // gives information about the the region  iregion&lt;br /&gt;
&lt;br /&gt;
These functions can either be compiled into the code and printed from traps that catch the unexpected behavior (and thereby help you understand the geometric location of the problem) or, with many debuggers, they can be called from the current command line to give you more information while stepping through the code.&lt;br /&gt;
&lt;br /&gt;
Once you find the offending geometric location, it is often possible to load the mesh (in cases where the mesher completed but some other program downstream of it fails) in paraview and draw  spheres at the location of the vertices, zoom to the vertices, cut the mesh with'' extract cells by region'' filter centered on the bad location and then see what is wrong (perhaps using a few different normal planes to get a clear view).  Often refining the mesh near this surface will improve element quality and fix the problem.&lt;br /&gt;
&lt;br /&gt;
ADD TO ME&lt;br /&gt;
&lt;br /&gt;
''Specific tips for PHASTA:'' &lt;br /&gt;
ADD TO ME&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=32</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=32"/>
				<updated>2011-08-20T13:05:30Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
Debugging can be a very difficult skill to learn.  It requires patience, persistence and determination but it can certainly be aided by skills and tips gained from hard earned experience.  &lt;br /&gt;
&lt;br /&gt;
The goal of this wiki is to organize our groups experience with debugging in general and specific tips for debugging our software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''General''' ==&lt;br /&gt;
&lt;br /&gt;
There are broadly three types of bugs that we encounter: 1) wrong results,  2) segmentation fault,  and 3) trapped unexpected behavior.  These are ordered in decreasing difficulty as will be clear shortly.&lt;br /&gt;
&lt;br /&gt;
''Wrong results:''  A lack of convergence or slow divergence of a problems that is expected or known to work with the given inputs  is not uncommon for code development but it is far and away the hardest bug to find.  The most effective strategy here is usually to compare against a working code that does not exhibit this behavior and be sure that all of the &amp;quot;deviations&amp;quot; from the known working code are expected.&lt;br /&gt;
&lt;br /&gt;
''Segmentation fault:''  Here, there is typically a corruption of memory such as an array going out of bounds,  Many of the debuggers mentioned below will stop at the location of the segmentation fault but be aware that this is not necessarily the location of the bug.  In many cases, memory corruption occurred in a non-fatal way at some early stage of the code and the place the code reports the segmentation fault is were the &amp;quot;dead body&amp;quot; is found and you must look at the corrupted array and look backward to see where it was modified which may lead to other arrays that were incorrectly modified etc.  This is especially true with indirect addressing arrays and memory pointers.  You should expect the compiling in debug mode will &amp;quot;move&amp;quot; the problem to a different location and, sadly in some situations, completely hide the problem (e.g., runs through successfully).  This is because when a code is compiled in debug mode, extra &amp;quot;padding&amp;quot; is put into the code to track the variables and you may be corrupting only this padding and not vital code.  '''''Valgrind''''' (someone provide a link and a wiki tutorial on its use please) can be very effective in finding this type of bug.  This type of fault can also occur when you run out of memory for the machine you are running on.  Please use '''''top''''' while your job is running to check for this type of failure.&lt;br /&gt;
&lt;br /&gt;
''Trapped unexpected behavior:''  Here checks were placed in the code to stop or report some information when execution led to an unexpected result (e.g., a negative volume computation or a residual that is not a number).  In general we like to put these kind of things in our code to make debugging easier but their is always a tradeoff between the time it takes to instrument the code, the effect the checks have on performance, and the benefit to debugging.  One compromise that is often employed is to put these checks inside of a compiler flag so that they are compiled in ONLY when running in debug mode.  '''MAJOR TIP:  When a code crashes ALWAYS recompile it in debug mode and rerun it as you may then get more information about where the bug is (e.g., go from Seg Fault to Trapped unexpected behavior).'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Choice of Debugger''' ==&lt;br /&gt;
&lt;br /&gt;
The first choice is what tool to debug with.  Your weapons range from graphical debuggers like '''''totalview''''' and '''''idb''''', to command line debuggers like '''''gdb''''', to print statements.  Different bugs/codes are handled best by different tools.&lt;br /&gt;
Launching and effectively getting help and/or running graphical debuggers are covered in separate wikis linked to the names in the list.  Here we only give a general overview of some experience (grow it!!) with each.&lt;br /&gt;
&lt;br /&gt;
''Graphical debuggers'' are best for marching through the code.  They can really help a new user learn the flow of the code and see various arrays being changed.  Any code that you want to have mastery of is worth spending time marching through the code in this way. Graphical debuggers are also effective at determining the location of bugs.&lt;br /&gt;
&lt;br /&gt;
''Command line debuggers''  link to gdb....some comments on when they are effective&lt;br /&gt;
&lt;br /&gt;
''Print  statements''  When you don't have effective access to the two above, inserting print statements can be an effective way of finding a bug.  It is more effective the more you know about your bug (e.g., when you know pretty close to where in the code the problem is and what variable is going bad).  Included in this category is writing out entire fields in a format that our post-processors can read so that you can look at the whole field in something like '''''paraview''''' that may give you a clue as to where the problem of the category &amp;quot;Wrong results&amp;quot; might be occurring.&lt;br /&gt;
&lt;br /&gt;
== '''Debugging Strategies''' ==&lt;br /&gt;
&lt;br /&gt;
''Recursive bisection:''  When you know where the code fails (or is producing wrong results) but don't have much of a clue where and why, this can be a good strategy.  What you need is some measure of correctness of some variable you can watch. Your strategy here is to first define the location in the code where it is believed to be correct and a second location where it is believed to be wrong. Then you bisect the code and check the middle location and determine if it is correct or wrong and then replace either the first or second location based on your answer (replace correct or wrong).  Keep applying this recursively and eventually you have a small section of code to find your bug in (e.g., one line).  This works extremely well for some bugs but it does have a few difficult assumptions that don't always hold true:  1) you know what is correct and wrong,  2) you know how to bisect your code (this can be hard before you actually know the code you are working with pretty well),  3) you are able to track a single variable through a function stack (not always possible) and/or know the code well enough to switch targets (and adjust measure of correctness).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''March (and compare):'' Marching in a debugger is tedious and many think it is boring but if you get your mind in the right place you can learn a lot about the code while you are marching (tell yourself you are not wasting time finding a bug but using the debugger to better learn the code).  As above, this strategy is more effective the better you know how to differentiate a correct result from and incorrect result on each &amp;quot;line&amp;quot; of the code, something that experience improves. This is where &amp;quot;compare&amp;quot; is a powerful tool for beginners (and everyone else).  Your ideal scenario is that you have a version of the code saved that was working when you started your development.  Before you start, make that working source code directory not writable ( chmod u-w * ).  You then make two directories with your inputs and  launch two versions of the debugger in each of these directories, one with the correct executable and one with the broken executable.  You then march through the code looking for differences.  Of course if you meet the requirements of Recursive bisection you can apply it to both codes and combine these strategies but when you don't, marching line by line and comparing results can often be effective (and you will in the process learn the code well AND likely develop the understanding of correctness required to use recursive bisection).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Specific tips for SCOREC/Simmetrix Meshing and MeshAdapt software and associated databases:'' &lt;br /&gt;
Because the mesh database is very rich and complex it can often be non-transparent to debugging.  To address this issues, functions have been created to help users debug.  If your debugging has identified a location and you  have successfully trapped the offending vertex, face, or region (typically you are iterating over one of these when some unexpected result occurs and is trapped), then you can call a function to get lots of information about that entity with&lt;br /&gt;
&lt;br /&gt;
V_info(ivert)    // gives information about the the vertex  ivert&lt;br /&gt;
F_info(iface)    // gives information about the the face  iface&lt;br /&gt;
R_info(iregion)    // gives information about the the region  iregion&lt;br /&gt;
&lt;br /&gt;
These functions can either be compiled into the code and printed from traps that catch the unexpected behavior (and thereby help you understand the geometric location of the problem) or, with many debuggers, they can be called from the current command line to give you more information while stepping through the code.&lt;br /&gt;
&lt;br /&gt;
Once you find the offending geometric location, it is often possible to load the mesh (in cases where the mesher completed but some other program downstream of it fails) in paraview and draw  spheres at the location of the vertices, zoom to the vertices, cut the mesh with'' extract cells by region'' filter centered on the bad location and then see what is wrong (perhaps using a few different normal planes to get a clear view).  Often refining the mesh near this surface will improve element quality and fix the problem.&lt;br /&gt;
&lt;br /&gt;
ADD TO ME&lt;br /&gt;
&lt;br /&gt;
''Specific tips for PHASTA:'' &lt;br /&gt;
ADD TO ME&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	<entry>
		<id>https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=31</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://fluid.colorado.edu/wiki/index.php?title=Debugging&amp;diff=31"/>
				<updated>2011-08-20T13:04:24Z</updated>
		
		<summary type="html">&lt;p&gt;Kjansen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
Debugging can be a very difficult skill to learn.  It requires patience, persistence and determination but it can certainly be aided by skills and tips gained from hard earned experience.  &lt;br /&gt;
&lt;br /&gt;
The goal of this wiki is to organize our groups experience with debugging in general and specific tips for debugging our software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''General''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are broadly three types of bugs that we encounter: 1) wrong results,  2) segmentation fault,  and 3) trapped unexpected behavior.  These are ordered in decreasing difficulty as will be clear shortly.&lt;br /&gt;
&lt;br /&gt;
''Wrong results:''  A lack of convergence or slow divergence of a problems that is expected or known to work with the given inputs  is not uncommon for code development but it is far and away the hardest bug to find.  The most effective strategy here is usually to compare against a working code that does not exhibit this behavior and be sure that all of the &amp;quot;deviations&amp;quot; from the known working code are expected.&lt;br /&gt;
&lt;br /&gt;
''Segmentation fault:''  Here, there is typically a corruption of memory such as an array going out of bounds,  Many of the debuggers mentioned below will stop at the location of the segmentation fault but be aware that this is not necessarily the location of the bug.  In many cases, memory corruption occurred in a non-fatal way at some early stage of the code and the place the code reports the segmentation fault is were the &amp;quot;dead body&amp;quot; is found and you must look at the corrupted array and look backward to see where it was modified which may lead to other arrays that were incorrectly modified etc.  This is especially true with indirect addressing arrays and memory pointers.  You should expect the compiling in debug mode will &amp;quot;move&amp;quot; the problem to a different location and, sadly in some situations, completely hide the problem (e.g., runs through successfully).  This is because when a code is compiled in debug mode, extra &amp;quot;padding&amp;quot; is put into the code to track the variables and you may be corrupting only this padding and not vital code.  '''''Valgrind''''' (someone provide a link and a wiki tutorial on its use please) can be very effective in finding this type of bug.  This type of fault can also occur when you run out of memory for the machine you are running on.  Please use '''''top''''' while your job is running to check for this type of failure.&lt;br /&gt;
&lt;br /&gt;
''Trapped unexpected behavior:''  Here checks were placed in the code to stop or report some information when execution led to an unexpected result (e.g., a negative volume computation or a residual that is not a number).  In general we like to put these kind of things in our code to make debugging easier but their is always a tradeoff between the time it takes to instrument the code, the effect the checks have on performance, and the benefit to debugging.  One compromise that is often employed is to put these checks inside of a compiler flag so that they are compiled in ONLY when running in debug mode.  '''MAJOR TIP:  When a code crashes ALWAYS recompile it in debug mode and rerun it as you may then get more information about where the bug is (e.g., go from Seg Fault to Trapped unexpected behavior).'''&lt;br /&gt;
&lt;br /&gt;
== '''Choice of Debugger''' ==&lt;br /&gt;
&lt;br /&gt;
The first choice is what tool to debug with.  Your weapons range from graphical debuggers like '''''totalview''''' and '''''idb''''', to command line debuggers like '''''gdb''''', to print statements.  Different bugs/codes are handled best by different tools.&lt;br /&gt;
Launching and effectively getting help and/or running graphical debuggers are covered in separate wikis linked to the names in the list.  Here we only give a general overview of some experience (grow it!!) with each.&lt;br /&gt;
&lt;br /&gt;
''Graphical debuggers'' are best for marching through the code.  They can really help a new user learn the flow of the code and see various arrays being changed.  Any code that you want to have mastery of is worth spending time marching through the code in this way. Graphical debuggers are also effective at determining the location of bugs.&lt;br /&gt;
&lt;br /&gt;
''Command line debuggers''  link to gdb....some comments on when they are effective&lt;br /&gt;
&lt;br /&gt;
''Print  statements''  When you don't have effective access to the two above, inserting print statements can be an effective way of finding a bug.  It is more effective the more you know about your bug (e.g., when you know pretty close to where in the code the problem is and what variable is going bad).  Included in this category is writing out entire fields in a format that our post-processors can read so that you can look at the whole field in something like '''''paraview''''' that may give you a clue as to where the problem of the category &amp;quot;Wrong results&amp;quot; might be occurring.&lt;br /&gt;
&lt;br /&gt;
== '''Debugging Strategies''' ==&lt;br /&gt;
&lt;br /&gt;
''Recursive bisection:''  When you know where the code fails (or is producing wrong results) but don't have much of a clue where and why, this can be a good strategy.  What you need is some measure of correctness of some variable you can watch. Your strategy here is to first define the location in the code where it is believed to be correct and a second location where it is believed to be wrong. Then you bisect the code and check the middle location and determine if it is correct or wrong and then replace either the first or second location based on your answer (replace correct or wrong).  Keep applying this recursively and eventually you have a small section of code to find your bug in (e.g., one line).  This works extremely well for some bugs but it does have a few difficult assumptions that don't always hold true:  1) you know what is correct and wrong,  2) you know how to bisect your code (this can be hard before you actually know the code you are working with pretty well),  3) you are able to track a single variable through a function stack (not always possible) and/or know the code well enough to switch targets (and adjust measure of correctness).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''March (and compare):'' Marching in a debugger is tedious and many think it is boring but if you get your mind in the right place you can learn a lot about the code while you are marching (tell yourself you are not wasting time finding a bug but using the debugger to better learn the code).  As above, this strategy is more effective the better you know how to differentiate a correct result from and incorrect result on each &amp;quot;line&amp;quot; of the code, something that experience improves. This is where &amp;quot;compare&amp;quot; is a powerful tool for beginners (and everyone else).  Your ideal scenario is that you have a version of the code saved that was working when you started your development.  Before you start, make that working source code directory not writable ( chmod u-w * ).  You then make two directories with your inputs and  launch two versions of the debugger in each of these directories, one with the correct executable and one with the broken executable.  You then march through the code looking for differences.  Of course if you meet the requirements of Recursive bisection you can apply it to both codes and combine these strategies but when you don't, marching line by line and comparing results can often be effective (and you will in the process learn the code well AND likely develop the understanding of correctness required to use recursive bisection).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Specific tips for SCOREC/Simmetrix Meshing and MeshAdapt software and associated databases:'' &lt;br /&gt;
Because the mesh database is very rich and complex it can often be non-transparent to debugging.  To address this issues, functions have been created to help users debug.  If your debugging has identified a location and you  have successfully trapped the offending vertex, face, or region (typically you are iterating over one of these when some unexpected result occurs and is trapped), then you can call a function to get lots of information about that entity with&lt;br /&gt;
&lt;br /&gt;
V_info(ivert)    // gives information about the the vertex  ivert&lt;br /&gt;
F_info(iface)    // gives information about the the face  iface&lt;br /&gt;
R_info(iregion)    // gives information about the the region  iregion&lt;br /&gt;
&lt;br /&gt;
These functions can either be compiled into the code and printed from traps that catch the unexpected behavior (and thereby help you understand the geometric location of the problem) or, with many debuggers, they can be called from the current command line to give you more information while stepping through the code.&lt;br /&gt;
&lt;br /&gt;
Once you find the offending geometric location, it is often possible to load the mesh (in cases where the mesher completed but some other program downstream of it fails) in paraview and draw  spheres at the location of the vertices, zoom to the vertices, cut the mesh with'' extract cells by region'' filter centered on the bad location and then see what is wrong (perhaps using a few different normal planes to get a clear view).  Often refining the mesh near this surface will improve element quality and fix the problem.&lt;br /&gt;
&lt;br /&gt;
ADD TO ME&lt;br /&gt;
&lt;br /&gt;
''Specific tips for PHASTA:'' &lt;br /&gt;
ADD TO ME&lt;/div&gt;</summary>
		<author><name>Kjansen</name></author>	</entry>

	</feed>