Jun 7, 2013

Netbeans for running parallel c/c++ projects

Help>>
http://forums.netbeans.org/ptopic48696.html

1. Lanch IDE with the following parameters: 
-J-Dnativeexecution.support.logger.level=100 
-J-Dcnd.remote.logger.level=100 
2. Set -j3 in Make options (Tools -> Options -> C/C++ -> Project 
Options -> Make Options) 
3. Create Quote sample (New Project -> Samples -> Quote) and Clean and 
Build it. 
4. Go to IDE Log (View -> IDE Log) and check make's parameters -> 
the -j3 will be where. 
5. Setup some remote host and change build for Quote to that 
host (Project Properties -> Build -> Build Host). 
6. Clean and Build Quote once more and check the IDE Log -> the -j3 
will be where again. 

[netbeans 7.2]

https://netbeans.org/projects/cnd/lists/users/archive/2009-03/message/179

This is for running openmp for c++

  1. mpic++ for some reason or other produces the wrong (???) command line;
    1. it typically looks like this: 
      1. c++ -m32 -O2 -Wl,-z,noexecstack -I/usr/include/mpich2-i386 -L/usr/lib/mpich2/lib -L/usr/lib/mpich2/lib -lmpichcxx -lmpich -lopa -lpthread -lrt
    2. but it should look like this (highlighting changes from above only):
      1. c++ -fopenmp -m32 -O2 -Wl,-z,noexecstack -I/usr/include/mpich2-i386 -L/usr/lib/mpich2/lib -L/usr/lib/mpich2/lib -lmpichcxx -lmpich -lgomp -lpthread -lrt
  2. Therefore, in the properties of your NetBeans project, under C++ Compiler::Additional Options you set the command line to
    1.  -fopenmp -m32 -O2 -Wl,-z,noexecstack -I/usr/include/mpich2-i386 -L/usr/lib/mpich2/lib -L/usr/lib/mpich2/lib -lmpichcxx -lmpich -lgomp -lpthread -lrt
    2. Alternatively you can of course use that as-is on the command line
  3. ..and compile…and it runs, and according to my perf monitor it uses more than one thread. Perfect.

HOW TO ADD COMMANDS TO COMPILER
rightclick and goto project properties->select the compiler(here c) -> add the commands to Additional options.



Still we are using gcc. Next step is to change the compilers from c/c++ to mpicc/mpic++, some people seems to have successfully gotten there.

I'm thinking if I add mpicc as another tool collection in the host it would work..

Following is the current settings in the properties of the new toolchain I added. We can compile with mpicc now.

I set the absolute srun (or mpirun) path in the same way and Ooola its running!!





netbeans remote configuratin


1. set up gnu tool chain (locate it from the server)


Download gnu toolchain (gcc, gmake etc..) if you already do not have on the server from http://gcc.gnu.org/

2. open project from the server using existing code

https://netbeans.org/kb/docs/cnd/remote-modes.html


...As easy as that!

Jun 4, 2013

LInux commands

>>chmod -R 755 . give world executable to all users for the current path
>>ls -l check your permissions in current path

How to find bashrc

>>vi ~/.bashrc

How to figure out what kind of os

>>uname -a

Download a link

>> wget http://archive.eclipse.org/tools/ptp/builds/2.1.0/I.I200811031726/rdt-server-linux-1.0.tar

Using wget with password and username

wget http://link --user=userName --password=passWord 

How to unzip a file

  1. Type at the command prompt
  2. tar xvzf file-1.0.tar.gz - to uncompress a gzip tar file (.tgz or .tar.gz)
  3. tar xvjf file-1.0.tar.bz2 - to uncompress a bzip2 tar file (.tbz or .tar.bz2)
  4. tar xvf file-1.0.tar - to uncompressed tar file (.tar)
  5. x = eXtract, this indicated an extraction c = create to create )
  6. v = verbose (optional) the files with relative locations will be displayed.
  7. z = gzip-ped; j = bzip2-zipped
  8. f = from/to file ... (what is next after the f is the archive file)
  9. The files will be extracted in the current folder (most of the times in a folder with the name 'file-1.0').

When math.h etc is not linked with gcc compiler
>>gcc -Wall calc.c -o calc -lm
How to find a given linux kernal is 32 or 64 bits?
>> uname -m
It actually gives x86_64 indicating 64 bits.
How to change password
>>passwd

Jun 3, 2013

Eclipse PTP configuration on windows/linux

minimum requirements for PTP 6.0:
  • Java 1.6 or later
  • Eclipse 4.2 or later (Eclipse 3.8 should also work)
  • C/C++ Developer Tools (CDT) 8.1 or later
  • Remote System Explorer 3.4 or later is required for RDT (although does not need to be used)
Server-side pre-reqs:
  • git (if Synchronized projects are used) - version 1.5 or later
  • Java (if RDT remote projects are used)
  • Perl (for System Monitoring)
  • gdb (for Parallel Debugger)


http://www.macraigor.com/downloads/Macraigor_with_Eclipse.pdf


cross compiler version of gdb

You'll need need to compile a cross version of gdb. I'd use MinGW and MSYS, then pass this to configure: "--target=i686-linux-gnu --host=i686-pc-mingw32 " (assuming your server is i686).

ptp/rdt


-----------------------------------------------------------------------------------------------------
When you debug a remote application you have gdbserver running on the remote host, and GDB running on the local host. GDB needs to know about the debug symbols and therefore needs to know where your application is, on the local file system.

Another way to say this is that you need two binaries: one on the local host and one on the remote host.

Followers