make ncalls a static std::atomic<int>