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!!





1 comment:

Followers