About bjimene1

I'm a second-year graduate student at the University of Maryland College Park. I plan on obtaining my Ph.D. in aerospace engineering. I completed my undergraduate studies in aerospace engineering with an astronautics concentration at Arizona State University. I spent my all of my formative years in Los Angeles.

Clarifying License Setup for Siemens NX 8.5 Installation (University of Maryland)

The University of Maryland was recently given a $750 million software grant for the popular Siemens Product Lifecycle Management (PLM) software. After reading the article, I decided to install the software.

My experience should primarily help UMD students (who may legally download the software after logging in to the UMD portal), though I found a version of my solution online.

My installation of Siemens NX occurred at my home on my Windows 7 64-bit OS. The installation was straightforward, but I received a licensing error when attempting to run NX 8.5.

The instructions provided by UMD, titled “Siemens NX Windows Requirements and Instructions,” tell users to provide license information given in the document. Then, users are instructed to run the licensing options tool, selected through the path: “Start -> Siemens NX 8.5-> NX Licensing Tools->Licensing Options,” except that my path ended with “License Options.” Same difference.

The next step is to “add both the listed bundles.” I could not find the bundles that were listed in the document. I did, however, find a solution at a Rensselaer Polytechnic Institute website.

Scroll down to Common Errors with NX 8.0, to error 11), which states “When I open License Options, there is no bundle listed.” They state that there are two options for why this is happening:

  • a) ” You may have lost connection to the RPI network, otherwise see step B.”
  • b) “To fix, right select on My Computer > Properties > Advanced System Settings. Select Advanced > Environment Variables. Under System Variables, click New. For Variable name type UGS_LICENSE_BUNDLE. For the Variable value type: ACD30; ACD31”

I assumed my network was working fine, and I followed the instructions for b). Using the comparable bundles listed in the “Siemens NX Windows Requirements and Instructions” (which I will not list here for legal reasons)  I was able to get NX to start successfully. I did not have to restart after adding my environment variables.

Thanks to RPI for documenting this issue. Hopefully UMD includes an update to their instructions. Otherwise, I hope that this post helps UMD students.

Advertisements

My First Helicopter Ride

My helicopter design class at the University of Maryland took a trip to the Frederick, MD airport last month for helicopter rides in a Robinson R-22. It was a great experience thanks to Advanced Helicopter Concepts. I’ve included a video here to share my experience. The video was recorded with a GoPro camera strapped to my knee. The high-pitched, low RPM warning occurs during the autorotation. Enjoy!

Improving Fortran Do Loop Performance by 25%

SUMMARY

Here’s a way to make sure you’re optimizing the writing of your code with an example in Fortran. It’s a neat, non-obvious trick to an engineer, but may be more obvious to a computer scientist. It involves the writing of a do loop where you are updating your value for an array, and instead of copying that array into a temporary variable, you simply use the programming logic to continue to use that information (location in memory) during every other time step. I was able to get 25% better performance for this simple change (and it scales). Not clear yet? Let me show you.

BACKGROUND
I’m a mediocre Fortran programmer but I’m learning new tricks with practice, challenges, and going to professor office hours. Taking Scientific Computing and High Performance Computing Systems right now is really increasing the strength of my programming skills. I hope to be an intermediate Fortran programmer by the end of the semester. Below is a sample from a code I wrote for a recent class project. The goal of the project was not to write a sequential version, so I feel comfortable posting a piece of the serial version.

CODE DESCRIPTION

The user is stepping in time from igen to gmax, calculating the neighbor value (‘naybs’) of a cell in the array ‘pop.’ Then, it updates the value of the cell in the array ‘pop’ for the next time step based on the neighbor values. But it does this update in ‘buffer,’ unnecessarily copying the data back to the array ‘pop.’ In this way, the loop proceeds without conflict. This works, but you may be sacrificing performance without even realizing it. I wrote EXAMPLE 1 below and then my instructor said “BUT WHY NOT DO IT BETTER?” and I went back to my computer and coded EXAMPLE 2.

EXAMPLE 1: Original Code

  do igen = 1, gmax
    naybs = 0
    buffer = 0
