Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dataflow linker error #614

Merged
merged 2 commits into from Nov 29, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sendrecv/CMakeLists.txt
Expand Up @@ -31,7 +31,7 @@ if(HDF5_CPP_FOUND AND HDF5_THREAD_SAFE AND CMAKE_Fortran_COMPILER AND HDF5_FORTR
add_hpx_executable(sendrecv_client
SOURCES ${sources}
DEPENDENCIES sendrecv_hpx_component ${dependencies}
FOLDER "Examples/Applications/sendrecv")
FOLDER "Examples/Applications/GTCX")

# add a custom target for this example
add_hpx_pseudo_target(examples.sendrecv.sendrecv_hpx)
Expand Down
39 changes: 14 additions & 25 deletions examples/sendrecv/mpi_compare/sendrecv.F90
Expand Up @@ -10,29 +10,29 @@ program sendrecv_compare

integer right_pe,i,j
integer mgrid,icount,idest
integer repeats
integer ierror
integer mype,numberpe,left_pe
integer isource,isendtag,irecvtag,istatus(MPI_STATUS_SIZE)
integer repeats
real*8 NOWTIME,PASTTIME,TIME,MAXTIME

call mpi_init(ierror)
PASTTIME = MPI_WTIME()
call mpi_comm_size(mpi_comm_world,numberpe,ierror)
call mpi_comm_rank(mpi_comm_world,mype,ierror)

mgrid = 1000
repeats = 1000

mgrid = 10000
repeats = 10000

allocate(send(mgrid),recv(mgrid))
do i=1,mgrid
send(i) = mype + i*(mype*i)**(1.0d0/mype)
enddo

right_pe = mype + 1
if ( right_pe .ge. numberpe ) then
right_pe = 0
endif
left_pe = mype - 1
if ( left_pe .lt. 0 ) then
if ( left_pe .le. 0 ) then
left_pe = numberpe-1
endif

Expand All @@ -43,27 +43,16 @@ program sendrecv_compare
isendtag=mype
irecvtag=isource

do j=1,mgrid
send(j) = mype + j*(j*(mype+1))**(1.0d0/(mype+1))
enddo

do i=1,repeats
do j=1,mgrid
send(j) = mype + j*(mype*i*repeats)**(1.0d0/mype)
enddo
call MPI_SENDRECV(send,icount,MPI_DOUBLE_PRECISION,&
idest,isendtag,&
recv,icount,MPI_DOUBLE_PRECISION,&
isource,irecvtag,mpi_comm_world,istatus,ierror)
idest,isendtag,&
recv,icount,MPI_DOUBLE_PRECISION,&
isource,irecvtag,mpi_comm_world,istatus,ierror)
enddo
NOWTIME = MPI_WTIME()
TIME = NOWTIME-PASTTIME
icount = 1
call MPI_BARRIER(mpi_comm_world,ierror)
call MPI_REDUCE(TIME,MAXTIME,icount,MPI_DOUBLE_PRECISION,&
MPI_MAX,0, &
MPI_COMM_WORLD,ierror)
if ( mype .eq. 0 ) then
print*,' TIME ', MAXTIME
endif
!print*,' TIME ',NOWTIME-PASTTIME,' mype ', mype

deallocate(send,recv)

end program sendrecv_compare
16 changes: 9 additions & 7 deletions examples/sendrecv/sendrecv_hpx/server/loop.F90
Expand Up @@ -16,10 +16,13 @@ Subroutine loop(hpx4_bti,hpx4_mype,hpx4_numberpe)
integer mgrid,icount,idest
integer repeats

mgrid = 1000
repeats = 1000
mgrid = 10000
repeats = 10000

allocate(send(mgrid),recv(mgrid))
do i=1,mgrid
send(i) = hpx4_mype + i*(hpx4_mype*i)**(1.0d0/hpx4_mype)
enddo

right_pe = hpx4_mype + 1
if ( right_pe .ge. hpx4_numberpe ) then
Expand All @@ -30,11 +33,10 @@ Subroutine loop(hpx4_bti,hpx4_mype,hpx4_numberpe)
icount=mgrid
idest= right_pe

