Jonathan, > Thanks to the detailed write-up and example 32, I have been able to get > multi-threading working via the WorkStream. Everything is running well, > except that I am not sure what to do about using parsed functions during > the assembly process. In my assemble_cell() function, in order to get the > correct answer, I have to put mutex statements around the calls to > parsed_function.value_list and the like. I haven't checked it thoroughly > yet, but I know that before this caused some serious performance > degradation.
That's not the way it's supposed to be :-( Apparently the underlying fparser library is not thread-safe. If you wanted to invest half an hour, it may be worth adding this mutex to the FunctionParser class, rather than user code, so that everyone who uses the class gets the benefit of thread-safety. That said: > Would it work to put these parsed functions in the ScratchData? Would sort > of overhead would that generate? Do you have a recommended way of dealing > with ParsedFunction when using the WorkStream? I don't believe it should yield any significant overhead. I'd put it into the ScratchData object. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: [email protected] www: http://www.math.tamu.edu/~bangerth/ _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