! This loop finds neighbor values
    do j = 2, y_limit + 1
      do i = 2, x_limit +1
        naybs(i,j) = pop(i-1,j-1) + pop(i,j-1) + pop(i+1,j-1)+ &
                     pop(i-1,j  )              + pop(i+1,j  )+ &
                     pop(i-1,j+1) + pop(i,j+1) + pop(i+1,j+1)
        ! Birth
        if (pop(i,j)==0 .and. naybs(i,j)==3) then
            buffer(i,j)=1
        ! Survival
        else if (pop(i,j)==1 .and. &
            (naybs(i,j)==2 .or. naybs(i,j)==3)) then
            buffer(i,j)=1
        ! Death
        else
            buffer(i,j)=0
        end if
        pop(i,j) = buffer(i,j)
      end do
    end do
  end do

EXAMPLE 2: Improved Code

do igen = 1, gmax
  naybs = 0

  if (mod(igen,2)==1) then

! This loop finds neighbor values
  do j = 2, y_limit + 1
    do i = 2, x_limit +1
      naybs(i,j) = pop(i-1,j-1) + pop(i,j-1) + pop(i+1,j-1)+ &
                   pop(i-1,j  )              + pop(i+1,j  )+ &
                   pop(i-1,j+1) + pop(i,j+1) + pop(i+1,j+1)
      ! Birth
      if (pop(i,j)==0 .and. naybs(i,j)==3) then
          buffer(i,j)=1
      ! Survival
      else if (pop(i,j)==1 .and. &
          (naybs(i,j)==2 .or. naybs(i,j)==3)) then
          buffer(i,j)=1
      ! Death
      else
          buffer(i,j)=0
      end if
    end do
  end do

  else if (mod(igen,2)==0) then

! This loop finds neighbor values
  do j = 2, y_limit + 1
    do i = 2, x_limit +1
      naybs(i,j)=buffer(i-1,j-1)+buffer(i,j-1)+buffer(i+1,j-1)+ &
                 buffer(i-1,j  )              +buffer(i+1,j  )+ &
                 buffer(i-1,j+1)+buffer(i,j+1)+buffer(i+1,j+1)
      ! Birth
      if (buffer(i,j)==0 .and. naybs(i,j)==3) then
          pop(i,j)=1
      ! Survival
      else if (buffer(i,j)==1 .and. &
          (naybs(i,j)==2 .or. naybs(i,j)==3)) then
          pop(i,j)=1
      ! Death
      else
          pop(i,j)=0
      end if
    end do
  end do
  end if
end do

I will say that you do have to write more code, but if that’s your hang-up, then you might not be very interested in performance in the first place.

More importantly, note the logic here. What I’m doing is identifying which time step is odd or even (by computing the mod of each time step), and then based on that result, I will update the next time step with a value from another grid. As far as I know, this can be done more elegantly in C by switching pointers. I don’t even know how to yet use pointers effectively in Fortran, so that might be possible here too. That would then give you the performance you desire, and the brevity that everyone likes. This result did increase my performance by 25%, which is dramatic if you are in the scientific computing world.

I note that this may be obvious to others, and they might even think that I made it harder on myself in the first place by doing something silly (which I did), but remember that I was taught this by multiple people, multiple times. Once I started to get an understanding of how data is held in memory, I started to make more advanced strides in programming. Hope this helps!

Back to Engineering Graduate School: 10 must-haves

