Only a few years ago, shale CEOs and OPEC were in open conflict.

Now, they realize they're in the same boat and need to row in tandem to keep global crude supply and demand in balance, according to interviews with analysts, executives and investors.

The recent rise in crude prices—up more than 40% in the past year—has lifted profits for producers across the globe, but also threatens to erode demand for fossil fuels at a time when electrification is becoming commonplace.

"We're getting to a point where a continued rise in the oil price is going to cause major problems for the global economy," said Amy Meyers Jaffe, director of the program on energy security and climate change at the Council on Foreign Relations.

"There are bigger issues at hand besides output that OPEC and shale producers care about."

OPEC and U.S. representatives have met at least twice this year, with a third high-profile meeting set for Vienna next week. Finding the optimal balance of crude supply and demand will be the hot topic.

Harold Hamm, the billionaire founder of U.S. shale pioneer Continental Resources Inc. (NYSE: CLR), is due to address OPEC ministers, along with fellow shale executives John Hess, CEO of Hess Corp. (NYSE: HES) and Scott Sheffield, executive chairman of Pioneer Natural Resource Co. (NYSE: PXD).

UPDATE - Hamm withdrew from the event weeks ago due to a scheduling conflict, Continental spokeswoman Kristin Thomas told Hart Energy June 18.

Hamm and Hess did not respond to requests for comment ahead of the meeting. Sheffield declined to comment.

"I wouldn't take dialogue and discussion as any kind of collaboration. We're all talking about what does world demand look like for oil," said U.S. Senator Heidi Heitkamp, a North Dakota Democrat who successfully pushed to lift the U.S. oil export ban in 2015.

Lifting that ban ushered in a sea change in global energy, sending nearly 2 million barrels of U.S. crude to India, China and other markets historically dominated by OPEC and forcing the group and its American rivals to be more conciliatory.

Hamm, who called OPEC a "toothless tiger" in 2014, has begun encouraging fellow shale companies to focus more on profitability and less on profligate production. Last month, Hamm addressed a Saudi Aramco board meeting in Houston.

RELATED: Continental CEO Harold Hamm Credits OPEC For Boosting Oil Prices

It was a change in tone for Hamm, who in 2011 erected a granite monument on the windswept plains of North Dakota that boasted of the rising clout of U.S. oil production and the nation's ability to supply its own energy.

The monument to one of the first horizontal shale wells drilled in the U.S. bragged that Continental had helped dispel "the myth that America was running out of oil" and would help the country beat global competitors.

Khalid al-Falih, chairman of state oil giant Aramco and the Saudi energy minister, will be in Vienna along with fellow OPEC ministers to debate whether to extend recent production curbs.

U.S. shale executives will not be part of those discussions but will meet elsewhere in Vienna during the week with Falih and other OPEC ministers.

Stable, Not Higher

U.S. shale producers are prohibited by antitrust law from coordinating their output, making their desire with OPEC to curb volatility and price spikes a difficult one.

"U.S. oil and gas producers need stable oil prices to be successful, not necessarily higher oil prices," said Rob Thummel, portfolio manager of Tortoise Energy Independence Fund, which holds shares of Pioneer and other U.S. producers.

Indeed, some U.S. executives are staying away from Vienna. Mark Papa, the CEO of Centennial Resource Development Inc. (NASDAQ: CDEV), and Ryan Lance, CEO of ConocoPhillips Co. (NYSE: COP), had been slated to attend but backed out.

Lance had been due to speak on a panel with several Persian Gulf producers, but grew concerned that it would seem as if he were the designate U.S. representative at such a forum, according to a source familiar with the company's thinking.

ConocoPhillips declined to comment. Papa did not respond to a request for comment.

OPEC ministers are expected to question the U.S. shale executives about rising output from the Permian Basin of West Texas and New Mexico, the largest U.S. oil field, which pumps more than 3 million barrels per day.

"There is a tsunami of oil coming from the Permian," said Pete Bowden, global head of energy investment banking at Jefferies. "That is a game-changer, not just for the industry domestically, but for international oil and gas supply/demand dynamics."

With U.S. crude exports at a record high, rising Permian production has become more of a concern for OPEC than at any time in history.

"We expect that they [U.S. shale producers] remain independent and do what's in the best interest of their country," Senator Heitkamp said. "We're not going to join OPEC, and we're going to be fiercely competing with them."

That competition, though, increasingly includes a realization that the fate of both sides is tied.

"Consumers will move to electric cars if the oil price spikes," CFR's Jaffe said.