do j=1,mgrid
send(j) = hpx4_mype + j*(j*(hpx4_mype+1))**(1.0d0/(hpx4_mype+1))
enddo

do j=1,repeats
do i=1,repeats
do j=1,mgrid
send(j) = hpx4_mype + j*(hpx4_mype*i*repeats)**(1.0d0/hpx4_mype)
enddo
call sndrecv_toroidal_cmm(hpx4_bti,send,icount,recv,icount,idest)
enddo

Expand Down
3 changes: 0 additions & 3 deletions examples/sendrecv/sendrecv_hpx/server/partition.cpp
Expand Up @@ -45,10 +45,7 @@ namespace sendrecv { namespace server
int t2 = static_cast<int>(numberpe);
int t1 = static_cast<int>(mype);

hpx::util::high_resolution_timer computetime;
FNAME(loop)(static_cast<void*>(this), &t1,&t2);
double ctime = computetime.elapsed();
std::cout << " Time " << ctime << std::endl;
}

void partition::toroidal_sndrecv(double *csend,int* csend_size,double *creceive,int *creceive_size,int* dest)
Expand Down
10 changes: 3 additions & 7 deletions hpx/components/dataflow/server/dataflow.hpp
Expand Up @@ -65,8 +65,7 @@ namespace hpx { namespace lcos { namespace server
BOOST_ASSERT(component_ptr);
delete component_ptr;

lcos::local::spinlock::scoped_lock l(detail::dataflow_counter_data_.mtx_);
++detail::dataflow_counter_data_.destructed_;
detail::update_destructed_count();
}

/// init initializes the dataflow, it creates a dataflow_impl object
Expand All @@ -93,8 +92,7 @@ namespace hpx { namespace lcos { namespace server
}
(*w)->init();

lcos::local::spinlock::scoped_lock l(detail::dataflow_counter_data_.mtx_);
++detail::dataflow_counter_data_.initialized_;
detail::update_initialized_count();
}

dataflow()
Expand Down Expand Up @@ -227,9 +225,7 @@ namespace hpx { namespace lcos { namespace server
}
(*w)->init(BOOST_PP_ENUM(N, M1, _));

lcos::local::spinlock::scoped_lock
l(detail::dataflow_counter_data_.mtx_);
++detail::dataflow_counter_data_.initialized_;
detail::update_initialized_count();
}

template <typename Action, BOOST_PP_ENUM_PARAMS(N, typename A)>
Expand Down
15 changes: 12 additions & 3 deletions hpx/components/dataflow/server/detail/dataflow_impl.hpp
Expand Up @@ -47,7 +47,17 @@ namespace hpx { namespace lcos { namespace server { namespace detail
boost::int64_t destructed_;
lcos::local::spinlock mtx_;
};
HPX_COMPONENT_EXPORT extern dataflow_counter_data dataflow_counter_data_;

/// counter function declarations

HPX_COMPONENT_EXPORT boost::int64_t get_initialized_count();
HPX_COMPONENT_EXPORT boost::int64_t get_constructed_count();
HPX_COMPONENT_EXPORT boost::int64_t get_fired_count();
HPX_COMPONENT_EXPORT boost::int64_t get_destructed_count();
HPX_COMPONENT_EXPORT void update_constructed_count();
HPX_COMPONENT_EXPORT void update_initialized_count();
HPX_COMPONENT_EXPORT void update_fired_count();
HPX_COMPONENT_EXPORT void update_destructed_count();

// call this to register all counter types for dataflow objects
void register_counter_types();
Expand Down Expand Up @@ -439,8 +449,7 @@ namespace hpx { namespace traits
, slots
);

lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down
Expand Up @@ -441,8 +441,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -735,8 +734,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -1029,8 +1027,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -1323,8 +1320,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -1617,8 +1613,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -1911,8 +1906,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -2205,8 +2199,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -2499,8 +2492,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -2793,8 +2785,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down Expand Up @@ -3087,8 +3078,7 @@
, action_id
, slots
);
lcos::local::spinlock::scoped_lock l(mtx);
++dataflow_counter_data_.fired_;
update_fired_count();
}
LLCO_(info)
<< "dataflow_impl<"
Expand Down