In this article I describe my favorite and must-have items for when I start my semesters in graduate school. A lot of what I list below can also be recommended for undergraduates.

  1. Computer
    Engineers require reliable tools. A computer is at the top of the list, whether you’re writing a technical report at the last minute, sharing gigabytes of files with your group project partners, or downloading a semester’s worth of lecture notes before an exam. These situations commonly arise during the semester and it is wise to find a dependable computer to help you avoid technological pitfalls. Personally, I enjoy having a powerful desktop at home, and a lightweight MacBook Air for the road. I recommend building a powerful desktop yourself. There are numerous video tutorials available on YouTube and written tutorials online. I update my desktop about once every 4 years and my laptop once every 3 years.
  2. Pen and Paper
    My favorite writing instrument is the Pilot Precise V5 Rolling Ball Pen, Extra Fine Point, 0.5 mm. While it will bleed through most poor quality papers, I make sure to purchase the National Brand Computation Notebook. I write on both sides to utilize up to 150 pages of notes for my classes. If my classes are powerpoint slide based, I still like to have the notebook for book notes or diagrams as supplements to my lectures.
  3. Folders and dividers
    An average engineering graduate class will have enough materials to fill up a 2 inch binder. I prefer Avery Heavy-Duty products to store my class materials. I also like to use Avery Big Tab Insertable Plastic Divider sets, which comes with 5 dividers. I typically divide my classes up into the following divider tab categories:
    – Handouts
    – Lectures
    – Homework
    – Exams
    – Work
    where handouts can be a syllabus or paper to read, and work can mean anything that I’ve scribbled or documented but did not submit, including messy homework assignments before I’ve re-written them in LaTeX.
  4. Software and storage
    You must back up your important research data on an external hard drive. I encourage backups of your backups if you have the resources. While hard drives usually seem inexpensive (considering our modern advances), you can get better deals during massive sale events like Black Friday. Very useful software tools for tracking your priorities include Evernote, Calendar, and OneNote.  I’ve also heard good things about OmniFocus and Workflowy. I agree that these tools are very useful but I find that they each have flaws, and a better tool is waiting to be developed.
  5. Mobile companion
    The modern graduate student is only as powerful as their mobile accessories. Apps for your smartphone can download an entire conference floorplan, including booth and activity information. Your Kindle or iPad can be used to read dozens of journal articles. You can know every detail about your life, including your personal finances, your email traffic, and communicate almost instantly with anyone in the world. Owning any combination of these devices is a must, but how you use them optimally is up to you.
  6. Electronics suite
    There is a long list of helpful electronics that you can buy to assist your graduate school efforts. I received a lot of help from Matt Might at his blog. He recommended several products that I tried. I swear by the Outlet To Go Power Strip and the Kensington presentation remote. I highly recommend car charger kits, USB hubs, iPod chargers, earbuds or headphones, ethernet adapter (if necessary), and a chill mat for when you’re at home on your laptop. High powered calculators are still a necessity for graduate students during exams, though they’re not as prominent as they were during undergraduate. Just keep your undergraduate calculator handy.
  7. Health care
    It’s important to stay healthy when in graduate school. I make sure I pack hand sanitizer, ibuprofen, allergy pills (Loratadine), Kleenex, and chewing gum in my bag. You can also boost your immune system by exercising. Try to get a running, biking, or swimming routine going. Also work on your muscle development during the week with a group fitness class at your University, if available. Play a sport or get involved in an intramural league. Take walks around campus when you can as it will keep your brain healthy.
  8. Parking pass
    Transportation departments at campuses across America are not always in the favor of the students. Lots of parking tickets are ruthlessly handed out each semester. My advice is to obey the posted signs and stop complaining. Buy a parking pass if it is financially feasible, or consider an alternative mode of transportation to work. I highly emphasize that there are many programs available to students for green commuting and there may be subsidies for your form of travel (whether biking, bus, or carpool).
  9. Office Mates
    It surprises me how often my friends borrow a stapler, a hole punch, scissors, or all three at the same time. I have a very strong stapler and hole punch, and average scissors for my office. I recommend staplers and hole punches that can power through up to 50 pages at once. This industrial level action may come in handy when your pocket stapler cannot handle a 30 page report.
  10. Memento
    Keep something motivational in your office. Whether it’s a poster of your favorite poem, a die-cast model of your favorite plane, or a picture of you with your hero, you will benefit from being reminded of why you are a graduate student in the first place. Your perspective will frequently change during graduate school. There will be lots of ups and downs. Just remember why you’re here.

Timing an OpenMP run using Fortran

What to expect:

  • How you can time a run in Fortran by calling cpu_time
  • How you can time a run in Fortran (or C) using OpenMP using omp_get_wtime()

Compiler

I am using the Intel Fortran Compiler, ifort, called Intel Fortran Composer XE 2011 for Linux. It’s version 11.1. You can find the compiler here, as part of Intel’s Non-Commercial Software Downloads. You can check the version of your ifort by supplying the command

$ ifort -v

The ifort compiler has OpenMP capability built in. OpenMP has a built-in ability to time the run that you are executing. One way that we can time the run natively in Fortran will also be shown.

At the beginning of my code, it looks like the following:

Example Code

program goodtimes

c$     use omp_lib
       use your_modules

       implicit none

       double precision :: fstart, fend
       [Declare other variables]
       double precision :: ostart,oend

