Revision 1531

branches/threaded2merge/examples/threaded/multisimple/msimple.cfg (revision 1531)
1
[General]
2
config_proj_version=1
3

  
4
[memcheck]
5
alignment=8
6
freelist-vol=10000000
7
leak-check=full
8
leak-resolution=low
9
partial-loads-ok=yes
10
show-reachable=yes
11
track-origins=yes
12
workaround-gcc296-bugs=no
13

  
14
[valgrind]
15
child-silent-after-fork=yes
16
db-attach=no
17
db-command=/usr/bin/gdb -nw %f %p
18
demangle=yes
19
error-limit=yes
20
gen-suppressions=no
21
input-fd=0
22
kernel-variant=none
23
log-fd=2
24
log-file=
25
log-socket=
26
max-stackframe=2000000
27
num-callers=12
28
run-libc-freeres=yes
29
show-below-main=no
30
show-emwarns=no
31
sim-hints=none
32
smc-check=stack
33
suppressions=
34
time-stamp=no
35
tool=memcheck
36
trace-children=no
37
track-fds=no
38
verbosity=1
39
xml=yes
40
xml-user-comment=
41

  
42
[valkyrie]
43
binary=/home/jsibert/admb/threaded2/examples/threaded/multisimple/msimple
44
binary-flags=
45
browser=
46
default-logdir=/tmp/valkyrie_jsibert/
47
font-gen-sys=true
48
font-gen-user="Luxi Sans,10,-1,5,50,0,0,0,0,0"
49
font-tool-user="Misc Fixed,11,-1,5,50,0,0,0,0,0"
50
project-file=
51
show-butt-text=false
52
show-tooltips=true
53
src-editor=gvim
54
src-lines=2
55
use-vk-palette=true
56
vg-exec=valgrind
57
view-log=
58
working-dir=./
branches/threaded2merge/examples/threaded/multisimple/msimple.tpl (revision 1531)
1
//$Id: msimple.tpl 3054M 2013-01-11 20:23:43Z (local) $
2

  
3
GLOBALS_SECTION
4
  #include <pthread.h>
5
  #include <fvar.hpp>
6
  #include <adthread.h>
7

  
8
 
9
  // write the function to run on the threads
10
  void simple_thread(void * ptr)
11
  {
12
      // cast the pointer to the propper type
13
      new_thread_data * tptr = (new_thread_data *) ptr;
14

  
15
      // set up the gradient stack for the thread
16
      gradient_structure::set_MAX_NVAR_OFFSET(10000);
17
      gradient_structure::set_GRADSTACK_BUFFER_SIZE(20000000);
18
      gradient_structure::set_CMPDIF_BUFFER_SIZE   (20000000);
19
      gradient_structure gs(30000000);
20
   
21
      // get the thread number
22
      ad_comm::pthread_manager->set_slave_number(tptr->thread_no);
23

  
24
    
25
      // take control of the constant buffer for reading
26
      ad_comm::pthread_manager->cread_lock_buffer(0);
27
      // read the independent variables IN THE SAME ORDER AS THEY ARE SENT
28
      dvector x = ad_comm::pthread_manager->get_dvector(0);
29
      cerr << " * * *  got x chunk " << tptr->thread_no << " from " << x.indexmin() << " to " << x.indexmax() << endl;
30
      dvector Y = ad_comm::pthread_manager->get_dvector(0);
31
      cerr << " * * *  got Y chunk " << tptr->thread_no << " from " << Y.indexmin() << " to " << Y.indexmax() << endl;
32
     // release the constant buffer
33
      ad_comm::pthread_manager->cread_unlock_buffer(0);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff