Recent content by davidfur
-
Fortran Parallel DO loop with OpenMP (fortran)
I know even less about pthreads...- davidfur
- Post #8
- Forum: Programming and Computer Science
-
Fortran Parallel DO loop with OpenMP (fortran)
Thanks, but I don't think I understand the problem. Here is the dista3 subroutine, which calculates the distance: subroutine dista3 (n1,pos,dista,dx,dy,dz) include 'cbka.blk' double precision :: pos(3) !********************************************************************* ...- davidfur
- Post #5
- Forum: Programming and Computer Science
-
Fortran Parallel DO loop with OpenMP (fortran)
Why not, Vanadium?- davidfur
- Post #3
- Forum: Programming and Computer Science
-
Fortran Parallel DO loop with OpenMP (fortran)
Hey guys, I've started to read some OpenMP programming and now I'm trying to parallelize small part of a fortran code. The first thing I would like to do is to parallelize the innermost DO loop. It loops through the number of particles (na) and calculates the distance between some point in 3D...- davidfur
- Thread
- Fortran Loop Parallel
- Replies: 8
- Forum: Programming and Computer Science
-
How to use functions defined in an external header-only library?
Wow. This works like magic! I've never heard about "lambda" before! this is exactly what I needed to overcome the "barrier" in transferring member functions to general functions. Though, I wonder how else this could be done without the lambda trick... Thanks Filip!- davidfur
- Post #3
- Forum: Programming and Computer Science
-
How to use functions defined in an external header-only library?
Hey guys, I have written a C++ code which is based on two main classes: Particle and Group. Each Group contains a set of Particle(s), each Particle is defined by a set of coordinates, and has an associated energy and force (the energy/force evaluation is done by calling an external program). I...- davidfur
- Thread
- Functions
- Replies: 3
- Forum: Programming and Computer Science
-
MPI parallel code speed-up sucks
Hey guys, I parallelized my code, written in C++, with the MPI library. Unfortunately, the speed-up I get saturates at x6, with increasing number of cores. Whereas, in theory, the speed-up should really be nearly linear. To understand where the bottlenecks come from, I drilled down the code to...- davidfur
- Thread
- C++ Code Parallel
- Replies: 3
- Forum: Programming and Computer Science
-
Fortran Assign 2D Array with Reals in Fortran - Help Needed
Thanks Mark44 for your help! I managed to solve the problem by properly declaring and allocating coords and gradvec variables outside the get_energy_and_grad subroutine. Cheers!- davidfur
- Post #5
- Forum: Programming and Computer Science
-
Fortran Assign 2D Array with Reals in Fortran - Help Needed
Thanks jedishrfu, but it doesn't work either. I suspect there's something wrong with my declarations... I post here the full code if this helps Main program program main use reaxff_interface implicit none integer natoms_ real*8 ereal real*8, allocatable :: coords(:,:) real*8, allocatable ...- davidfur
- Post #3
- Forum: Programming and Computer Science
-
Fortran Assign 2D Array with Reals in Fortran - Help Needed
Hi guys, On with my Fortran adventures...I'm trying to accomplish a simple task: assign a 2D array with some reals. Here's an excerpt from the code: subroutine get_energy_and_grad(natoms_,coords,ereal,gradmat) include 'cbka.blk' include 'opt.blk' integer, intent(in) :: natoms_...- davidfur
- Thread
- 2d Array Assignment
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran Interface between a Fortran77 program and a Fortran90 program
DrClaude: Thanks! following your words, I now understand what I was doing wrong. The trouble was that I was using the dbl variable inside my_sub as if it was passed by reference from the module (without adding use my_mod). When I did add use my_mod to my_sub, and removed the declaration of dbl...- davidfur
- Post #15
- Forum: Programming and Computer Science
-
Fortran Interface between a Fortran77 program and a Fortran90 program
If that is the reason, then it's a bit weird...because I did include use my_mod in main.f90, and directly calling double_coords didn't work either. Returned same answer as with the my_mod route.- davidfur
- Post #12
- Forum: Programming and Computer Science
-
Fortran Interface between a Fortran77 program and a Fortran90 program
DrClaude: and why's that? Do i need to write an INTERFACE statement in the beginning of my_mod to make the subroutine access the module variable dbl? jedishrfu: I also tried calling double_coords directly from main.f90, but still all I see is 0.0000, 0.0000, 0.0000- davidfur
- Post #10
- Forum: Programming and Computer Science
-
Fortran Interface between a Fortran77 program and a Fortran90 program
Right. First of all, I converted all the f77 sources to f90 sources with f2f (https://bitbucket.org/lemonlab/f2f/). Now to the actual interface part. Just to begin to understand how these things work, I've built three example files (main.f90, my_mod.f90 and my_sub.f90). Let's suppose that...- davidfur
- Post #6
- Forum: Programming and Computer Science
-
Fortran Interface between a Fortran77 program and a Fortran90 program
Hi jedishrfu Thanks for your answer! That's probably a good idea, I'll look into the links you provided. So, in your opinion what would be a good strategy for this kind of interface? i.e. building in interface between two independent programs (suppose they are both f90) ? And, what about when...- davidfur
- Post #3
- Forum: Programming and Computer Science