c      Fortran timing
       call cpu_time (fstart)

c      OpenMP timing
c$     ostart = omp_get_wtime()

c      Start of your meaningful code

c      Middle of your meaningful code

c      End of your meaningful code

c      End Fortran timing
       call cpu_time (fend)

c      End OpenMP timing
c$     oend = omp_get_wtime()

       write(*,*) 'Fortran CPU time elapsed', fend-fstart
c$     write(*,*) 'OpenMP Walltime elapsed', oend-ostart

end program

There are a few things to mention in the loosely-written code above. I wrote it a little Fortran 77-esque, where I started writing in the 7th column, and the OpenMP pragma is ‘c$’, ‘!$’, or ‘*$’. I used ‘c$’ above. In later versions of Fortran, use ‘!$’.

Notice that you must use the ‘omp_lib’ module in order to access the built-in ‘omp_get_wtime’. Otherwise, you will get an error. I strongly recommend making your start and end variables double precision. It doesn’t matter how you specify them as double precision, and I don’t necessarily recommend the way I did it above, but I just want to make it clear that you will have a better time with a double precision specification.

Note that cpu_time yields information about the CPU time (how long the CPU was working on your problem) and omp_get_wtime yields the wall clock time, such as the time that would have elapsed if you were timing the run from beginning to end with a very precise clock. I had a few runs for my application that showed the CPU operating at about 90% efficiency (where wall time is 100% of the total time). I recommend reading this post I did about profiling your code, so you can see which regions of your code are time consuming, and you can direct your OpenMP use in those regions.

Remember to include the ‘-openmp’ flag when compiling, and specifying the environment variable ‘OMP_NUM_THREADS’. I typically modify the ~/.bashrc file with a value and then source ~/.bashrc.

The rest of the code is self-explanatory. Read up on Fortran (or C) and OpenMP tutorials and other documentation for any additional information, or feel free to ask questions below. The C techniques are very similar and straightforward.

PDF from multiple PDFs or Images! Reduce PDF size through image compression! (Mac OS X 10.7.3)

I had 3 goals at the outset:

  1. Create a PDF from an image (JPEG, TIFF, PNG, etc.)
  2. Combine PDFs into one larger PDF
  3. Reduce the image quality of the PDF to a manageable size, while preserving readability. This process is not recommended for expert resizing of pictures.
This was all completed, but more importantly, the process wasn’t what I expected. I learned how to do the above, but the way below is simpler:
  1. If you are working with only images, it is useful to highlight all images and “Open With…” then select “Preview” and then Print to PDF. It joined all my images into a single PDF.
  2. If you are working with only PDFs, you can go straight to the section I’ve written below on Multiple PDFs to PDF.
  3. Reduce the image quality of the PDF to a manageable size, while preserving readability.

But there are some advantages and disadvantages about this method in 1. because if you Print to PDF in Preview it will create a white border around all of your images in your new PDF. The alternative is to create a Service in Automator that will go through all your images and convert them to PDFs, then condense all PDFs to one PDF. I haven’t fleshed out this process yet, as I’m satisfied (i.e. unwilling to complain) with the white border.

I’ve been encumbered by the inability to create PDFs from multiple PDFs or multiple images for some time. Today I decided it would be an essential skill so I learned how to do it, and now you’re going to learn. It was another beautiful day where I felt justified in purchasing my Macbook Air. Note that the majority of this instruction was compiled from about 6-8 different websites (so you don’t have to go crazy over tiny misconceptions and errors), so I thought I would throw it all into this one!

Some helpful sites (but note that my write-up is a condensed version of all of these sites to save you some time):

Create PDFs from images
Multiple Page PDF from PDFs
Combine PDF files Service
Reduce file size through quality
Resolving Quartz Filter Issues

