3 Replies Latest reply on Dec 15, 2011 9:56 AM by tedk

    Running a program with multiple arguments on SCC

    smeraji

      I try to run an executable on SCC that gets more than one argument and I receive the error code 1 in my program. The format of my executable is as follows:

       

      executable inputfile1 inputfile2 outputfile1 outputfile2

       

      I use rccerun to run the program from my home folder in /shared as follows:

       

      ./rccerun -nue 1 -f rc.hosts  executable inputfile1 inputfile2 outputfile1 outputfile2

       

      I can see that this is run on rck00 as :

       

      pssh -h PSSH_HOST_FILE.10264 -t -1 -P -p 1 /shared/smeraji/ executable 1 0.533 00 pssh -h PSSH_HOST_FILE.10264 -t -1 -P -p 1 /shared/smeraji/./vpr 1 0.533 00 iir1.map4.latren.net k4-n10.xml place.out route.out < /dev/null < /dev/null

       

      as you can see "1 0.533 00", which are the core number and running frequency and so on, are added as the arguments of my executable. I believe this makes a segmentation fault in my program because my program parses the input parameters. does any body have any idea  how can I get rid of these numbers?

        • 1. Re: Running a program with multiple arguments on SCC
          smeraji

          one simple solution is to run the program with pssh instead of rccerun and with no numbers as follows:

           

          pssh -h PSSH_HOST_FILE.10264 -t -1 -P -p 1 /shared/smeraji/./vpr iir1.map4.latren.net k4-n10.xml place.out route.out

           

          any suggestions for rccerun?

          • 2. Re: Running a program with multiple arguments on SCC
            darence

            Well, I for one didn't have any problems with arguments... How do you use them in your code? Note that you shouldn't get the arguments directly from main. Actually, if you are linking with RCCE, you shouldn't have a classical main, but something like this:

             

            int RCCE_APP (int argc, char **argv)
            

             

            There you should call

             

            RCCE_init (&argc, &argv);
            

             

            before doing anything else. Later on, you can access your arguments normally (argv[1], argv[2])...

             

            Therefore, you shouldn't really care about those additional arguments, because they are for RCCE, not for your code. Just make sure that you do all the initialization stuff properly.

            • 3. Re: Running a program with multiple arguments on SCC
              tedk

              If this is a RCCE program you do not want to get rid of those arguments. They are not the cause of your seg fault. If this is not a RCCE program, you should not be using rccerun.

               

              Note that RCCE.h just has

              #define RCCE_APP main