P4OMP is a search-augmented framework that uses a large-scale language model (LLM) to transform serial C/C++ code into OpenMP-annotated parallel code. It is the first system to apply search-based prompting for OpenMP pragma correctness without model tuning or compiler instrumentation. It improves the reliability of prompt-based code generation by leveraging search-augmented generation (RAG) using structured instruction knowledge from OpenMP tutorials. It improves syntactic correctness compared to baseline prompting using GPT-3.5-Turbo by basing the generation on the searched context. It is evaluated against a baseline (using GPT-3.5-Turbo without search) on a comprehensive benchmark of 108 real-world C++ programs taken from the Stack Overflow, PolyBench, and NAS benchmark suites. P4OMP achieves 100% compilation success in all parallelizable cases, while the baseline fails to compile in 20 out of 108 cases. Six cases that depend on non-sequential access iterators or unthread-safe constructs are excluded due to fundamental OpenMP limitations. A detailed analysis shows how P4OMP consistently avoids the range errors, syntax misuses, and incorrect directive combinations that commonly affect reference-generated code. We further demonstrate strong runtime scaling on seven compute-intensive benchmarks on an HPC cluster. P4OMP provides a robust and modular pipeline that significantly improves the reliability and applicability of LLM-generated OpenMP code.