Multiple PDFs to PDF

  • We’re going to use the built-in tool “Automator” to get things done. You can access Automator by going to your Launchpad and then clicking on Automator.
  • “Choose a type for your document:” immediately pops up, so you’re going to want to choose “Service.”
  • “Drag actions or files here to build your workflow” is the location where you will drag commands that will execute sequentially (top to bottom). Those commands can be accessed from the left-hand side where you see the library for Actions and Variables. The easiest way to find your desired action is by searching. There is a search bar next to “Actions” “Variables” in the top left of your Automator screen.
  • There is a section above the workflow area that says “Service receives selected” and has a drop-down menu. From the drop-down, select “PDF Files.” You’ll notice that to the right, “in any application” is selected, and should be fine.
  • First, we’ll search and add Combine PDF Pages to our workflow. Make sure “Appending Pages” radio button is selected if desired. Note that there are “Options” you can look choose from. Explore all the options just so you feel comfortable with the workflow.
  • Then search and add to workflow “Copy Finder Items.” I usually send the Finder items to Desktop. I do not check “Replace existing files.”
  • Then search and add to workflow “Rename Finder Items.” You can change the “Add Date or Time” pulldown to whatever naming convention customization you’d like. You should look at options and select “Show this action when the workflow runs.”
  • Finally, search and add to workflow “Move Finder Items.” I usually default moving the items to my Desktop.

After you’ve completed these steps, go to File and then Save! I saved mine as “Combine PDFs.”

These are the workflow steps within Automator to Combine PDFs.

Once you’ve closed Automator, test our your new Service. Highlight multiple PDF files and then Control + Click them to bring up several Finder options, and then scroll down to Services, where you should see Combine PDFs as one of the options.

Select your PDFs and ctrl+click, select Services, then select Combine PDFs and you’re done!

Let me know if it didn’t work for you in the comments and we’ll sort it out! Make sure you execute all the steps correctly before you accuse me of shenanigans!

Custom Reduction of Image Quality Using ColorSync Filters

I needed to reduce a PDF that I combined from something outrageous (like 200 MB to 600 MB) to something manageable (like 2-6 MB). How can we reduce the order of magnitude by 2 and still have recognizable quality? I had the same question. It turns out for practical purposes, if someone scanned a page of writing in very high TIFF quality (each image ~15 MB), they’ve overdone it. So let’s get it back to something more manageable.

I created a custom ColorSync filter, first. Later, this filter will be applied to my really long PDF as a postprocessing step.

  • Open ColorSync by going to your “Launchpad” –> “Utilities” –> “ColorSync Utility.”
  • When you open ColorSync, navigate to Filters on your new window.
  • You’ll notice a little “+” button at the bottom left of your new window. You’ve now added a custom filter. Give it a name.
  • Use the small drop down arrow to the right of your new Filter and select “Add Image Effects Component” and then select “Image Compression.”
  • Navigate to your new filter and expand it. Change the Mode of Image Compression to “JPEG” from the drop-down. I’ve made three filters reducing file sizes from high quality to above-average quality, middle quality, and below average quality. As far as I know, these filters are written (saved) as you make the adjustments. I have found the Reduce File Size High to Below Average (placing Quality at the 1/4 mark between Min and Max to yield the best results).
  • Close the Filters window, but stay in ColorSync Utility. Create a backup of your desired PDF just in case. Open your desired PDF using ColorSync Utility (go to File –> Open). If you do this, at the bottom you’ll notice there is a Filter option. Change the Filter to your desired new created filter, and then hit Apply!
  • File –> Save a copy of your new file! Now hopefully your file is easier to deal with.
For the compression type:

Choose your type of Filter for the PDF.

And for the Filters:

Create your Filters by using ColorSync Utility.

Good luck!

10 Reasons to Attend Engineering Graduate School

Graduate school is not for everyone. This should be clear. It’s 1-3 years for a Master’s, and anywhere between 3-7 for a Ph.D. (based on your abilities and how bad you want it!) Many know immediately whether they do or do not want to attend. But for those who are on the fence for engineering, I offer guidance in the form of 10 reasons. My opinions may skew toward aerospace as that’s my background.

1.    Grow-up

After four years (at least) of grinding away at some of the hardest problems you thought you could ever encounter, building a cascade of rocket science self-esteem, and emerging (by the skin of your teeth) with a diploma that will hold a special place…somewhere, eventually. Well, the four years spent between high school and college probably taught you many lessons, but don’t think for a minute you know it all. Graduate school raises the stakes. It will teach you valuable skills in time management, communication, engineering methods, etc., and you’ll be able to present these polished skills to your first serious employer.

2.    Dictate your future

