#include <omp.h>
#endif
-#ifdef PTHREADS
+#if defined PTHREADS || defined VISUAL_THREAD
#include <pthread.h>
#endif
struct timeval t1,t2;
//double tp;
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
u8 first,change;
pthread_t io_thread;
int ret;
moldyn->debug=0;
/* zero & init moldyn copy */
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
memset(&md_copy,0,sizeof(t_moldyn));
atom_copy=malloc(moldyn->count*sizeof(t_atom));
if(atom_copy==NULL) {
}
if(a) {
if(!(moldyn->total_steps%a)) {
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
/* check whether thread has not terminated yet */
if(!first) {
ret=pthread_join(io_thread,NULL);
/* get current time */
gettimeofday(&t2,NULL);
-printf("\rsched:%d, steps:%d/%d, T:%4.1f/%4.1f P:%4.1f/%4.1f V:%6.1f (%d)",
+printf("sched:%d, steps:%d/%d, T:%4.1f/%4.1f P:%4.1f/%4.1f V:%6.1f (%d)\n",
sched->count,i,moldyn->total_steps,
moldyn->t,moldyn->t_avg,
moldyn->p/BAR,moldyn->p_avg/BAR,
return 0;
}
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
void *visual_atoms(void *ptr) {
#else
int visual_atoms(t_moldyn *moldyn) {
t_visual *v;
t_atom *atom;
t_vb vb;
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
t_moldyn *moldyn;
moldyn=ptr;
vb.fd=open(file,O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
if(vb.fd<0) {
perror("open visual save file fd");
-#ifndef PTHREADS
+#ifndef VISUAL_THREAD
return -1;
#endif
}
atom[i].ekin);
// bonds between atoms
+#ifndef VISUAL_THREAD
process_2b_bonds(moldyn,&vb,visual_bonds_process);
+#endif
// boundaries
if(dim.x) {
close(vb.fd);
-#ifdef PTHREADS
+#ifdef VISUAL_THREAD
pthread_exit(NULL);
}