Parallelization of the example scripts

Hi all,

Apologies for my ignorance, but I’d like to run the couette flow example you have provided on multiple processors but I’m not sure how to go about running the code in parallel rather than in serial. Could you please give me some advice on how to go about doing this? I’ve tried looking through the documentation and forum but I wasn’t able to find anything that I could understand. I doubt it’s as simple as compiling the code and then saying mpirun -np 2 ./couette rather than ./couette. Thanks in advance for your help and patience.

Cheers,
Sean

Hi there, is this thread useful? Using multiple processes

Best,

-Jake

Hi Jake,

Thanks for the reply. Yes that thread gave me a clue that CfMPI came into the picture. I have managed to run on 8 processors by adding

CfMPI* cfmpi;

and then cfmpi in FlowField after the argument b. I’m pleased it works although I don’t know why it does.

Regards,
Sean

As far as I understand CfMPI is a wrapper class that handles most of the MPI parallelisation duties in the background so you don’t have to worry about it. It needs to be passed to FlowFields when they’re initialised because they’re split across multiple processes in general. (And then after that operations on FlowFields which are ultimately almost all of the activity are automatically parallel.)

By the way, I think the couette example is from the old ‘Channelflow 1.5’ version which is not particularly backwards compatible with the parallel 2.0 code (though it sounds like you got it working which is good). If what you want to do is integrate a plane Couette flow then programs/simulateflow.cpp is probably what you need.

Thanks very much for the advice. I’ll take a look at that particular program for more insight.

Kind regards,
Sean