Having a master’s degree demonstrates to employers that you have added value because you took on additional responsibility and succeeded at that mission. Having a Ph.D. means you made a significant, unique contribution to human knowledge, and offers extremely rewarding career choices. Having only a bachelor’s degree isn’t that bad, but you’re part of a large group of similarly educated, bright, energetic, new-car-smell engineers who have to make a significant effort to stand out from one another. Unless you’re a networking phenom or you have your own blog…get comfortable dealing with resume stacks, phone interviews, and the brutal competition to earn your entry-level position. For those who already got a job with a bachelor’s, did you get your first choice out the gate?

3.    Set an example

I have several younger siblings and a very large extended family. There are a lot of graduate students from all over the world, from smaller villages to huge cities, and we all remember where we came from. Friends and family back at home remember what we were like as children and they spread our inspirational stories. It is not only our duty as aerospace engineers to achieve the desired objective, performance, and safety of our operations, but to set an example for the next generation of engineers, so that they may be encouraged to follow us.

4.    Broaden your perspective

Many universities encourage a global perspective. Your graduate work considers the work done by others around the world. The people you meet will come from all over, and many of them may work directly with you. A global (diverse) perspective is encouraged because the ability to see a problem from several different angles enhances your problem solving ability. Greater perspective can enhance your creative thinking and flexibility toward solving a problem. Aside from broadening your problem solving ability, graduate school will also give you additional time to meet people from other cultures and hopefully encourage your own personal development in understanding others.

5.    Become a technical authority

Your value is not simply increased by the piece of paper representing your graduate degree, but by the technical knowledge and the advanced problem solving skills you now possess. When you have that knowledge, you are able to speak with authority on topics to guide decisions that will have significant effect on design and production (or at least, that’s how it’s supposed to work). If you obtain your Ph.D., your opinion will have much greater weight in your field, and you may be looked at when challenging questions arise within your area of study. Of course, you better know what you’re talking about!

6.    Stand shoulder to shoulder with giants

Not only are the students and faculty in graduate school the smartest I’ve ever met, they are also making significant contributions to the subjects I care about most. It is a rare opportunity to interact with today’s most brilliant minds outside of the leading companies who can afford to hire them. You will not merely be observing your intelligent peers. You will be on the front lines, exchanging ideas and converging on problem solutions.

7.    Improve your presentation ability

Without good presentation, the audience will not care about your work. During your master’s degree education you may be required to either defend your work as part of your master’s thesis. If you stick around for your Ph.D., you will be offered the opportunity at numerous conferences or poster presentations to explain what you’re doing. Even if you have confidence in your presenting ability, it will be a different challenge to meet the expectations of your audience in technical ability. You will also have great diversity in your audiences. You will be able to use the skills and knowledge gained in these presentations later in your professional or academic career. Here’s a helpful article on how to give a good talk, by Mike Dahlin.

8.    Justifiable investment

This Georgetown study notes that 41% of aerospace engineers (surveyed among the labor force) have a graduate degree. Aside from this glaring statistic, you hardly need a napkin calculation of cost-benefit analysis to understand that graduate school is a justifiable investment. In many cases, the graduate school or a fellowship may pay for your education. You are additionally provided a very modest (but existent) stipend so that you can be a productive worker and not have to worry (much) about the bills. Often, you are getting paid to learn (which is also paid for). Take advantage of this very unique opportunity.

9.    Money

We’re not looking near term, but long-term. When I started out as an engineering student in college, I had money as my lowest priority. Hell, I was proud of that, and couldn’t understand why people would get involved in engineering based on the $ sign alone. But I’ve come to understand that life isn’t cheap, and when it comes time to support a family, I definitely need to be a provider. Those with aerospace graduate degrees get an average earnings boost of 28%.

10. Freedom

You have the freedom to succeed and you have the freedom to fail. While this is always true, it is especially true in graduate school. There is so much flexibility in graduate school that you can choose to grind for days on multiple projects, churning out more results and ideas than you would have ever thought possible, or you can choose to let the hours go by without accomplishment. Depending on your specific field, you may have the ability to set your hours, work location, topic of interest, etc. The bottom line, however, is that you have the freedom to control the flow of your life, and you have the responsibility to ensure that the needs of your school, department, and advisor are met. Here are some productivity tips from Dr. Matt Might, a favorite blogger of mine.